/* ── Fonte de ícones — Material Symbols Rounded (auto-hospedada) ────────── */
@font-face {
  font-family: 'Material Symbols Rounded';
  font-style:  normal;
  font-weight: 100 700;
  font-display: block;
  src: url('/assets/fonts/ms-rounded/MaterialSymbolsRounded.woff2') format('woff2');
}

/* ── Editor: fontes locais ──────────────────────────────────────────────── */
@font-face { font-family:'Poppins';         font-weight:400; font-display:swap; src:url('/assets/fonts/poppins/poppins-400.woff2') format('woff2'); }
@font-face { font-family:'Poppins';         font-weight:700; font-display:swap; src:url('/assets/fonts/poppins/poppins-700.woff2') format('woff2'); }
@font-face { font-family:'Montserrat';      font-weight:400; font-display:swap; src:url('/assets/fonts/montserrat/montserrat-400.woff2') format('woff2'); }
@font-face { font-family:'Montserrat';      font-weight:700; font-display:swap; src:url('/assets/fonts/montserrat/montserrat-700.woff2') format('woff2'); }
@font-face { font-family:'Roboto';          font-weight:400; font-display:swap; src:url('/assets/fonts/roboto/roboto-400.woff2') format('woff2'); }
@font-face { font-family:'Roboto';          font-weight:700; font-display:swap; src:url('/assets/fonts/roboto/roboto-700.woff2') format('woff2'); }
@font-face { font-family:'Open Sans';       font-weight:400; font-display:swap; src:url('/assets/fonts/open-sans/open-sans-400.woff2') format('woff2'); }
@font-face { font-family:'Open Sans';       font-weight:700; font-display:swap; src:url('/assets/fonts/open-sans/open-sans-700.woff2') format('woff2'); }
@font-face { font-family:'Lato';            font-weight:400; font-display:swap; src:url('/assets/fonts/lato/lato-400.woff2') format('woff2'); }
@font-face { font-family:'Lato';            font-weight:700; font-display:swap; src:url('/assets/fonts/lato/lato-700.woff2') format('woff2'); }
@font-face { font-family:'Raleway';         font-weight:400; font-display:swap; src:url('/assets/fonts/raleway/raleway-400.woff2') format('woff2'); }
@font-face { font-family:'Raleway';         font-weight:700; font-display:swap; src:url('/assets/fonts/raleway/raleway-700.woff2') format('woff2'); }
@font-face { font-family:'Raleway';         font-weight:900; font-display:swap; src:url('/assets/fonts/raleway/raleway-900.woff2') format('woff2'); }
@font-face { font-family:'Oswald';          font-weight:400; font-display:swap; src:url('/assets/fonts/oswald/oswald-400.woff2') format('woff2'); }
@font-face { font-family:'Oswald';          font-weight:700; font-display:swap; src:url('/assets/fonts/oswald/oswald-700.woff2') format('woff2'); }
@font-face { font-family:'Bebas Neue';      font-weight:400; font-display:swap; src:url('/assets/fonts/bebas-neue/bebas-neue-400.woff2') format('woff2'); }
@font-face { font-family:'Righteous';       font-weight:400; font-display:swap; src:url('/assets/fonts/righteous/righteous-400.woff2') format('woff2'); }
@font-face { font-family:'Fredoka One';     font-weight:400; font-display:swap; src:url('/assets/fonts/fredoka-one/fredoka-one-400.woff2') format('woff2'); }
@font-face { font-family:'Black Ops One';   font-weight:400; font-display:swap; src:url('/assets/fonts/black-ops-one/black-ops-one-400.woff2') format('woff2'); }
@font-face { font-family:'Playfair Display';font-weight:400; font-display:swap; src:url('/assets/fonts/playfair-display/playfair-display-400.woff2') format('woff2'); }
@font-face { font-family:'Playfair Display';font-weight:700; font-display:swap; src:url('/assets/fonts/playfair-display/playfair-display-700.woff2') format('woff2'); }
@font-face { font-family:'Merriweather';    font-weight:400; font-display:swap; src:url('/assets/fonts/merriweather/merriweather-400.woff2') format('woff2'); }
@font-face { font-family:'Merriweather';    font-weight:700; font-display:swap; src:url('/assets/fonts/merriweather/merriweather-700.woff2') format('woff2'); }
@font-face { font-family:'Lora';            font-weight:400; font-display:swap; src:url('/assets/fonts/lora/lora-400.woff2') format('woff2'); }
@font-face { font-family:'Lora';            font-weight:700; font-display:swap; src:url('/assets/fonts/lora/lora-700.woff2') format('woff2'); }
@font-face { font-family:'Dancing Script';  font-weight:400; font-display:swap; src:url('/assets/fonts/dancing-script/dancing-script-400.woff2') format('woff2'); }
@font-face { font-family:'Dancing Script';  font-weight:700; font-display:swap; src:url('/assets/fonts/dancing-script/dancing-script-700.woff2') format('woff2'); }
@font-face { font-family:'Great Vibes';     font-weight:400; font-display:swap; src:url('/assets/fonts/great-vibes/great-vibes-400.woff2') format('woff2'); }
@font-face { font-family:'Pacifico';        font-weight:400; font-display:swap; src:url('/assets/fonts/pacifico/pacifico-400.woff2') format('woff2'); }
@font-face { font-family:'Satisfy';         font-weight:400; font-display:swap; src:url('/assets/fonts/satisfy/satisfy-400.woff2') format('woff2'); }
@font-face { font-family:'Caveat';          font-weight:400; font-display:swap; src:url('/assets/fonts/caveat/caveat-400.woff2') format('woff2'); }
@font-face { font-family:'Caveat';          font-weight:700; font-display:swap; src:url('/assets/fonts/caveat/caveat-700.woff2') format('woff2'); }
@font-face { font-family:'Permanent Marker';font-weight:400; font-display:swap; src:url('/assets/fonts/permanent-marker/permanent-marker-400.woff2') format('woff2'); }
@font-face { font-family:'Kalam';           font-weight:400; font-display:swap; src:url('/assets/fonts/kalam/kalam-400.woff2') format('woff2'); }
@font-face { font-family:'Kalam';           font-weight:700; font-display:swap; src:url('/assets/fonts/kalam/kalam-700.woff2') format('woff2'); }

/* ── Variáveis — Tema Claro (Xiglute Official) ─────────────────────────── */
:root {
  /* Cores da logomarca Xiglute */
  --primary:        #4da2c5;
  --primary-dark:   #3a7d99;
  --primary-darker: #4e7280;
  --primary-light:  #e8f4f9;
  --primary-mid:    #49acd5;
  --accent:         #1871b5;
  --accent-light:   #e3eef9;

  /* Backgrounds */
  --bg:             #f4f6f8;
  --surface:        #ffffff;
  --surface2:       #f9fafb;
  --surface3:       #eef2f5;

  /* Bordas e divisores */
  --border:         #dde3e9;
  --divider:        #eaecef;

  /* Textos */
  --text:           #1a1a2e;
  --text2:          #4a5568;
  --text3:          #8896a5;
  --text-on-primary:#ffffff;

  /* Feedback */
  --success:        #4caf50;
  --warning:        #ff9800;
  --error:          #f44336;
  --info:           #2196f3;
  --liked:          #f42738;

  /* Layout */
  --topbar-h:       56px;
  --bottomnav-h:    60px;
  --radius:         14px;
  --radius-sm:      8px;
  --radius-xs:      6px;
  --shadow:         0 2px 10px rgba(77,162,197,.12);
  --shadow-md:      0 4px 16px rgba(77,162,197,.18);
  --shadow-lg:      0 8px 32px rgba(77,162,197,.22);
  --transition:     .2s ease;

  /* Gradiente da marca */
  --gradient:       linear-gradient(135deg, #4da2c5 0%, #1871b5 100%);
  --gradient-dark:  linear-gradient(135deg, #3a7d99 0%, #0f5490 100%);
}

/* ── Tema Escuro ────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --primary:        #5bb5d8;
  --primary-dark:   #4da2c5;
  --primary-darker: #3a7d99;
  --primary-light:  #0d2a38;
  --primary-mid:    #60bfde;
  --accent:         #4a9fd4;
  --accent-light:   #0d2236;

  --bg:             #0f1419;
  --surface:        #192028;
  --surface2:       #1e2a36;
  --surface3:       #243040;

  --border:         #2a3a4a;
  --divider:        #243040;

  --text:           #e8edf2;
  --text2:          #a0aec0;
  --text3:          #637080;
  --text-on-primary:#ffffff;

  --shadow:         0 2px 10px rgba(0,0,0,.4);
  --shadow-md:      0 4px 16px rgba(0,0,0,.5);
  --shadow-lg:      0 8px 32px rgba(0,0,0,.6);

  --gradient:       linear-gradient(135deg, #2d7a9e 0%, #0f5490 100%);
  --gradient-dark:  linear-gradient(135deg, #1f5a76 0%, #0a3d6b 100%);
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body, 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.01em;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  width: 100%;
  outline: none;
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--transition), background var(--transition);
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); }

/* ── Ícones — Material Symbols Rounded (solid/filled, hospedado localmente) */
.xi {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.xi-home::before        { content: "home"; }
.xi-people::before      { content: "group"; }
.xi-add::before         { content: "add"; }
.xi-chat::before        { content: "chat"; }
.xi-person::before      { content: "person"; }
.xi-search::before      { content: "search"; }
.xi-bell::before        { content: "notifications"; }
.xi-arrow-back::before  { content: "arrow_back"; }
.xi-like::before        { content: "thumb_up"; }
.xi-dislike::before     { content: "thumb_down"; }
.xi-comment::before     { content: "comment"; }
.xi-share::before       { content: "share"; }
.xi-send::before        { content: "send"; }
.xi-image::before       { content: "image"; }
.xi-video::before       { content: "videocam"; }
.xi-close::before       { content: "close"; }
.xi-more::before        { content: "more_vert"; }
.xi-check::before       { content: "check"; }
.xi-star::before        { content: "star"; }
.xi-moon::before        { content: "dark_mode"; }
.xi-sun::before         { content: "light_mode"; }
.xi-edit::before        { content: "edit"; }
.xi-delete::before      { content: "delete"; }
.xi-music::before       { content: "music_note"; }
.xi-event::before       { content: "event"; }
.xi-store::before       { content: "storefront"; }
.xi-blog::before        { content: "article"; }
.xi-trophy::before      { content: "emoji_events"; }
.xi-location::before    { content: "location_on"; }
.xi-link::before        { content: "link"; }
.xi-photo::before       { content: "photo_camera"; }
.xi-plus::before        { content: "add_circle"; }
.xi-close::before       { content: "close"; }
.xi-send::before        { content: "send"; }
.xi-delete::before      { content: "delete"; }
.xi-hide::before        { content: "visibility_off"; }
.xi-image::before       { content: "image"; }

/* ── Splash ─────────────────────────────────────────────────────────────── */
#splash-screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--gradient);
  z-index: 9999; gap: 2rem;
}
.splash-logo { width: 110px; height: 110px; border-radius: 22px; box-shadow: var(--shadow-lg); }
.splash-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--gradient);
  color: #fff;
  display: flex; align-items: center; gap: .5rem;
  padding: 0 .5rem;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.topbar-title {
  flex: 1; font-size: 1.1rem; font-weight: 700;
  padding: 0 .5rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: .02em;
}
.topbar-btn {
  width: 40px; height: 40px;
  border-radius: 50%; color: #fff;
  font-size: 1.15rem;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.topbar-btn:hover { background: rgba(255,255,255,.18); }
.topbar-actions { display: flex; gap: .25rem; }
.topbar-chat-avatar {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
  flex-shrink: 0; border: 2px solid rgba(255,255,255,.5);
}
.notif-btn { position: relative; }

/* ── Voice button ────────────────────────────────────────────────────────── */
#btn-voice.voice-active { color: #f55; }
#btn-voice.voice-active i { animation: xi-mic-pulse 1.2s ease-in-out infinite; }
@keyframes xi-mic-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .6; transform: scale(1.25); }
}

/* ── Bottom Navigation ───────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bottomnav-h);
  background: var(--surface);
  border-top: 1.5px solid var(--border);
  display: flex; align-items: center;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,.08);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px; color: var(--text3);
  font-size: .62rem; font-weight: 500;
  padding: .25rem 0;
  transition: color var(--transition);
  position: relative; text-decoration: none;
}
.nav-item.active     { color: var(--primary); }
.nav-item.active > i { transform: scale(1.1); }
.nav-item > i        { font-size: 1.25rem; transition: transform var(--transition); }
.nav-create {
  width: 50px; height: 50px;
  background: var(--gradient);
  border-radius: 50%; color: #fff !important;
  flex: none; margin: 0 .5rem;
  box-shadow: 0 4px 16px rgba(77,162,197,.45);
  transition: box-shadow var(--transition), transform var(--transition);
}
.nav-create:active { transform: scale(.94); }

/* ── Page container ──────────────────────────────────────────────────────── */
#page-container {
  padding-top: var(--topbar-h);
  padding-bottom: var(--bottomnav-h);
  min-height: 100vh;
}
/* Quando a rota não tem topbar/nav (login, signup, forgot-password):
   remove o padding e trava o scroll no body */
#page-container:has(.login-page) {
  padding: 0;
  min-height: unset;
  overflow: hidden;
}
body:has(.login-page) {
  overflow: hidden;
}

/* ── Badge ───────────────────────────────────────────────────────────────── */
.badge {
  position: absolute; top: 0; right: 0;
  min-width: 18px; height: 18px;
  background: var(--error); color: #fff;
  font-size: .62rem; font-weight: 700;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden; margin-bottom: .75rem;
  border: 1px solid var(--divider);
  transition: background var(--transition), border-color var(--transition);
}
.card-header { padding: .75rem 1rem; display: flex; align-items: center; gap: .75rem; }
.card-body   { padding: 0 1rem .75rem; }
.card-footer { padding: .5rem 1rem; border-top: 1px solid var(--divider); display: flex; gap: .5rem; }

/* ── Avatar ──────────────────────────────────────────────────────────────── */
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover; background: var(--border); flex-shrink: 0;
  border: 2px solid var(--surface);
}
.avatar-lg  { width: 58px; height: 58px; }
.avatar-xl  { width: 80px; height: 80px; }
.avatar-xxl { width: 120px; height: 120px; }

/* ── Button ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .65rem 1.25rem; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 600;
  transition: all var(--transition); cursor: pointer; border: none;
}
.btn-primary   { background: var(--gradient);  color: #fff; box-shadow: 0 2px 8px rgba(77,162,197,.35); }
.btn-primary:hover { background: var(--gradient-dark); box-shadow: 0 4px 12px rgba(77,162,197,.45); }
.btn-outline   { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost     { background: transparent; color: var(--text2); }
.btn-ghost:hover   { background: var(--surface3); }
.btn-accent    { background: var(--accent); color: #fff; }
.btn-danger    { background: var(--error); color: #fff; }
.btn-success   { background: #22c55e; color: #fff; }
.btn-success:hover { background: #16a34a; }
.btn-sm        { padding: .4rem .85rem; font-size: .8rem; border-radius: var(--radius-xs); }
.btn-block     { width: 100%; }
.btn:disabled  { opacity: .5; cursor: not-allowed; }
.btn:active    { transform: scale(.97); }

/* ── Form ────────────────────────────────────────────────────────────────── */
.form-group  { margin-bottom: 1rem; }
.form-label  { display: block; font-size: .84rem; font-weight: 600; color: var(--text2); margin-bottom: .35rem; }
.form-error  { font-size: .8rem; color: var(--error); margin-top: .25rem; }
.form-hint   { font-size: .8rem; color: var(--text3); margin-top: .25rem; }

/* ── Page helpers ────────────────────────────────────────────────────────── */
.page         { padding: 1rem; }
.page-full    { padding: 0; }
.section-title {
  font-size: .78rem; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: .07em;
  padding: .75rem 1rem .25rem;
}

/* ── Login ───────────────────────────────────────────────────────────────── */
.login-page {
  height: 100dvh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 2rem 1.5rem;
  background: var(--gradient);
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  scrollbar-width: none;
}
.login-page::-webkit-scrollbar { display: none; }
.login-page::before {
  content: '';
  position: absolute; top: -60px; right: -60px;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.login-page::after {
  content: '';
  position: absolute; bottom: -80px; left: -40px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.login-logo {
  width: 88px; height: 88px; border-radius: 20px;
  margin-bottom: 1.5rem; box-shadow: var(--shadow-lg);
  position: relative; z-index: 1;
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  position: relative; z-index: 1;
}
.login-title {
  font-size: 1.6rem; font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center; margin-bottom: .25rem;
}
.login-subtitle {
  text-align: center; color: var(--text2);
  font-size: .88rem; margin-bottom: 1.5rem;
}
.login-divider {
  display: flex; align-items: center; gap: 1rem;
  color: var(--text3); font-size: .78rem; margin: 1.25rem 0;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.btn-social {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font-size: .9rem; font-weight: 600;
  width: 100%; margin-bottom: .75rem;
  transition: background var(--transition), border-color var(--transition);
}
.btn-social:hover { background: var(--primary-light); border-color: var(--primary); }
.btn-social img, .btn-social svg { width: 22px; height: 22px; flex-shrink: 0; }
.login-footer {
  text-align: center; margin-top: 1.25rem;
  font-size: .85rem; color: var(--text2);
}
.login-legal-footer {
  display: flex; align-items: center; justify-content: center;
  gap: .75rem; padding: 1rem 0 1.5rem;
  font-size: .8rem; flex-shrink: 0;
}
.login-legal-footer a {
  color: rgba(255,255,255,.55); text-decoration: none;
  transition: color .15s;
}
.login-legal-footer a:hover { color: #fff; }
.login-legal-sep {
  width: 1px; height: .85em;
  background: rgba(255,255,255,.3);
  display: inline-block;
}

/* ── Legal pages (Terms / Privacy) ── */
.legal-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
  color: var(--text1);
  font-size: .93rem;
  line-height: 1.65;
}
.legal-body h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 .25rem;
  color: var(--primary);
}
.legal-body h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.5rem 0 .4rem;
  color: var(--text1);
  border-bottom: 1px solid var(--border);
  padding-bottom: .25rem;
}
.legal-body h4 {
  font-size: .9rem;
  font-weight: 600;
  margin: 1rem 0 .3rem;
  color: var(--text2);
}
.legal-body p { margin: .5rem 0; }
.legal-body ul {
  margin: .4rem 0 .4rem 1.2rem;
  padding: 0;
}
.legal-body ul li { margin: .25rem 0; }
.legal-updated {
  font-size: .8rem;
  color: var(--text3);
  margin: 0 0 1.25rem !important;
}
.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
  margin: .75rem 0;
}
.legal-table th, .legal-table td {
  border: 1px solid var(--border);
  padding: .45rem .6rem;
  text-align: left;
  vertical-align: top;
}
.legal-table th {
  background: var(--surface2, #f5f5f5);
  font-weight: 600;
  color: var(--text2);
}

/* ── Chat Share Sheet ── */
.xi-share-overlay {
  position: fixed; inset: 0; z-index: 10001;
  background: rgba(0,0,0,.45);
  display: flex; align-items: flex-end;
  opacity: 0; transition: opacity .2s;
  pointer-events: none;
}
.xi-share-overlay.open { opacity: 1; pointer-events: auto; }
.xi-share-sheet {
  width: 100%; max-height: 75vh;
  background: var(--surface); border-radius: 18px 18px 0 0;
  display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .25s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.xi-share-overlay.open .xi-share-sheet { transform: translateY(0); }
.xi-share-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: var(--border); margin: .6rem auto .2rem;
  flex-shrink: 0;
}
.xi-share-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .5rem 1rem .5rem 1.1rem; flex-shrink: 0;
  font-size: .95rem; font-weight: 700; color: var(--text1);
  border-bottom: 1px solid var(--border);
}
.xi-share-close-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text3); padding: .25rem;
  display: flex; align-items: center;
}
.xi-share-search-wrap {
  position: relative; padding: .5rem .75rem; flex-shrink: 0;
}
.xi-share-search-ico {
  position: absolute; left: 1.3rem; top: 50%;
  transform: translateY(-50%); color: var(--text3);
  font-size: 1.05rem; pointer-events: none;
}
.xi-share-search {
  width: 100%; box-sizing: border-box;
  padding-left: 2.3rem; background: var(--surface2,#f0f2f5);
  border: none; border-radius: 20px; padding-right: .75rem;
}
.xi-share-list {
  overflow-y: auto; flex: 1;
  padding: .25rem 0 .5rem;
}
.xi-share-contact {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem 1rem; cursor: pointer;
  transition: background .12s;
}
.xi-share-contact:hover, .xi-share-contact:active { background: var(--surface2,#f0f2f5); }
.xi-share-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.xi-share-avatar-grp {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; color: #fff;
}
.xi-share-cname {
  font-size: .9rem; color: var(--text1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Social Games grid ── */
.sgames-grid {
  padding: .75rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .6rem;
}
.sgames-card {
  cursor: pointer; border-radius: 10px;
  overflow: hidden; background: var(--surface);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  transition: transform .15s, box-shadow .15s;
}
.sgames-card:active { transform: scale(.97); box-shadow: none; }
.sgames-thumb-wrap {
  position: relative; padding-bottom: 75%; overflow: hidden;
  background: var(--surface2,#f0f2f5);
}
.sgames-thumb {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
.sgames-thumb-icon {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; background: rgba(0,0,0,.3);
  transition: opacity .15s; color: #fff; font-size: 2rem;
}
.sgames-card:hover .sgames-thumb-icon { opacity: 1; }
.sgames-name {
  padding: .35rem .45rem .4rem;
  font-size: .75rem; font-weight: 600;
  color: var(--text1); line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.login-divider {
  text-align: center; font-size: .78rem; color: var(--text3);
  margin: 1rem 0 .75rem; position: relative;
}
.login-divider::before, .login-divider::after {
  content: ''; position: absolute; top: 50%; width: 38%; height: 1px;
  background: var(--divider);
}
.login-divider::before { left: 0; }
.login-divider::after  { right: 0; }
.login-divider-thin {
  text-align: center; font-size: .78rem; color: var(--text3);
  margin: .75rem 0;
}

/* ── Eye toggle (campo senha) ──────────────────────────────────────────────── */
.input-eye-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-eye-wrap input {
  flex: 1;
  padding-right: 2.6rem;
}
.input-eye-btn {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text3);
  border-radius: 0 var(--radius) var(--radius) 0;
  transition: color var(--transition);
}
.input-eye-btn:hover { color: var(--primary); }
.input-eye-btn .ms-icon { font-size: 1.1rem; }

/* ── Form helpers ──────────────────────────────────────────────────────────── */
.form-hint {
  font-size: .76rem;
  color: var(--text3);
  margin-top: .25rem;
  display: block;
}
.form-error {
  font-size: .8rem;
  color: #e55;
  margin-top: .35rem;
}

/* ── Signup — indicador de etapas ──────────────────────────────────────────── */
.signup-steps {
  display: flex;
  gap: .4rem;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.signup-step {
  width: 2rem;
  height: 4px;
  border-radius: 2px;
  background: var(--divider);
  transition: background .3s;
}
.signup-step.active { background: var(--primary); }
.signup-step.done   { background: var(--primary-mid); }

/* ── Signup / ForgotPassword — tela de sucesso ─────────────────────────────── */
.signup-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  padding: 1rem 0;
  text-align: center;
}
.signup-success-icon {
  font-size: 3.5rem;
  color: var(--primary);
}

/* ── ForgotPassword — ícone de cadeado ─────────────────────────────────────── */
.fp-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: .75rem;
}
.fp-lock-icon {
  font-size: 2.8rem;
  color: var(--primary);
}

/* ── OTP — grid de dígitos ─────────────────────────────────────────────────── */
.otp-digits {
  display: flex;
  gap: .5rem;
  justify-content: center;
  margin: .5rem 0;
}
.otp-digit {
  width: 3rem;
  height: 3.2rem;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  border-radius: var(--radius);
  border: 1.5px solid var(--divider);
  background: var(--surface-alt, var(--surface));
  color: var(--text);
  caret-color: var(--primary);
  transition: border-color .2s;
}
.otp-digit:focus {
  outline: none;
  border-color: var(--primary);
}
.otp-ddi-select {
  border-radius: var(--radius);
  border: 1.5px solid var(--divider);
  background: var(--surface);
  color: var(--text);
  padding: 0 .4rem;
  font-size: .9rem;
}

/* ── Feed filter tabs ────────────────────────────────────────────────────── */
.feed-filter-bar {
  display: flex;
  overflow-x: auto;
  gap: .45rem;
  padding: .5rem .75rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 56px;
  z-index: 10;
  scrollbar-width: none;
}
.feed-filter-bar::-webkit-scrollbar { display: none; }
.feed-filter-btn {
  flex-shrink: 0;
  padding: .3rem .85rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  font-size: .8rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.feed-filter-btn:hover { background: var(--hover, rgba(0,0,0,.06)); color: var(--text1); }
.feed-filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Feed ────────────────────────────────────────────────────────────────── */
.feed-list { padding: .75rem .75rem 0; }

.post-card {
  background: var(--surface);
  border-radius: var(--radius); margin-bottom: .75rem;
  box-shadow: var(--shadow); overflow: hidden;
  border: 1px solid var(--divider);
  transition: background var(--transition);
}
.post-header { display: flex; align-items: center; gap: .75rem; padding: .8rem; }
.post-meta   { flex: 1; min-width: 0; }
.post-author { font-weight: 700; font-size: .92rem; color: var(--text); cursor: pointer; }
.post-author:hover { color: var(--primary); }
.post-time   { font-size: .73rem; color: var(--text3); margin-top: 1px; }
.post-menu   { padding: .25rem; color: var(--text3); }
.post-body   { padding: 0 .8rem .6rem; font-size: .95rem; line-height: 1.65; word-break: break-word; overflow-wrap: break-word; white-space: pre-line; color: var(--text); }
.post-image  { width: 100%; max-height: 85vh; object-fit: contain; background: var(--surface3); display: block; }
.post-actions { display: flex; border-top: 1px solid var(--divider); }
.action-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .6rem; font-size: .84rem; color: var(--text2);
  transition: background var(--transition), color var(--transition);
}
.action-btn:hover { background: var(--surface3); color: var(--primary); }
.action-btn.liked  { color: var(--liked); }
.action-btn.active { color: var(--primary); }

/* Ícone preenchido quando botão está ativo ou liked */
.action-btn.liked  .ms-icon,
.action-btn.active .ms-icon {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* FILL:1 já é o padrão — "liked" usa peso extra para destaque */
.action-btn.liked .xi-like {
  font-variation-settings: 'FILL' 1, 'wght' 700, 'GRAD' 200, 'opsz' 24;
  filter: drop-shadow(0 0 4px rgba(244,39,56,.35));
}
.action-btn.disliked .xi-dislike {
  font-variation-settings: 'FILL' 1, 'wght' 700, 'GRAD' 200, 'opsz' 24;
  color: var(--error, #f42738);
}

/* ── Stories ─────────────────────────────────────────────────────────────── */
.stories-bar {
  display: flex; gap: .75rem;
  padding: .75rem; overflow-x: auto;
  background: var(--surface);
  border-bottom: 1px solid var(--divider);
  scrollbar-width: none;
}
.stories-bar::-webkit-scrollbar { display: none; }
.story-item {
  display: flex; flex-direction: column;
  align-items: center; gap: .25rem; flex-shrink: 0; cursor: pointer;
}
.story-ring {
  width: 62px; height: 62px; border-radius: 50%; padding: 2.5px;
  background: linear-gradient(45deg, #4da2c5, #1871b5, #49acd5);
}
.story-ring.seen { background: var(--border); }
.story-avatar { width: 100%; height: 100%; border-radius: 50%; border: 2.5px solid var(--surface); object-fit: cover; }
.story-name   { font-size: .63rem; color: var(--text2); max-width: 64px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story-add    { background: var(--primary-light); border: 2px dashed var(--primary); }

/* ── Profile ─────────────────────────────────────────────────────────────── */
.profile-page { padding-bottom: var(--bottomnav-h, 56px); }
.profile-cover { width: 100%; height: 185px; object-fit: cover; display: block; background: var(--gradient); }
.profile-cover-empty { height: 185px; background: var(--gradient); }

/* Avatar centered, overlapping cover */
.profile-avatar-center-wrap { display: flex; justify-content: center; margin-top: -58px; position: relative; z-index: 2; }
.profile-avatar-frame { position: relative; display: inline-block; }
.profile-avatar-lg { width: 108px; height: 108px; border-radius: 50%; object-fit: cover; border: 4px solid var(--surface); box-shadow: 0 2px 12px rgba(0,0,0,.22); display: block; }

/* Identity block centered */
.profile-identity { text-align: center; padding: .6rem 1rem .4rem; }
.profile-name { font-size: 1.25rem; font-weight: 800; color: var(--text1); }
.profile-username { font-size: .82rem; color: var(--text3); margin-top: 2px; }
.profile-bio { font-size: .88rem; color: var(--text2); margin-top: .45rem; line-height: 1.45; }
.profile-mutual { font-size: .78rem; color: var(--text3); margin-top: .35rem; }

/* Android-style action bar */
.profile-action-bar-v2 { display: flex; justify-content: center; gap: .25rem; padding: .6rem 1rem .4rem; }
.profile-action-btn { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .45rem .75rem; border: 1.5px solid var(--divider); border-radius: 8px; background: var(--surface2); color: var(--text1); font-size: .72rem; cursor: pointer; min-width: 64px; line-height: 1.2; }
.profile-action-btn .ms-icon { font-size: 1.2rem; }
.profile-action-btn--primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.profile-action-btn--active  { background: var(--primary-light, #e3f2fd); border-color: var(--primary); color: var(--primary); }
.profile-action-btn--muted   { opacity: .6; }

/* Stats bar */
.profile-stats-bar { display: flex; align-items: center; justify-content: center; padding: .55rem 1rem; border-top: 1px solid var(--divider); border-bottom: 1px solid var(--divider); margin-top: .25rem; }
.profile-stat-item { flex: 1; display: flex; flex-direction: column; align-items: center; }
.profile-stat-value { font-size: 1.05rem; font-weight: 800; color: var(--text1); }
.profile-stat-label { font-size: .66rem; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; margin-top: 1px; }
.profile-stat-sep { width: 1px; height: 28px; background: var(--divider); flex-shrink: 0; }

/* Info fields card */
.profile-info-card { padding: .6rem 1rem; border-bottom: 1px solid var(--divider); }
.profile-info-row { display: flex; align-items: center; gap: .65rem; padding: .32rem 0; }
.profile-info-icon { font-size: 1rem; color: var(--text3); flex-shrink: 0; }
.profile-info-text { font-size: .88rem; color: var(--text2); }

/* Profile tabs */
.profile-tabs { display: flex; border-bottom: 1px solid var(--divider); background: var(--surface); position: sticky; top: 0; z-index: 10; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.profile-tabs::-webkit-scrollbar { display: none; }
.profile-tabs .tab-btn { flex-shrink: 0; padding: .75rem .85rem; background: none; border: none; font-size: .85rem; cursor: pointer; white-space: nowrap; }

/* Follow list context menu */
.follow-card-menu-btn { position: absolute; top: 4px; right: 4px; background: none; border: none; cursor: pointer; padding: 2px 4px; border-radius: 50%; color: var(--text3); z-index: 2; display: flex; align-items: center; }
.follow-card-menu-btn:hover { background: var(--hover); }
.follow-ctx-menu { position: absolute; background: var(--surface); border: 1px solid var(--divider); border-radius: .5rem; box-shadow: 0 4px 16px rgba(0,0,0,.14); z-index: 1000; min-width: 170px; overflow: hidden; }
.follow-ctx-menu button { display: flex; align-items: center; gap: .5rem; width: 100%; padding: .65rem 1rem; background: none; border: none; cursor: pointer; font-size: .9rem; color: var(--error, #d32f2f); text-align: left; }
.follow-ctx-menu button:hover { background: var(--hover); }

/* About tab */
.about-tab { padding: .5rem 0; }
.about-row { display: flex; align-items: flex-start; gap: .75rem; padding: .55rem .75rem; border-bottom: 1px solid var(--divider); }
.about-row:last-child { border-bottom: none; }
.about-label { font-size: .78rem; font-weight: 600; color: var(--text3); min-width: 110px; padding-top: .05rem; }
.about-value { font-size: .9rem; color: var(--text1); flex: 1; word-break: break-word; }
.about-value a { color: var(--primary); text-decoration: none; }

/* ── Chat lista ──────────────────────────────────────────────────────────── */
.chat-list-header {
  display: flex; align-items: center; gap: .5rem;
  padding: .65rem .75rem .5rem;
  border-bottom: 1px solid var(--divider);
}
.chat-search-input {
  flex: 1; border-radius: 20px;
  padding: .45rem 1rem; font-size: .92rem;
}
.btn-new-group {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--gradient); color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; border: none; cursor: pointer;
  box-shadow: 0 2px 8px rgba(77,162,197,.3);
  transition: transform var(--transition);
}
.btn-new-group:active { transform: scale(.92); }
.btn-new-group .ms-icon { font-size: 1.1rem; }
.chat-list  { }
.chat-item  {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--divider);
  background: var(--surface);
  transition: background var(--transition); cursor: pointer;
}
.chat-item:hover   { background: var(--surface2); }
.chat-info         { flex: 1; min-width: 0; }
.chat-name         { font-weight: 700; font-size: .95rem; color: var(--text); }
.chat-preview      { font-size: .82rem; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.chat-meta         { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
.chat-time         { font-size: .7rem; color: var(--text3); }
.chat-unread       { background: var(--primary); color: #fff; font-size: .68rem; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* ── Chat conversa ───────────────────────────────────────────────────────── */
.chat-messages {
  padding: .75rem; display: flex; flex-direction: column;
  gap: .35rem; padding-bottom: 120px; /* room for input + reply/typing bars */
}
/* Wrapper de alinhamento */
.msg-wrap    { display: flex; justify-content: flex-start; }
.msg-wrap-me { justify-content: flex-end; }
.msg-bubble {
  max-width: 76%; padding: .55rem .9rem;
  border-radius: 18px; font-size: .92rem;
  line-height: 1.45; word-break: break-word;
}
.msg-out {
  background: var(--gradient); color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 6px rgba(77,162,197,.3);
}
.msg-in {
  background: var(--surface); color: var(--text);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow); border: 1px solid var(--divider);
}
/* Footer: hora + ações */
.msg-footer { display: flex; align-items: center; justify-content: flex-end; gap: .3rem; margin-top: .2rem; }
.msg-time   { font-size: .63rem; opacity: .7; white-space: nowrap; }
.msg-edited { font-size: .6rem; opacity: .65; font-style: italic; }
.msg-img    { max-width: 200px; border-radius: 10px; margin-top: .35rem; display: block; }
.msg-video  { max-width: 240px; border-radius: 10px; margin-top: .35rem; display: block; outline: none; }
.msg-status { display: inline-flex; align-items: center; line-height: 1; }
.msg-status .ms-icon { font-size: 14px; }
.msg-status-sending  .ms-icon { color: rgba(255,255,255,.45); }
.msg-status-sent     .ms-icon { color: rgba(255,255,255,.65); }
.msg-status-delivered .ms-icon { color: rgba(255,255,255,.65); }
.msg-status-read     .ms-icon { color: #64b5f6; }
/* Ações editar/excluir/responder */
.msg-acts { display: flex; gap: .05rem; opacity: 0; transition: opacity .15s; }
.msg-wrap:hover .msg-acts,
.msg-wrap-me:hover .msg-acts,
.msg-wrap:focus-within .msg-acts,
.msg-wrap-me:focus-within .msg-acts { opacity: 1; }
.msg-act-btn {
  background: none; border: none; cursor: pointer;
  padding: .1rem .15rem; border-radius: 4px;
  color: rgba(255,255,255,.65); line-height: 1; font-size: .85rem;
}
.msg-act-btn .ms-icon { font-size: .85rem; }
.msg-act-btn:hover { background: rgba(255,255,255,.18); color: #fff; }
/* Mensagem não-própria: botões em tom escuro */
.msg-in .msg-act-btn { color: var(--text3); }
.msg-in .msg-act-btn:hover { background: var(--surface3); color: var(--text); }
/* Reply quote dentro do bubble */
.msg-reply-quote {
  border-left: 3px solid rgba(255,255,255,.5);
  padding: .2rem .5rem; margin-bottom: .35rem;
  font-size: .78rem; opacity: .8;
  background: rgba(0,0,0,.12); border-radius: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.msg-in .msg-reply-quote { border-left-color: var(--primary); background: var(--surface3); opacity: .9; }
/* Sender name (grupos) */
.msg-sender { font-size: .73rem; font-weight: 600; color: var(--primary); margin-bottom: .2rem; }
/* Typing indicator — sits directly above .chat-reply-bar or .chat-input-bar */
.chat-typing-bar {
  position: fixed; bottom: calc(var(--bottomnav-h) + 56px); left: 0; right: 0;
  max-width: 600px; margin: 0 auto;
  display: flex; align-items: center; gap: .5rem;
  padding: .3rem .75rem;
  background: var(--surface); border-top: 1px solid var(--border);
  z-index: 98; font-size: .82rem; color: var(--text3);
}
.chat-typing-bar.hidden { display: none; }
.typing-dots { display: inline-flex; gap: 3px; align-items: center; }
.typing-dots span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--text3);
  animation: typingBounce 1.2s infinite; display: block;
}
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .5; }
  40%            { transform: translateY(-5px); opacity: 1; }
}
/* Reply bar — sits directly above .chat-input-bar */
.chat-reply-bar {
  position: fixed; bottom: calc(var(--bottomnav-h) + 56px); left: 0; right: 0;
  max-width: 600px; margin: 0 auto;
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem .75rem;
  background: var(--surface2); border-top: 2px solid var(--primary);
  z-index: 99;
}
.chat-reply-bar.hidden { display: none; }
.reply-preview-inner { flex: 1; display: flex; align-items: center; gap: .4rem; min-width: 0; }
.reply-preview-text { font-size: .82rem; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply-cancel-btn { background: none; border: none; cursor: pointer; color: var(--text3); padding: .2rem; line-height: 1; }
/* Presence status in topbar */
.chat-status-text { font-size: .72rem; color: var(--text3); font-weight: 400; }
.chat-status-text.online { color: #4caf50; }
/* Reactions below bubble */
.msg-reactions {
  display: flex; flex-wrap: wrap; gap: .3rem;
  margin-top: .2rem; padding: 0 .25rem;
}
.reaction-btn {
  display: inline-flex; align-items: center; gap: .25rem;
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: 20px; padding: .15rem .45rem;
  font-size: .85rem; cursor: pointer; transition: background .15s;
  line-height: 1.4;
}
.reaction-btn.reacted { background: rgba(77,162,197,.18); border-color: var(--primary); }
.reaction-btn:hover { background: var(--surface3); }
.reaction-count { font-size: .7rem; color: var(--text2); }
.reaction-add-btn {
  background: none; border: 1.5px dashed var(--border);
  border-radius: 20px; padding: .15rem .35rem;
  cursor: pointer; color: var(--text3); display: inline-flex; align-items: center;
  transition: border-color .15s;
}
.reaction-add-btn:hover { border-color: var(--primary); color: var(--primary); }
/* Quick reaction picker */
.reaction-picker {
  display: flex; gap: .3rem; flex-wrap: wrap;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 24px; padding: .35rem .5rem;
  box-shadow: var(--shadow-md); z-index: 200;
  position: relative; margin: .25rem 0;
}
.reaction-picker button {
  background: none; border: none; font-size: 1.4rem;
  cursor: pointer; border-radius: 50%; padding: .2rem;
  transition: transform .12s;
}
.reaction-picker button:hover { transform: scale(1.4); }
/* Link preview inside chat bubble */
.link-preview {
  display: block; text-decoration: none;
  border: 1px solid rgba(255,255,255,.15); border-radius: 8px;
  overflow: hidden; margin-top: .5rem; background: rgba(0,0,0,.18);
  transition: opacity .15s;
}
.link-preview:hover { opacity: .88; }
.msg-in .link-preview { border-color: var(--border); background: var(--surface3); }
.link-preview-img { width: 100%; max-height: 140px; object-fit: cover; display: block; }
.link-preview-body { padding: .4rem .55rem; }
.link-preview-site { font-size: .65rem; text-transform: uppercase; letter-spacing: .05em; opacity: .7; }
.link-preview-title { font-size: .82rem; font-weight: 600; margin: .1rem 0; color: inherit; }
.link-preview-desc { font-size: .75rem; opacity: .75; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Group avatar in list */
.group-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
/* Chat section labels */
.chat-section-label {
  padding: .45rem .85rem .2rem;
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text3);
}
/* Inline edit */
.msg-edit-ta {
  width: 100%; border: none; outline: none; resize: none;
  background: rgba(255,255,255,.15); color: #fff;
  border-radius: 8px; padding: .35rem .5rem;
  font-size: .92rem; line-height: 1.45; min-height: 3rem;
}
.msg-edit-btns {
  display: flex; gap: .4rem; justify-content: flex-end; margin-top: .4rem;
}
/* Emoji picker */
.emoji-picker {
  position: fixed; bottom: calc(var(--bottomnav-h) + 56px); left: 0; right: 0;
  max-width: 600px; margin: 0 auto;
  background: var(--surface2); border-top: 1.5px solid var(--border);
  display: grid; grid-template-columns: repeat(8, 1fr);
  padding: .5rem; gap: .15rem;
  max-height: 220px; overflow-y: auto;
  z-index: 200;
  animation: slideUp .18s ease;
}
@keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: none; opacity: 1; } }
.emoji-btn {
  background: none; border: none; cursor: pointer;
  font-size: 1.45rem; padding: .3rem; border-radius: 8px;
  line-height: 1; transition: background .1s;
  display: flex; align-items: center; justify-content: center;
}
.emoji-btn:hover { background: var(--surface3); }
/* Sticker chat picker */
.sticker-chat-picker {
  position: fixed; bottom: calc(var(--bottomnav-h) + 56px); left: 0; right: 0;
  max-width: 600px; margin: 0 auto;
  background: var(--surface2); border-top: 1.5px solid var(--border);
  z-index: 200; animation: slideUp .18s ease;
  display: flex; flex-direction: column; max-height: 320px;
}
.sticker-chat-header {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .75rem; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.sticker-back-btn, .sticker-close-btn {
  background: none; border: none; cursor: pointer; padding: .2rem;
  color: var(--text2); display: flex; align-items: center;
}
.sticker-back-btn.hidden { display: none; }
.sticker-picker-title { flex: 1; font-size: .9rem; font-weight: 600; color: var(--text); }
.sticker-picker-body { flex: 1; overflow-y: auto; }
.sticker-pack-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem .75rem; cursor: pointer; transition: background .15s;
}
.sticker-pack-row:hover { background: var(--surface3); }
.sticker-pack-row-img { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; flex-shrink: 0; }
.sticker-pack-row-icon { font-size: 2rem; width: 40px; text-align: center; color: var(--text3); flex-shrink: 0; }
.sticker-pack-row-name { flex: 1; font-size: .9rem; color: var(--text); }
.sticker-chat-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: .35rem; padding: .5rem;
}
.sticker-chat-item {
  background: none; border: 1px solid transparent; border-radius: 8px;
  padding: .25rem; cursor: pointer; aspect-ratio: 1; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, border-color .12s;
}
.sticker-chat-item:hover { background: var(--surface3); border-color: var(--border); }
.sticker-chat-item img { width: 100%; height: 100%; object-fit: contain; }
.msg-sticker { max-width: 140px !important; border-radius: 8px !important; background: none; }
.msg-sticker-bubble { background: transparent !important; box-shadow: none !important; }
/* Input bar */
.chat-input-bar {
  position: fixed; bottom: var(--bottomnav-h); left: 0; right: 0;
  background: var(--surface); border-top: 1.5px solid var(--border);
  padding: .5rem; display: flex; align-items: flex-end; gap: .5rem;
  z-index: 100;
}
.chat-input-bar textarea {
  flex: 1; resize: none; border-radius: 22px;
  padding: .55rem 1rem; max-height: 120px;
  line-height: 1.4; font-size: .95rem;
}
.btn-send {
  width: 42px; height: 42px;
  background: var(--gradient); color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(77,162,197,.35);
  transition: transform var(--transition);
}
.btn-send:active { transform: scale(.92); }

/* ── Toast ───────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: calc(var(--bottomnav-h) + 1rem);
  left: 50%; transform: translateX(-50%);
  z-index: 9998; display: flex; flex-direction: column; gap: .5rem;
  pointer-events: none; width: max-content; max-width: 92vw;
}
.toast {
  background: #1a2a3a; color: #e8edf2;
  padding: .75rem 1.25rem; border-radius: var(--radius-sm);
  font-size: .875rem;
  animation: toastIn .3s ease, toastOut .3s ease 2.7s forwards;
  pointer-events: auto;
  border-left: 3px solid var(--primary);
  box-shadow: var(--shadow-md);
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--error); }
@keyframes toastIn  { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
@keyframes toastOut { to   { opacity:0; transform:translateY(20px); } }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  z-index: 200; animation: fadeIn .2s ease;
}
.modal-container {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface); border-radius: var(--radius) var(--radius) 0 0;
  z-index: 220; animation: slideUp .3s ease;
  max-height: 90vh; overflow-y: auto;
  border-top: 1px solid var(--border);
}
@keyframes fadeIn  { from { opacity: 0; } }
@keyframes slideUp { from { transform: translateY(100%); } }

/* ── Loader ──────────────────────────────────────────────────────────────── */
.loader {
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 1rem;
}
#feed-load-more {
  display: flex; justify-content: center; align-items: center;
  padding: 1.25rem 0 2rem;
}
#feed-load-more[hidden] { display: none; }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.skeleton {
  background: linear-gradient(90deg, var(--surface3) 25%, var(--border) 50%, var(--surface3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Avatar sm ───────────────────────────────────────────────────────────── */
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1.5px solid var(--surface); }

/* ── Icon button ─────────────────────────────────────────────────────────── */
.icon-btn {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); transition: background var(--transition);
}
.icon-btn:hover { background: var(--hover, var(--surface3)); }

/* ── Bottom Sheet ────────────────────────────────────────────────────────── */
.bottom-sheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  z-index: 210;
  max-height: 90vh;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 -4px 32px rgba(0,0,0,.18);
  border-top: 1px solid var(--border);
}
.bottom-sheet.open { transform: translateY(0); }
.bottom-sheet.full-sheet { max-height: 96vh; }
.sheet-header {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--divider);
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; font-size: .97rem; flex-shrink: 0;
}
.sheet-content { overflow-y: auto; flex: 1; }
.sheet-menu-item {
  display: flex; align-items: center; gap: .75rem;
  width: 100%; padding: .85rem 1.25rem;
  background: none; border: none; cursor: pointer;
  font-size: .95rem; color: var(--text1); text-align: left;
  text-decoration: none;
}
.sheet-menu-item:active { background: var(--hover); }

/* ── Comments ─────────────────────────────────────────────────────────────── */
.comment-item {
  display: flex; align-items: flex-start; gap: .65rem;
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--divider);
}
.comment-bubble {
  flex: 1; background: var(--surface3, var(--hover));
  border-radius: 0 12px 12px 12px; padding: .55rem .8rem;
}
.comment-author { font-weight: 700; font-size: .83rem; color: var(--text); }
.comment-text   { font-size: .9rem; color: var(--text); margin-top: .15rem; line-height: 1.45; word-break: break-word; }
.comment-meta   { font-size: .73rem; color: var(--text3); margin-top: .3rem; display: flex; gap: .75rem; align-items: center; }
.comment-like-btn { color: var(--text3); font-weight: 600; }
.comment-like-btn.liked { color: var(--primary); }
.comment-del-btn {
  background: none; border: none; cursor: pointer; padding: 0;
  color: var(--text3); font-size: .8rem; margin-left: auto;
  display: flex; align-items: center; gap: .2rem;
  opacity: .6;
}
.comment-del-btn:hover { color: var(--error); opacity: 1; }
.comment-input-wrap {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem 1rem; border-top: 1px solid var(--divider);
  background: var(--surface); flex-shrink: 0;
}
.comment-input-field {
  flex: 1; background: var(--surface3, #f0f2f5);
  border-radius: 20px; padding: .55rem 1rem;
  font-size: .9rem; color: var(--text);
  border: none; outline: none;
}
[data-theme="dark"] .comment-input-field { background: #1e2732; }
.comment-send-btn {
  color: var(--primary); font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  transition: background var(--transition);
}
.comment-send-btn:hover  { background: var(--primary-light); }
.comment-send-btn:active { background: var(--primary-light); }
.cmt-extra-btn {
  background: none; border: none; cursor: pointer; color: var(--text3);
  padding: 4px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; border-radius: 50%;
}
.cmt-extra-btn .ms-icon { font-size: 1.35rem; line-height: 1; }
.cmt-extra-btn:hover { color: var(--primary); background: var(--hover, rgba(0,0,0,.06)); }
.cmt-emoji-panel {
  flex-wrap: wrap; gap: 2px; padding: .5rem .75rem;
  background: var(--surface2, #f7f8fa); border-top: 1px solid var(--divider);
  max-height: 150px; overflow-y: auto; flex-shrink: 0;
}
[data-theme="dark"] .cmt-emoji-panel { background: #1a2332; }
.cmt-emoji-btn {
  font-size: 1.45rem; background: none; border: none; cursor: pointer;
  padding: 3px 4px; border-radius: 6px; line-height: 1;
}
.cmt-emoji-btn:hover { background: var(--hover, rgba(0,0,0,.06)); }

/* ── Create post ─────────────────────────────────────────────────────────── */
.post-input-area {
  width: 100%; min-height: 120px;
  border: none; outline: none;
  background: transparent; color: var(--text);
  font-size: 1rem; line-height: 1.55; resize: none;
}
.privacy-select {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .76rem; background: var(--surface3, #eef1f5);
  color: var(--text2); border: none; border-radius: 12px;
  padding: .2rem .55rem; cursor: pointer; margin-top: .25rem;
  font-family: inherit;
}
[data-theme="dark"] .privacy-select { background: #1e2732; }

/* ── Privacy picker sheet ─────────────────────────────────────────────────── */
.privacy-option-item {
  display: flex; align-items: center; gap: .85rem;
  padding: .9rem 1.25rem; cursor: pointer;
  transition: background .15s;
}
.privacy-option-item:hover, .privacy-option-item.selected { background: var(--surface2); }
.privacy-option-icon { font-size: 1.4rem; flex-shrink: 0; }
.privacy-option-label { flex: 1; font-size: .95rem; font-weight: 500; color: var(--text); }
.privacy-option-radio { color: var(--primary); font-size: 1.3rem; flex-shrink: 0; }
.post-photo-preview { position: relative; margin: .5rem 0; }
.post-photo-preview img { width: 100%; border-radius: 10px; max-height: 240px; object-fit: cover; }
.post-photo-remove {
  position: absolute; top: .5rem; right: .5rem;
  background: rgba(0,0,0,.55); color: #fff;
  border-radius: 50%; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
}
.attach-bar { display: flex; gap: .25rem; padding: .4rem 0; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.attach-bar::-webkit-scrollbar { display: none; }
.attach-btn {
  display: flex; align-items: center; gap: .4rem; flex-shrink: 0;
  font-size: .85rem; color: var(--text2);
  padding: .4rem .8rem; border-radius: 20px;
  transition: background var(--transition);
}
.attach-btn:hover { background: var(--surface3, #f0f2f5); }

/* ── Menu sheet ──────────────────────────────────────────────────────────── */
.menu-item {
  display: flex; align-items: center; gap: .85rem;
  padding: .95rem 1.25rem;
  font-size: .95rem; color: var(--text);
  border-bottom: 1px solid var(--divider); cursor: pointer;
  transition: background var(--transition);
}
.menu-item:hover { background: var(--surface3, #f5f5f5); }
.menu-item:last-child { border-bottom: none; }
.menu-item.danger { color: var(--error); }
.menu-item > i { font-size: 1.25rem; color: var(--text3); flex-shrink: 0; }
.menu-item.danger > i { color: var(--error); }

/* ── Drawer ───────────────────────────────────────────────────────────────── */
.xi-menu::before   { content: "menu"; }
.xi-logout::before { content: "logout"; }
.xi-mic::before    { content: "mic"; }
.xi-music::before  { content: "music_note"; }
.xi-video::before  { content: "videocam"; }
.xi-poll::before   { content: "poll"; }
.xi-forum::before  { content: "forum"; }
.xi-sell::before   { content: "sell"; }
.xi-fund::before   { content: "volunteer_activism"; }
.xi-heart::before  { content: "favorite"; }
.xi-play::before     { content: "play_arrow"; }
.xi-pause::before    { content: "pause"; }
.xi-prev::before     { content: "skip_previous"; }
.xi-next::before     { content: "skip_next"; }
.xi-shuffle::before  { content: "shuffle"; }
.xi-repeat::before   { content: "repeat"; }
.xi-repeat1::before  { content: "repeat_one"; }
.xi-down::before     { content: "keyboard_arrow_down"; }
.xi-up::before       { content: "keyboard_arrow_up"; }
.xi-right::before    { content: "chevron_right"; }
.xi-left::before     { content: "chevron_left"; }
.xi-back::before     { content: "arrow_back"; }
.xi-reply::before    { content: "reply"; }
.xi-trash::before    { content: "delete"; }
.xi-download::before { content: "download"; }
.xi-album::before    { content: "album"; }
.xi-queue::before    { content: "queue_music"; }

.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 300; animation: fadeIn .2s ease;
}
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 285px; max-width: 85vw;
  background: var(--surface);
  z-index: 301;
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  box-shadow: 4px 0 24px rgba(0,0,0,.18);
  overflow: hidden;
}
.drawer.open { transform: translateX(0); }
.drawer-header {
  position: relative;
  min-height: 130px;
  padding: 1rem;
  display: flex; flex-direction: column; justify-content: flex-end; gap: .4rem;
  flex-shrink: 0; overflow: hidden; cursor: pointer;
}
.drawer-cover {
  position: absolute; inset: 0;
  background: var(--gradient);
  background-size: cover; background-position: center;
}
.drawer-header-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.05) 0%, rgba(0,0,0,.6) 100%);
  pointer-events: none;
}
.drawer-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.85);
  object-fit: cover; flex-shrink: 0;
  position: relative; z-index: 1;
}
.drawer-user-info { position: relative; z-index: 1; }
.drawer-name  { font-size: 1rem; font-weight: 700; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.drawer-email { font-size: .78rem; color: rgba(255,255,255,.8); margin-top: 1px; }
.drawer-nav {
  flex: 1; overflow-y: auto; padding: .35rem 0;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.drawer-section-title {
  font-size: .7rem; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: .07em;
  padding: .65rem 1rem .2rem; margin-top: .25rem;
}
.drawer-item {
  display: flex; align-items: center; gap: .85rem;
  padding: .78rem 1rem;
  color: var(--text); font-size: .93rem;
  cursor: pointer; border-radius: 0;
  transition: background var(--transition);
  text-decoration: none;
}
.drawer-item:hover, .drawer-item:active { background: var(--surface3); }
.drawer-item.active { color: var(--primary); background: var(--primary-light); }
.drawer-item.active > i { color: var(--primary); }
.drawer-item > i { font-size: 1.3rem; color: var(--text3); flex-shrink: 0; }
.drawer-xi { font-size: 1.3rem; color: var(--text3); flex-shrink: 0; }
.drawer-item.danger { color: var(--error); }
.drawer-item.danger > i { color: var(--error); }
.drawer-divider { height: 1px; background: var(--divider); margin: .35rem 0; }
.drawer-item.has-submenu .drawer-chevron { margin-left: auto; font-size: 1rem; transition: transform .25s; }
.drawer-item.has-submenu.open .drawer-chevron { transform: rotate(180deg); }
.drawer-submenu { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.drawer-submenu.open { max-height: 200px; }
.drawer-subitem {
  display: flex; align-items: center; gap: .75rem;
  padding: .55rem 1rem .55rem 3rem;
  color: var(--text2); font-size: .87rem;
  cursor: pointer; transition: background var(--transition);
}
.drawer-subitem:hover { background: var(--surface3); }
.drawer-subitem .ms-icon { font-size: 1.1rem; color: var(--text3); flex-shrink: 0; }
.drawer-footer { padding: .35rem 0; border-top: 1px solid var(--divider); flex-shrink: 0; }

/* ── Seletor de fonte no drawer ──────────────────────────────────────────── */
.drawer-font-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem 1.1rem;
}
.drawer-font-icon {
  font-size: 1.1rem; color: var(--text3); flex-shrink: 0;
}
.drawer-font-btns {
  display: flex; gap: .35rem; flex: 1;
}
.font-chip {
  padding: .25rem .65rem;
  border-radius: 20px;
  border: 1.5px solid var(--divider);
  background: transparent;
  color: var(--text2);
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
  font-family: inherit;
}
.font-chip:hover,
html[data-font="plus-jakarta-sans"] .font-chip[data-font="plus-jakarta-sans"],
html[data-font="inter"]             .font-chip[data-font="inter"],
html[data-font="nunito"]            .font-chip[data-font="nunito"] {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* ── Seletor de idioma no drawer ─────────────────────────────────────────── */
.drawer-lang-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem 1.1rem;
  cursor: pointer;
}
.drawer-lang-label {
  font-size: .85rem; color: var(--text2); flex: 1;
}
.drawer-lang-expand {
  color: var(--text3); display: flex; align-items: center;
  transition: transform .2s;
}
.drawer-lang-row.open .drawer-lang-expand { transform: rotate(180deg); }
.drawer-lang-chips {
  display: none; flex-wrap: wrap; gap: .35rem;
  padding: .15rem 1.1rem .6rem;
}
.drawer-lang-row.open + .drawer-lang-chips { display: flex; }
.lang-chip {
  padding: .25rem .6rem;
  border-radius: 20px;
  border: 1.5px solid var(--divider);
  background: transparent;
  color: var(--text2);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
  font-family: inherit;
}
.lang-chip:hover,
.lang-chip.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* ── Tab bar ──────────────────────────────────────────────────────────────── */
.tab-bar {
  display: flex; overflow-x: auto; gap: .25rem;
  padding: .5rem .75rem; background: var(--surface);
  border-bottom: 1px solid var(--divider);
  scrollbar-width: none; flex-shrink: 0;
  position: sticky; top: var(--topbar-h); z-index: 50;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  flex-shrink: 0; padding: .38rem .9rem;
  border-radius: 20px; font-size: .82rem; font-weight: 600;
  color: var(--text2); background: var(--surface3);
  border: 1.5px solid transparent;
  transition: all var(--transition); white-space: nowrap;
}
.tab-btn.active {
  color: var(--primary); background: var(--primary-light);
  border-color: var(--primary);
}

/* ── Module grid / list / cards ──────────────────────────────────────────── */
.module-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: .65rem; padding: .75rem;
}
.module-list { display: flex; flex-direction: column; }

.module-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--divider); overflow: hidden;
  cursor: pointer; transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow);
}
.module-card:active { transform: scale(.97); }
.module-card-thumb {
  width: 100%; aspect-ratio: 4/3; overflow: hidden;
  background: var(--surface3); position: relative;
}
.module-card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
}
.module-card:hover .module-card-thumb img { transform: scale(1.04); }
.module-card-no-img {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text3); font-size: 2.5rem;
}
.module-card-body   { padding: .6rem .7rem .7rem; }
.module-card-title  { font-size: .88rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.module-card-meta   { font-size: .72rem; color: var(--text3); margin-top: .2rem; }
.module-card-desc   { font-size: .8rem; color: var(--text2); margin-top: .25rem; line-height: 1.35;
                      display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.module-card-count  { font-size: .75rem; color: var(--text3); margin-top: .25rem; }

/* Row card (music, forum, etc.) */
.row-card {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem; border-bottom: 1px solid var(--divider);
  background: var(--surface); cursor: pointer;
  transition: background var(--transition);
}
.row-card:hover { background: var(--surface2); }
.row-card-img {
  width: 50px; height: 50px; border-radius: 8px;
  object-fit: cover; flex-shrink: 0; background: var(--surface3);
  overflow: hidden;
}
.row-card-img img { width: 100%; height: 100%; object-fit: cover; }
.row-card-body  { flex: 1; min-width: 0; }
.row-card-title { font-size: .92rem; font-weight: 600; color: var(--text);
                  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-card-sub   { font-size: .78rem; color: var(--text3); margin-top: 1px; }

/* Blog card */
.blog-card { display: flex; flex-direction: column; margin-bottom: .65rem; }
.blog-card-cover {
  width: 100%; max-height: 180px; object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
}
.blog-card-menu-btn {
  position: absolute; top: .4rem; right: .4rem;
  background: rgba(0,0,0,.45); border-radius: 50%;
  width: 32px; height: 32px; padding: 0;
  display: flex; align-items: center; justify-content: center;
}

/* Event detail page */
.event-meta-row {
  display: flex; align-items: flex-start; gap: .5rem;
  font-size: .875rem; color: var(--text2); margin-bottom: .35rem;
}
.event-meta-row i { margin-top: .1rem; flex-shrink: 0; }
.event-detail .member-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem; border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.event-detail .member-row:hover { background: var(--surface); }
.event-detail .member-row .avatar {
  width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.event-detail .member-row .member-name { font-size: .9rem; color: var(--text); }
.event-detail .tab-bar { display: flex; }
.event-detail .tab-btn {
  padding: .65rem 1rem; font-size: .85rem; font-weight: 500;
  border: none; background: none; color: var(--text3); cursor: pointer;
  border-bottom: 2px solid transparent; flex-shrink: 0;
}
.event-detail .tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Event card */
.event-date-badge {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: .72rem; font-weight: 600; padding: .25rem .5rem;
  text-align: center;
}

/* Video card */
.video-thumb { position: relative; }
.video-play-btn {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.28);
  opacity: 0; transition: opacity var(--transition);
}
.module-card:hover .video-play-btn { opacity: 1; }
.video-duration {
  position: absolute; bottom: .3rem; right: .4rem;
  background: rgba(0,0,0,.7); color: #fff;
  font-size: .68rem; border-radius: 4px; padding: .1rem .35rem;
}

/* Music card */
.music-card { position: relative; }
.music-thumb {
  width: 50px; height: 50px; border-radius: 8px;
  overflow: hidden; flex-shrink: 0; position: relative;
}
.music-thumb img   { width: 100%; height: 100%; object-fit: cover; }
.music-thumb-default {
  width: 100%; height: 100%;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: 1.4rem;
}
.music-play-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  color: #fff; opacity: 0; transition: opacity var(--transition);
}
.music-card:hover .music-play-overlay { opacity: 1; }

/* Store card */
.store-price { font-size: .95rem; font-weight: 800; color: var(--primary); margin-top: .2rem; }
.classified-price-badge {
  position: absolute; top: .4rem; right: .4rem;
  background: var(--primary); color: #fff;
  font-size: .72rem; font-weight: 700; border-radius: 6px; padding: .15rem .45rem;
}

/* Poll card */
.poll-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--divider); margin: .65rem .75rem 0;
  box-shadow: var(--shadow); overflow: hidden;
}
.poll-card-title {
  padding: .75rem .75rem .5rem; font-weight: 600; font-size: .95rem; color: var(--text);
}
.poll-card-meta {
  padding: .5rem .75rem .75rem; font-size: .78rem; color: var(--text3);
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
}
.poll-closed-badge {
  background: var(--surface3); color: var(--text3); border-radius: 4px;
  padding: 1px 6px; font-size: .72rem; margin-left: .25rem;
}
.poll-load-wrap { padding: .5rem .75rem; }
.poll-options-list { padding: .25rem 0; }
.poll-option {
  position: relative; overflow: hidden;
  padding: .55rem .75rem; cursor: pointer;
  border-bottom: 1px solid var(--divider);
  transition: background var(--transition);
}
.poll-option:last-child { border-bottom: none; }
.poll-option:hover { background: var(--surface2); }
.poll-option-bar {
  position: absolute; inset: 0; height: 100%;
  background: var(--primary); opacity: .12;
  border-radius: 0; transition: width .4s ease;
  pointer-events: none;
}
.poll-option-content {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
}
.poll-option-label { font-size: .88rem; color: var(--text); }
.poll-option-pct   { font-size: .78rem; font-weight: 700; color: var(--primary); white-space: nowrap; }
.poll-voted .poll-option-bar { opacity: .25; }
.poll-voted .poll-option-label { font-weight: 600; color: var(--primary); }

/* Crowdfunding */
.fund-progress { margin: .4rem 0 .25rem; }
.fund-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-bottom: .25rem; }
.fund-bar-fill { height: 100%; background: var(--primary); border-radius: 3px; }
.fund-meta { display: flex; justify-content: space-between; font-size: .72rem; }
.fund-raised { color: var(--primary); font-weight: 700; }
.fund-goal   { color: var(--text3); }

/* Friends page */
.friend-list { display: flex; flex-direction: column; }
.friend-card {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1rem; border-bottom: 1px solid var(--divider);
  background: var(--surface); transition: background var(--transition);
}
.friend-card.removing { opacity: 0; max-height: 0; overflow: hidden; transition: opacity .3s, max-height .35s; }
.friend-info   { flex: 1; min-width: 0; cursor: pointer; }
.friend-name   { font-size: .93rem; font-weight: 700; color: var(--text); }
.friend-mutual { font-size: .78rem; color: var(--text3); margin-top: 1px; }
.friend-actions { display: flex; gap: .4rem; flex-shrink: 0; }

/* Search page */
.search-bar-wrap {
  padding: .65rem .75rem; background: var(--surface);
  border-bottom: 1px solid var(--divider);
  position: sticky; top: var(--topbar-h); z-index: 50;
}
.search-bar {
  display: flex; align-items: center; gap: .6rem;
  background: var(--surface3); border-radius: 24px;
  padding: .5rem 1rem;
}
.search-input {
  flex: 1; background: transparent; border: none; outline: none;
  font-size: .95rem; color: var(--text);
}
.search-cats { top: calc(var(--topbar-h) + 56px); }

/* Points hero */
.points-hero {
  background: var(--gradient);
  padding: 2.5rem 1rem 2rem;
  display: flex; flex-direction: column;
  align-items: center; gap: .5rem;
  text-align: center;
}
.points-icon  { margin-bottom: .25rem; }
.points-label { font-size: .9rem; color: rgba(255,255,255,.75); font-weight: 600; }

/* Empty state */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 3rem 2rem; gap: .75rem; color: var(--text3);
}
.empty-state > i   { font-size: 3.5rem; }
.empty-state > p   { font-size: .95rem; text-align: center; line-height: 1.5; }

/* Feed welcome (empty feed first visit) */
.feed-welcome {
  display: flex; flex-direction: column; align-items: center;
  padding: 2rem 1.5rem 3rem; gap: 1rem; text-align: center;
  animation: fadeInUp .5s ease both;
}
.feed-welcome-logo img {
  width: 72px; height: 72px; border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
}
.feed-welcome-title {
  font-size: 1.45rem; font-weight: 800; color: var(--text); margin: 0;
}
.feed-welcome-sub {
  font-size: .95rem; color: var(--text2); line-height: 1.6;
  max-width: 300px; margin: 0;
}
.feed-welcome-actions {
  display: flex; flex-direction: column; gap: .6rem; width: 100%; max-width: 280px;
  margin-top: .5rem;
}
.feed-welcome-tips {
  display: flex; flex-direction: column; gap: .6rem;
  width: 100%; max-width: 300px; margin-top: .5rem;
}
.feed-welcome-tip {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1rem; background: var(--surface2);
  border-radius: var(--radius-sm); text-align: left;
  font-size: .9rem; color: var(--text2);
}
.feed-welcome-tip-icon { font-size: 1.3rem; flex-shrink: 0; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Input field shared */
input[type="text"], input[type="email"], input[type="password"], input[type="search"],
textarea, select {
  background: var(--surface2); color: var(--text);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: .6rem .9rem; font-size: .95rem; width: 100%;
  transition: border-color var(--transition);
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); outline: none; }
[data-theme="dark"] input, [data-theme="dark"] textarea, [data-theme="dark"] select { background: #1e2732; }

/* ── Theme Toggle ────────────────────────────────────────────────────────── */
#btn-theme {
  width: 40px; height: 40px; border-radius: 50%;
  color: #fff; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
#btn-theme:hover { background: rgba(255,255,255,.18); }

/* ── Utilities ───────────────────────────────────────────────────────────── */
.hidden      { display: none !important; }
.text-center { text-align: center; }
.text-muted  { color: var(--text3); }
.text-sm     { font-size: .84rem; }
.mt-1 { margin-top: .5rem; }  .mt-2 { margin-top: 1rem; }  .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.flex { display: flex; } .flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }

/* ── RTL (árabe) ─────────────────────────────────────────────────────────── */
[dir="rtl"] .drawer       { left: auto; right: 0; transform: translateX(100%); }
[dir="rtl"] .drawer.open  { transform: translateX(0); }
[dir="rtl"] .topbar       { flex-direction: row-reverse; }
[dir="rtl"] .bottom-nav   { direction: rtl; }
[dir="rtl"] .post-header  { flex-direction: row-reverse; }
[dir="rtl"] .post-actions { flex-direction: row-reverse; }
[dir="rtl"] .chat-item    { flex-direction: row-reverse; }
[dir="rtl"] .drawer-item  { flex-direction: row-reverse; }
[dir="rtl"] .drawer-font-row,
[dir="rtl"] .drawer-lang-row { flex-direction: row-reverse; }
[dir="rtl"] .input-eye-btn { right: auto; left: 0; border-radius: var(--radius) 0 0 var(--radius); }
[dir="rtl"] .input-eye-wrap input { padding-right: 1rem; padding-left: 2.6rem; }

/* ── Responsivo desktop ──────────────────────────────────────────────────── */
@media (min-width: 640px) {
  #page-container, .topbar, .bottom-nav, .chat-input-bar, #toast-container {
    max-width: 600px;
  }
  #page-container { margin: 0 auto; }
  .topbar, .bottom-nav, .chat-input-bar {
    left: 50%; transform: translateX(-50%); right: auto; width: 600px;
  }
  #toast-container { left: 50%; transform: translateX(-50%); }
}

/* ── Advanced Events ─────────────────────────────────────────────────────── */
.adv-event-card .event-date-badge {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  color: #fff; font-size: .72rem; padding: .4rem .6rem .5rem;
  text-transform: capitalize;
}

/* ── Directory Pages — list cards ───────────────────────────────────────── */
.pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .75rem;
  padding: .75rem;
}
.page-card {
  background: var(--surface2);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.page-card:active { transform: scale(.97); }
.page-card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: var(--surface3);
  display: flex; align-items: center; justify-content: center;
}
.page-card-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.page-card-no-img {
  font-size: 2.2rem; color: var(--text3);
}
.page-badge {
  position: absolute; top: 6px; right: 6px;
  font-size: .65rem; font-weight: 700; padding: 2px 6px;
  border-radius: 6px; text-transform: uppercase; letter-spacing: .04em;
}
.page-badge-feat  { background: var(--primary); color: #fff; }
.page-badge-spon  { background: #f5a623; color: #fff; }
.page-card-body   { padding: .5rem .6rem .6rem; }
.page-card-title  { font-weight: 600; font-size: .85rem; line-height: 1.3; margin-bottom: .2rem;
                    overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.page-card-meta   { font-size: .72rem; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-card-likes  { font-size: .72rem; color: var(--text3); margin-top: .25rem; }

/* ── Directory Pages — detail page ─────────────────────────────────────── */
.page-detail-cover {
  position: relative;
  width: 100%; height: 200px;
  background: var(--surface3);
  overflow: hidden;
}
.page-detail-cover img {
  width: 100%; height: 100%; object-fit: cover;
}
.page-detail-cover-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.page-detail-cover-gradient {
  position: absolute; bottom: 0; left: 0; right: 0; height: 80px;
  background: linear-gradient(transparent, rgba(0,0,0,.5));
}
.page-detail-back-btn,
.page-detail-menu-btn {
  position: absolute; top: .75rem;
  width: 36px; height: 36px;
  background: rgba(0,0,0,.4); border: none; border-radius: 50%;
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.page-detail-back-btn { left: .75rem; }
.page-detail-menu-btn { right: .75rem; font-size: 1.4rem; font-weight: 700; }
.page-detail-identity {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .75rem 1rem .5rem;
  margin-top: -32px;
  position: relative; z-index: 1;
}
.page-detail-avatar-wrap {
  flex-shrink: 0;
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 3px solid var(--background);
  background: var(--surface3);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.pd-cover-cam-btn {
  position: absolute; bottom: .6rem; right: .6rem; z-index: 3;
  display: flex; align-items: center; gap: .3rem;
  background: rgba(0,0,0,.55); color: #fff;
  border: none; border-radius: 20px;
  padding: .3rem .7rem; cursor: pointer; font-size: .82rem;
}
.pd-avatar-cam-btn {
  position: absolute; bottom: 0; right: 0;
  width: 24px; height: 24px;
  background: var(--primary); color: #fff;
  border: 2px solid var(--background); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; z-index: 2;
}
.page-detail-avatar { width: 100%; height: 100%; object-fit: cover; }
.page-detail-info   { flex: 1; padding-top: 36px; }
.page-detail-title  { font-size: 1.1rem; font-weight: 700; margin: 0 0 .15rem; line-height: 1.3; }
.page-detail-cat    { font-size: .82rem; color: var(--primary); font-weight: 600; }
.page-detail-loc    { font-size: .8rem; color: var(--text3); margin-top: .15rem; }
.page-detail-actions{
  display: flex; gap: .5rem; flex-wrap: wrap;
  padding: .25rem 1rem .5rem;
}
.page-detail-owner  {
  display: flex; align-items: center; gap: .5rem;
  padding: .25rem 1rem .5rem;
}
.page-detail-owner-img {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
}
.page-detail-owner-name { font-size: .8rem; color: var(--text3); }
.page-detail-tags   { display: flex; flex-wrap: wrap; gap: .35rem; padding: .25rem 1rem .5rem; }
.page-detail-desc   { font-size: .88rem; color: var(--text2); line-height: 1.55; }
.page-detail-sticky-bar {
  position: fixed; bottom: var(--bottomnav-h); left: 0; right: 0;
  display: flex;
  background: var(--surface2);
  border-top: 1px solid var(--border);
  z-index: 50;
}
.page-sticky-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: .2rem; padding: .5rem; font-size: .72rem; color: var(--primary);
  text-decoration: none; border: none; background: none; cursor: pointer;
}
.page-sticky-btn .ms-icon { font-size: 1.3rem; }
.tab-count {
  display: inline-block; background: var(--primary); color: #fff;
  border-radius: 10px; font-size: .65rem; font-weight: 700;
  padding: 1px 5px; margin-left: .2rem;
}

/* ── Sheet components (handle, title bar, action buttons) ────────────────── */
.sheet-handle {
  width: 36px; height: 4px; background: var(--border);
  border-radius: 2px; margin: .6rem auto .25rem; flex-shrink: 0;
}
.sheet-title {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .75rem .5rem .5rem;
  border-bottom: 1px solid var(--divider); flex-shrink: 0;
}
.sheet-title > span { flex: 1; font-weight: 600; font-size: .97rem; }
.sheet-action-btn {
  display: flex; align-items: center; gap: .75rem;
  width: 100%; padding: .85rem 1.25rem;
  background: none; border: none; cursor: pointer;
  font-size: .95rem; color: var(--text1); text-align: left;
}
.sheet-action-btn:active { background: var(--hover); }
.sheet-action-btn--close { color: var(--text3); }

/* ── Form inputs (generic) ───────────────────────────────────────────────── */
.form-input {
  width: 100%; padding: .55rem .75rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm, 8px);
  background: var(--surface2); color: var(--text1);
  font-size: .9rem; font-family: inherit; outline: none;
  transition: border-color .18s;
}
.form-input:focus { border-color: var(--primary); }

/* ── Page manage cards (Minhas Páginas) ──────────────────────────────────── */
.page-manage-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem; border-bottom: 1px solid var(--divider);
  gap: .75rem;
}
.page-manage-card-main {
  display: flex; align-items: center; gap: .75rem;
  flex: 1; min-width: 0; cursor: pointer;
}
.page-manage-card-img {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.page-manage-card-info { min-width: 0; }
.page-manage-card-title {
  font-weight: 600; font-size: .9rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.page-manage-card-stats { font-size: .78rem; color: var(--text3); margin-top: .15rem; }
.page-manage-card-actions { flex-shrink: 0; }

/* ── Package selection ───────────────────────────────────────────────────── */
.pkg-row {
  display: flex; align-items: center; gap: .5rem;
  padding: .85rem 1rem; border-bottom: 1px solid var(--divider);
}
.pkg-row-main { flex: 1; cursor: pointer; min-width: 0; }
.pkg-row-title { font-weight: 600; font-size: .95rem; }
.pkg-row-price { font-size: .8rem; color: var(--primary); margin-top: .15rem; }
.pkg-row-desc  { font-size: .78rem; color: var(--text3); margin-top: .1rem;
                 white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pkg-info-list { display: flex; flex-direction: column; gap: 0; }
.pkg-info-row  { display: flex; justify-content: space-between; align-items: center;
                 padding: .6rem 0; border-bottom: 1px solid var(--divider); }
.pkg-info-label { font-size: .85rem; color: var(--text2); }
.pkg-info-val   { font-size: .85rem; font-weight: 600; }

/* ── Create page form components ─────────────────────────────────────────── */
.form-file-wrap { position: relative; }
.form-file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.form-file-label {
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem .75rem; border: 1px dashed var(--border); border-radius: 8px;
  background: var(--surface2); color: var(--text2); cursor: pointer; font-size: .88rem;
}
.form-file-label .ms-icon { color: var(--primary); }

/* ── Pages toolbar (sort / search) ──────────────────────────────────────── */
.pd-toolbar {
  display: flex; align-items: center; min-height: 44px;
  padding: .2rem .5rem; border-bottom: 1px solid var(--divider); gap: .25rem;
}
.pd-filter-area { display: flex; align-items: center; width: 100%; }
.pd-search-area  { display: none; align-items: center; gap: .4rem; width: 100%; }
.pd-sort-btn {
  display: flex; align-items: center; gap: .2rem; margin-left: auto;
  background: none; border: none; cursor: pointer; padding: .35rem .5rem;
  border-radius: var(--radius-sm, 8px); color: var(--text2); font-size: .87rem;
}
.pd-sort-btn:active { background: var(--surface2); }
.pd-search-input {
  flex: 1; padding: .42rem .7rem; border: 1px solid var(--border);
  border-radius: 20px; background: var(--surface2); color: var(--text1);
  font-size: .9rem; font-family: inherit; outline: none;
}
.pd-search-input:focus { border-color: var(--primary); }

/* ── Category list (Categorias tab) ─────────────────────────────────────── */
.pd-cat-list { display: flex; flex-direction: column; }
.pd-cat-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1rem; border-bottom: 1px solid var(--divider); cursor: pointer;
}
.pd-cat-row:active { background: var(--surface2); }
.pd-cat-icon  { color: var(--primary); }
.pd-cat-name  { flex: 1; font-size: .95rem; }
.pd-cat-count {
  font-size: .78rem; color: var(--text3); background: var(--surface2);
  padding: .12rem .42rem; border-radius: 10px;
}
.pd-cat-browse-header {
  display: flex; align-items: center; gap: .5rem; padding: .5rem .5rem;
  grid-column: 1 / -1;
}

/* ── Listings / Reviews ──────────────────────────────────────────────────── */
.listing-card .listing-stars   { color: #f5a623; letter-spacing: -.05em; }
.listing-card .listing-rating  { font-size: .78rem; color: var(--text3); font-weight: 600; }
.listing-card .listing-rating-row { display: flex; align-items: center; gap: .3rem; margin: .15rem 0; }
.listing-cat-badge {
  position: absolute; bottom: .4rem; left: .4rem;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: .7rem; font-weight: 600; border-radius: 4px;
  padding: .15rem .45rem; pointer-events: none;
}
.listing-rating-row { display: flex; align-items: center; gap: .3rem; }
.listing-stars { color: #f5a623; }
.listing-rating { font-weight: 600; font-size: .85rem; }

/* ── Offers ──────────────────────────────────────────────────────────────── */
.offer-card .offer-discount-badge {
  position: absolute; top: .5rem; right: .5rem;
  background: var(--error); color: #fff;
  font-size: .72rem; font-weight: 700;
  padding: .2rem .45rem; border-radius: 4px;
}
.offer-price-row       { display: flex; align-items: baseline; gap: .5rem; margin: .25rem 0; }
.offer-old-price       { text-decoration: line-through; color: var(--text3); font-size: .82rem; }
.offer-price           { color: var(--primary); font-size: 1rem; font-weight: 700; }

/* ── Packages ────────────────────────────────────────────────────────────── */
.packages-list         { display: flex; flex-direction: column; gap: 1rem; padding: 1rem; }
.package-card {
  background: var(--surface2); border-radius: var(--radius);
  border: 2px solid var(--border); padding: 1.25rem;
  transition: border-color var(--transition);
}
.package-card.package-current { border-color: var(--primary); }
.package-header        { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: .75rem; }
.package-name          { font-size: 1.1rem; font-weight: 700; }
.package-price         { font-size: 1.4rem; font-weight: 800; color: var(--primary); }
.package-period        { font-size: .8rem; color: var(--text3); font-weight: 400; }
.package-desc          { font-size: .88rem; color: var(--text2); margin-bottom: .75rem; }
.package-features      { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .35rem; }
.package-features li   { display: flex; align-items: center; gap: .4rem; font-size: .88rem; }
.package-features .xi  { color: var(--primary); font-size: 1rem; }
.package-btn           { width: 100%; padding: .65rem; border-radius: var(--radius-sm); font-size: .95rem; font-weight: 600; background: var(--primary); color: #fff; border: none; cursor: pointer; }
.package-btn.btn-current { background: var(--surface3); color: var(--text3); cursor: default; }
.module-hero           { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 2rem 1rem 1rem; text-align: center; color: var(--text2); }
.module-hero h2        { margin: 0; font-size: 1.3rem; color: var(--text); }

/* ── Stickers ────────────────────────────────────────────────────────────── */
.sticker-tab           { flex: 1; padding: .55rem; background: none; border: none; border-bottom: 2px solid transparent; font-size: .9rem; color: var(--text2); cursor: pointer; transition: all var(--transition); }
.sticker-tab.active    { border-bottom-color: var(--primary); color: var(--primary); font-weight: 600; }
.stickers-grid         { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; padding: 1rem; }
.sticker-card          { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .75rem .5rem; background: var(--surface2); border-radius: var(--radius-sm); cursor: pointer; transition: background var(--transition); }
.sticker-card:hover    { background: var(--surface3); }
.sticker-img           { width: 72px; height: 72px; display: flex; align-items: center; justify-content: center; }
.sticker-img img       { width: 100%; height: 100%; object-fit: contain; }
.sticker-placeholder   { font-size: 2.5rem; }
.sticker-name          { font-size: .75rem; color: var(--text2); text-align: center; }
.sticker-buy-btn       { font-size: .72rem; background: var(--primary); color: #fff; border: none; border-radius: 12px; padding: .25rem .6rem; cursor: pointer; }
.sticker-owned         { font-size: .72rem; color: var(--text3); }

/* ── Stories ─────────────────────────────────────────────────────────────── */
.story-rail            { display: flex; gap: .75rem; padding: 1rem; overflow-x: auto; scrollbar-width: none; }
.story-rail::-webkit-scrollbar { display: none; }
.story-create-btn, .story-bubble {
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  flex-shrink: 0; cursor: pointer;
}
.story-create-icon {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--primary); display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.5rem;
}
.story-create-label, .story-user { font-size: .72rem; color: var(--text2); max-width: 64px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story-ring {
  width: 60px; height: 60px; border-radius: 50%;
  padding: 2.5px;
  background: linear-gradient(135deg, #f6a623, #e04f7b, #4da2c5);
}
.story-ring img        { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2.5px solid var(--surface); }
.story-seen .story-ring { background: var(--surface3); }
.story-viewer          { position: fixed; inset: 0; z-index: 9999; background: #000; display: flex; align-items: center; justify-content: center; }
.story-viewer.closing  { animation: fadeOut .25s ease forwards; }
.story-viewer-inner    { position: relative; width: 100%; max-width: 420px; height: 100%; }
.story-progress-bar    { position: absolute; top: .75rem; left: .75rem; right: .75rem; z-index: 2; display: flex; gap: 3px; }
.story-progress-seg    { flex: 1; height: 3px; background: rgba(255,255,255,.35); border-radius: 2px; transition: background .3s; }
.story-progress-seg.done   { background: #fff; }
.story-progress-seg.active { background: rgba(255,255,255,.8); animation: storyProgress 5s linear forwards; }
@keyframes storyProgress { from { background: rgba(255,255,255,.4); } to { background: #fff; } }
.story-viewer-header   { position: absolute; top: 1.5rem; left: .75rem; right: .75rem; z-index: 3; display: flex; align-items: center; gap: .5rem; }
.story-viewer-avatar   { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; }
.story-viewer-name     { color: #fff; font-size: .9rem; font-weight: 600; flex: 1; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.story-viewer-close    { background: none; border: none; color: #fff; font-size: 1.3rem; cursor: pointer; padding: .25rem; }
.story-viewer-menu-btn {
  background: rgba(0,0,0,.45); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.18); border-radius: 50%;
  color: #fff; cursor: pointer; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.story-viewer-menu-btn:hover { background: rgba(0,0,0,.65); }
.story-viewer-menu-btn .ms-icon { font-size: 1.25rem; line-height: 1; }

/* Story action menu overlay */
.story-menu-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.55);
  display: flex; align-items: flex-end;
  animation: fadeIn .18s ease;
}
.story-menu-overlay.open .story-menu-inner { transform: translateY(0); }
.story-menu-inner {
  width: 100%; background: var(--surface);
  border-radius: 18px 18px 0 0;
  padding: .5rem 0 calc(.5rem + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.story-menu-item {
  width: 100%; display: flex; align-items: center; gap: 1rem;
  padding: .9rem 1.25rem; background: none; border: none;
  color: var(--text1); font-size: .97rem; cursor: pointer; text-align: left;
  transition: background .15s;
}
.story-menu-item:hover  { background: var(--hover); }
.story-menu-item .ms-icon { font-size: 1.3rem; color: var(--text2); }
.story-menu-item.danger { color: var(--danger, #e53935); }
.story-menu-item.danger .ms-icon { color: var(--danger, #e53935); }
.story-menu-item.story-menu-item-active { font-weight: 600; color: var(--primary); }
.story-menu-item.story-menu-item-active .ms-icon { color: var(--primary); }
.story-menu-title { padding: .75rem 1.25rem .25rem; font-size: .8rem; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: .06em; }
.story-menu-divider { height: 1px; background: var(--divider); margin: .25rem 0; }
.story-view-img        { width: 100%; height: 100%; object-fit: contain; transition: opacity .18s; }
.story-view-video      { width: 100%; height: 100%; object-fit: contain; display: none; background: #000; }
.story-view-caption    { position: absolute; bottom: 1.5rem; left: 1rem; right: 1rem; color: #fff; font-size: .95rem; text-align: center; text-shadow: 0 1px 6px rgba(0,0,0,.8); pointer-events: none; }
.story-create-body     { padding: 1rem; display: flex; flex-direction: column; gap: .75rem; overflow-y: auto; flex: 1; }
.story-photo-preview   { min-height: 0; }
.story-photo-preview img  { max-width: 100%; max-height: 240px; object-fit: contain; border-radius: 8px; display: block; }
.story-photo-preview video { max-width: 100%; max-height: 240px; border-radius: 8px; display: block; }
.story-caption-input   { min-height: 80px; resize: none; }
.photo-upload-btn      { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; padding: .6rem 1rem; background: var(--surface3); border-radius: var(--radius-sm); font-size: .9rem; color: var(--text); }

/* ── People Suggestion ───────────────────────────────────────────────────── */
.module-page-header    { display: flex; align-items: flex-start; gap: .75rem; padding: 1rem; border-bottom: 1px solid var(--border); }
.module-page-header h2 { margin: 0 0 .2rem; font-size: 1.05rem; }
.module-page-header p  { margin: 0; font-size: .82rem; color: var(--text3); }
.people-list           { display: flex; flex-direction: column; }
.people-card           { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border-bottom: 1px solid var(--border); transition: background var(--transition); }
.people-card.removing  { opacity: 0; max-height: 0; overflow: hidden; transition: all .3s; }
.people-avatar img     { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; cursor: pointer; }
.people-info           { flex: 1; cursor: pointer; }
.people-name           { font-weight: 600; font-size: .95rem; }
.people-meta           { font-size: .8rem; color: var(--text3); }
.people-bio            { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.people-actions        { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }
.btn-add-friend        { display: flex; align-items: center; gap: .25rem; background: var(--primary); color: #fff; border: none; border-radius: 20px; padding: .4rem .75rem; font-size: .82rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn-add-friend:disabled { background: var(--surface3); color: var(--text3); }
.btn-dismiss           { background: var(--surface3); border: none; border-radius: 50%; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text3); font-size: .9rem; }

/* ── Settings ────────────────────────────────────────────────────────────── */
.settings-page         { padding: 0; }
.settings-section      { padding: 1rem; border-bottom: 1px solid var(--border); }
.settings-network-group       { margin-bottom: 1rem; }
.settings-network-group-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text3); margin-bottom: .5rem; }
.settings-network-row  { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.settings-network-row:last-child { border-bottom: none; }
.settings-network-img  { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.settings-network-name { font-weight: 600; font-size: .9rem; }
.settings-network-desc { font-size: .78rem; color: var(--text3); margin-top: .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settings-section-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); font-weight: 700; margin-bottom: .75rem; }
.settings-row          { margin-bottom: .75rem; }
.settings-row label    { display: block; font-size: .82rem; color: var(--text2); margin-bottom: .3rem; }
.settings-input, .settings-select { width: 100%; }
.btn-settings-save     { margin-top: .5rem; padding: .55rem 1.25rem; background: var(--primary); color: #fff; border: none; border-radius: var(--radius-sm); font-size: .9rem; font-weight: 600; cursor: pointer; }
.settings-toggle-row   { display: flex; align-items: center; justify-content: space-between; padding: .5rem 0; }

.settings-lang-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin-top: .25rem;
}
.settings-lang-btn {
  display: flex; align-items: center; gap: .55rem;
  padding: .6rem .75rem; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--surface);
  cursor: pointer; font-size: .85rem; text-align: left;
  transition: border-color .15s, background .15s;
}
.settings-lang-btn:hover  { background: var(--hover, rgba(0,0,0,.05)); }
.settings-lang-btn.active { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.settings-lang-flag  { font-size: 1.3rem; line-height: 1; flex-shrink: 0; }
.settings-lang-label { font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-toggle       { position: relative; width: 44px; height: 24px; cursor: pointer; }
.settings-toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider         { position: absolute; inset: 0; background: var(--surface3); border-radius: 24px; transition: background var(--transition); }
.toggle-slider::before { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: transform var(--transition); }
.settings-toggle input:checked + .toggle-slider              { background: var(--primary); }
.settings-toggle input:checked + .toggle-slider::before      { transform: translateX(20px); }
.settings-danger .btn-danger { background: var(--error); color: #fff; border: none; padding: .6rem 1.25rem; border-radius: var(--radius-sm); font-size: .9rem; font-weight: 600; cursor: pointer; }

/* ── Video Channel card ──────────────────────────────────────────────────── */
.adv-channel-card .module-card-thumb { aspect-ratio: 1; }

/* ── Channel create form photo picker ───────────────────────────────────── */
.form-photo-picker {
  width: 100%; height: 140px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  background: var(--surface2);
  transition: border-color .2s;
}
.form-photo-picker:hover { border-color: var(--accent); }

/* ── Profile photo edit buttons ──────────────────────────────────────────── */
.profile-cover-wrap { position: relative; width: 100%; }
.profile-cover-edit-btn {
  position: absolute; bottom: .5rem; right: .5rem;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  border: 1.5px solid rgba(255,255,255,.3);
  color: #fff; font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 3;
}
.profile-avatar-edit-btn {
  position: absolute; bottom: 4px; right: 4px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); border: 2px solid var(--surface);
  color: #fff; font-size: .85rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.profile-avatar-edit-btn .ms-icon { font-size: .9rem; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Profile photo post card (feed) ──────────────────────────────────────── */
.profile-photo-post { position:relative; overflow:hidden; cursor:pointer; background:var(--surface3); }
.profile-photo-post-bg { width:100%; height:220px; background-size:cover; background-position:center; filter:blur(18px) brightness(.55); transform:scale(1.08); }
.profile-photo-post-fg { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; }
.profile-photo-post-img { width:120px; height:120px; border-radius:50%; object-fit:cover; border:3px solid rgba(255,255,255,.85); box-shadow:0 2px 14px rgba(0,0,0,.45); }

/* ── Profile page sections (recent photos / friends) ─────────────────────── */
.profile-section { padding:.75rem 0; border-bottom:1px solid var(--divider); }
.profile-section-header { display:flex; align-items:center; justify-content:space-between; padding:.75rem 1rem .5rem; }
.profile-section-title-wrap { display:flex; align-items:center; gap:.45rem; }
.profile-section-icon { font-size:1.15rem; color:var(--primary); }
.profile-section-title { font-size:.92rem; font-weight:700; color:var(--text1); }
.profile-section-link { background:none; border:none; font-size:.82rem; color:var(--primary); cursor:pointer; padding:0; }
.profile-photos-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:2px; padding:0 2px; }
.profile-photo-thumb { aspect-ratio:1; overflow:hidden; background:var(--surface3); cursor:pointer; position:relative; }
.profile-photo-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.profile-photo-placeholder { aspect-ratio:1; background:var(--surface3); animation:shimmer 1.4s infinite; }
.profile-photo-more-overlay { position:absolute; inset:0; background:rgba(0,0,0,.55); display:flex; align-items:center; justify-content:center; color:#fff; font-size:1.3rem; font-weight:700; }
.profile-friends-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:.5rem; padding:0 1rem; }
.profile-friend-card { display:flex; flex-direction:column; align-items:center; gap:.3rem; cursor:pointer; }
.profile-friend-card img { width:100%; aspect-ratio:1; border-radius:8px; object-fit:cover; display:block; }
.profile-friend-card span { font-size:.72rem; color:var(--text2); text-align:center; line-height:1.2; overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.profile-friend-placeholder { aspect-ratio:1; border-radius:8px; background:var(--surface3); animation:shimmer 1.4s infinite; }
@keyframes shimmer { 0%,100%{opacity:.7} 50%{opacity:.35} }

/* ── Profile Playlist ───────────────────────────────────────────────────── */
.profile-playlist-add-btn {
  display:flex; align-items:center; gap:.6rem; width:100%; padding:.85rem 1rem;
  background:var(--surface2); border:1.5px dashed var(--divider); border-radius:10px;
  margin:.25rem 1rem; width:calc(100% - 2rem); cursor:pointer;
  color:var(--primary); font-size:.9rem; font-weight:500;
}
.profile-playlist-add-btn .ms-icon { font-size:1.3rem; }
.profile-playlist-card {
  display:flex; gap:1rem; padding:.5rem 1rem; align-items:flex-start;
}
.ppc-cover-wrap {
  position:relative; flex-shrink:0; width:90px; height:90px; border-radius:10px;
  overflow:hidden; cursor:pointer;
}
.ppc-cover { width:100%; height:100%; object-fit:cover; display:block; }
.ppc-play-overlay {
  position:absolute; inset:0; background:rgba(0,0,0,.35);
  display:flex; align-items:center; justify-content:center;
  opacity:0; transition:opacity .2s;
}
.ppc-cover-wrap:hover .ppc-play-overlay,
.ppc-cover-wrap:active .ppc-play-overlay { opacity:1; }
.ppc-play-icon { font-size:2.5rem; color:#fff; }
.ppc-info { flex:1; min-width:0; }
.ppc-title { font-size:.95rem; font-weight:700; color:var(--text1); line-height:1.3;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ppc-artist { font-size:.8rem; color:var(--text3); margin-top:2px; }
.ppc-meta { font-size:.78rem; color:var(--text3); margin-top:2px; }
.ppc-actions { display:flex; gap:.5rem; margin-top:.6rem; flex-wrap:wrap; }
.ppc-play-btn { display:flex; align-items:center; gap:.3rem; }

/* Playlist picker sheet */
.pps-tabs {
  display:flex; border-bottom:1px solid var(--divider); padding:0 .5rem; overflow-x:auto;
  scrollbar-width:none;
}
.pps-tabs::-webkit-scrollbar { display:none; }
.pps-tab-btn {
  flex-shrink:0; padding:.6rem .75rem; font-size:.82rem; font-weight:500;
  border:none; background:none; color:var(--text3); cursor:pointer;
  border-bottom:2px solid transparent; margin-bottom:-1px; transition:color .15s,border-color .15s;
}
.pps-tab-btn.active { color:var(--primary); border-bottom-color:var(--primary); }
.pps-item {
  display:flex; align-items:center; gap:.75rem; padding:.7rem 1rem;
  cursor:pointer; transition:background .15s;
}
.pps-item:active { background:var(--surface2); }
.pps-item--active { background:color-mix(in srgb,var(--primary) 8%,transparent); }
.pps-cover { width:44px; height:44px; border-radius:6px; object-fit:cover; flex-shrink:0; }
.pps-info { flex:1; min-width:0; }
.pps-title { font-size:.88rem; font-weight:600; color:var(--text1);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pps-meta { font-size:.75rem; color:var(--text3); }
.pps-remove { color:var(--error); }
.pps-divider { height:1px; background:var(--divider); margin:.25rem 0; }
/* External embed (Spotify / YouTube) */
.ppc-external { padding:.5rem 0; }
.ppc-external-label { font-size:.78rem; color:var(--text3); margin-bottom:.5rem; padding:0 .25rem; }

/* ── Image Editor (xie) ─────────────────────────────────────────────────── */
.xie-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: #000;
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: xie-in .18s ease;
}
@keyframes xie-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }

.xie-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .5rem .75rem;
  background: #111;
  flex-shrink: 0;
  height: 52px;
}
.xie-title      { color: #fff; font-size: 1rem; font-weight: 600; }
.xie-btn-icon   { background: none; border: none; color: #fff; font-size: 1.3rem; cursor: pointer; padding: .4rem; border-radius: 50%; }
.xie-btn-icon:hover { background: rgba(255,255,255,.1); }
.xie-btn-done   { display: flex; align-items: center; gap: .35rem; background: var(--primary); color: #fff; border: none; border-radius: 20px; padding: .4rem .9rem; font-size: .9rem; font-weight: 600; cursor: pointer; }
.xie-btn-done:disabled { opacity: .6; cursor: default; }

.xie-frame-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: #000; overflow: hidden;
  min-height: 0;
}
.xie-frame {
  position: relative; overflow: hidden;
  cursor: grab; background: #000;
  /* size is set by JS */
}
.xie-frame:active { cursor: grabbing; }
.xie-frame canvas { display: block; width: 100%; height: 100%; }

.xie-tabs {
  display: flex; background: #111;
  border-top: 1px solid #222;
  flex-shrink: 0;
}
.xie-tab {
  flex: 1; padding: .65rem .5rem; background: none; border: none;
  color: #888; font-size: .84rem; font-weight: 600; cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.xie-tab.active { color: #fff; border-bottom-color: var(--primary); }

.xie-controls {
  background: #111; flex-shrink: 0;
  min-height: 120px; max-height: 260px;
  overflow-y: auto; overflow-x: hidden;
  padding: .5rem 0;
}
.xie-controls.xie-texto-mode { max-height: 360px; }

/* Font picker */
.xie-font-row {
  display: flex; gap: .35rem; padding: .25rem .75rem;
  overflow-x: auto; scrollbar-width: none;
}
.xie-font-row::-webkit-scrollbar { display: none; }
.xie-font-btn {
  flex-shrink: 0; background: #1c1c1c; border: 1px solid #333;
  color: #ccc; padding: .28rem .65rem; border-radius: 6px;
  font-size: .85rem; cursor: pointer; white-space: nowrap;
}
.xie-font-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Section labels inside text panel */
.xie-sect { color: #555; font-size: .68rem; text-transform: uppercase;
  letter-spacing: .06em; padding: .3rem .75rem .1rem; }

/* Alignment buttons */
.xie-align-row { display: flex; gap: .3rem; padding: .15rem 0; }
.xie-align-btn {
  background: #1c1c1c; border: 1px solid #333; color: #aaa;
  padding: .3rem .55rem; border-radius: 6px; cursor: pointer; font-size: 1rem;
  display: flex; align-items: center;
}
.xie-align-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Text-panel inline row */
.xie-tp-row { display: flex; align-items: center; gap: .4rem; padding: .2rem .75rem; flex-wrap: wrap; }
.xie-tp-row .xie-sect { padding: 0; flex-basis: 100%; }

/* Color & bg swatches */
.xie-swatch-row { display: flex; gap: .3rem; flex-wrap: wrap; padding: .15rem .75rem .3rem; }
.xie-swatch {
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
  border: 2px solid rgba(255,255,255,.2); flex-shrink: 0;
  transition: transform .1s; display: flex; align-items: center; justify-content: center;
}
.xie-swatch:hover { transform: scale(1.15); }
.xie-swatch.active { border-color: #fff; transform: scale(1.18); }
.xie-swatch-none {
  background: transparent; border-style: dashed; color: #666; font-size: .8rem;
  font-weight: 700; border-radius: 6px; width: auto; padding: 0 6px; border-color: #444;
}
.xie-swatch-none.active { border-color: var(--primary); color: var(--primary); }

/* Crop tab */
.xie-aspect-row {
  display: flex; gap: .4rem; padding: .5rem .75rem;
  overflow-x: auto; scrollbar-width: none;
}
.xie-aspect-row::-webkit-scrollbar { display: none; }
.xie-aspect-btn {
  flex-shrink: 0; padding: .35rem .75rem;
  background: #222; color: #aaa;
  border: 1.5px solid #333; border-radius: 20px;
  font-size: .8rem; font-weight: 600; cursor: pointer;
  transition: all .2s;
}
.xie-aspect-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.xie-transform-row {
  display: flex; gap: .5rem; justify-content: center;
  padding: .4rem .75rem;
}
.xie-transform-btn {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: #222; border: 1.5px solid #333; color: #ccc;
  font-size: 1.1rem; cursor: pointer; transition: background .2s;
}
.xie-transform-btn:hover { background: #333; }

.xie-hint { text-align: center; font-size: .72rem; color: #555; padding: .25rem; }

/* Adjust tab */
.xie-sliders { padding: .5rem .75rem; display: flex; flex-direction: column; gap: .4rem; }
.xie-slider-row {
  display: flex; align-items: center; gap: .6rem;
}
.xie-slider-label { color: #aaa; font-size: .78rem; width: 90px; flex-shrink: 0; }
.xie-slider {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 2px; background: #333; outline: none; cursor: pointer;
}
.xie-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px;
  border-radius: 50%; background: var(--primary); cursor: pointer;
}
.xie-slider::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: var(--primary); border: none; cursor: pointer;
}
.xie-slider-val { color: #777; font-size: .75rem; width: 32px; text-align: right; flex-shrink: 0; }
.xie-reset-btn {
  align-self: flex-end; margin-top: .25rem;
  background: none; border: 1px solid #333; color: #888;
  border-radius: 12px; padding: .3rem .75rem; font-size: .8rem; cursor: pointer;
}
.xie-reset-btn:hover { background: #222; color: #ccc; }

/* Filters tab */
.xie-presets {
  display: flex; gap: .5rem; padding: .5rem .75rem;
  overflow-x: auto; scrollbar-width: none;
}
.xie-presets::-webkit-scrollbar { display: none; }
.xie-preset {
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  flex-shrink: 0; cursor: pointer;
}
.xie-preset img {
  width: 72px; height: 72px; object-fit: cover;
  border-radius: 8px; border: 2.5px solid transparent;
  transition: border-color .2s;
}
.xie-preset.active img { border-color: var(--primary); }
.xie-preset span { font-size: .7rem; color: #999; text-align: center; }
.xie-preset.active span { color: #fff; font-weight: 600; }

/* Material Symbols ligature helper (editor & generic use) */
.ms-icon {
  font-family: 'Material Symbols Rounded';
  font-size: 1.25rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle; color: inherit;
}

/* ── Video Editor (xve) ─────────────────────────────────────────────────── */
.xve-overlay { user-select: none; }

.xve-frame-wrap { position: relative; }

.xve-frame {
  position: relative;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: #000; overflow: hidden;
}

.xve-play-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.xve-play-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(0,0,0,.45); backdrop-filter: blur(6px);
  border: 2px solid rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  color: #fff; transition: background .2s;
}

/* ── AgathaAI attach buttons ─────────────────────────────────────────────── */
.ai-attach-btn {
  background: linear-gradient(135deg, var(--primary-light), #f0e8ff);
  color: var(--primary-dark);
  border: 1px solid var(--primary);
  gap: .3rem;
}
.ai-attach-btn:hover { background: linear-gradient(135deg, #d5eaf6, #e8d8ff); }
.ai-attach-btn .ms-icon { font-size: 1.05rem; }
[data-theme="dark"] .ai-attach-btn {
  background: linear-gradient(135deg, rgba(91,181,216,.14), rgba(160,100,220,.14));
  color: var(--primary-mid);
  border-color: rgba(91,181,216,.35);
}
[data-theme="dark"] .ai-attach-btn:hover {
  background: linear-gradient(135deg, rgba(91,181,216,.24), rgba(160,100,220,.24));
}

/* ── AgathaAI Modal ──────────────────────────────────────────────────────── */
.ai-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; transition: opacity .2s;
}
.ai-modal-overlay.open { opacity: 1; }

.ai-modal {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  width: 100%; max-width: 400px;
  overflow: hidden;
  transform: translateY(20px); transition: transform .25s;
}
.ai-modal-overlay.open .ai-modal { transform: translateY(0); }

.ai-modal-header {
  display: flex; align-items: center;
  padding: 1rem 1.25rem .75rem;
  border-bottom: 1px solid var(--divider);
}

.ai-modal-body { padding: 1rem 1.25rem; }

.ai-modal-textarea {
  width: 100%; box-sizing: border-box;
  resize: vertical; min-height: 90px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: .65rem .8rem;
  font-size: .95rem;
  font-family: inherit;
  background: var(--surface2);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
.ai-modal-textarea:focus { border-color: var(--primary); }

.ai-modal-status {
  display: flex; align-items: center; gap: .75rem;
  padding: .5rem 1.25rem;
  font-size: .85rem; color: var(--text3);
}

.ai-spinner {
  width: 18px; height: 18px; flex-shrink: 0;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ── Comment replies & edit ─────────────────────────────────────────────── */
.comment-reply { margin-left: 2.5rem; }
.comment-action-btn {
  background: none; border: none; cursor: pointer;
  font-size: .78rem; color: var(--primary);
  padding: 0 .3rem;
}
.comment-show-replies {
  background: none; border: none; cursor: pointer;
  font-size: .8rem; color: var(--primary);
  padding: .2rem 0; display: block;
}
.comment-replies-list { margin-left: .25rem; }
.reply-input-wrap {
  display: flex; align-items: center; gap: .5rem;
  margin-top: .5rem;
}
.reply-field {
  flex: 1; border: 1.5px solid var(--border);
  border-radius: 20px; padding: .4rem .8rem;
  font-size: .9rem; background: var(--surface2); color: var(--text);
}
.reply-field:focus { outline: none; border-color: var(--primary); }
.comment-edit-textarea {
  width: 100%; box-sizing: border-box;
  border: 1.5px solid var(--primary);
  border-radius: 8px; padding: .5rem .75rem;
  font-size: .9rem; font-family: inherit;
  background: var(--surface2); color: var(--text);
  resize: vertical; min-height: 60px;
}

/* ── Rich text toolbar ───────────────────────────────────────────────────── */
.richtext-toolbar {
  display: flex; gap: .3rem; padding: .3rem .5rem;
  border: 1px solid var(--border); border-bottom: none;
  border-radius: 10px 10px 0 0;
  background: var(--surface2);
}
.rt-btn {
  background: none; border: 1px solid transparent;
  border-radius: 6px; cursor: pointer;
  font-size: .9rem; padding: .2rem .5rem;
  color: var(--text2); line-height: 1.3;
}
.rt-btn:hover { background: var(--surface3); border-color: var(--border); }
.post-input-area { border-radius: 0 0 10px 10px !important; }

/* ── Emoji picker ────────────────────────────────────────────────────────── */
.emoji-picker {
  display: flex; flex-wrap: wrap; gap: .2rem;
  padding: .4rem .5rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: .3rem;
  max-height: 120px; overflow-y: auto;
}
.emoji-opt {
  background: none; border: none; cursor: pointer;
  font-size: 1.2rem; padding: .1rem .2rem; line-height: 1;
  border-radius: 4px;
}
.emoji-opt:hover { background: var(--surface3); }

/* ── Check-in chip ───────────────────────────────────────────────────────── */
.checkin-chip {
  display: inline-flex; align-items: center;
  background: var(--primary-light, #e8f4f8);
  color: var(--primary);
  border-radius: 20px; padding: .3rem .75rem;
  font-size: .82rem; margin: .4rem 0;
}

/* ── Cart ────────────────────────────────────────────────────────────────── */
.cart-wrap { display: flex; flex-direction: column; min-height: 100%; }
.cart-items { flex: 1; padding: .75rem; }
.cart-store-header { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text2); padding: .5rem .25rem .25rem; margin-top: .25rem; }
.cart-item {
  display: flex; align-items: flex-start; gap: .75rem;
  background: var(--surface); border-radius: 14px;
  padding: .75rem; margin-bottom: .75rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.cart-item-img { width: 72px; height: 72px; flex-shrink: 0; border-radius: 10px; overflow: hidden; background: var(--surface2); }
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-no-img { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text3); }
.cart-item-info { flex: 1; }
.cart-item-title { font-size: .9rem; font-weight: 600; line-height: 1.3; margin-bottom: .2rem; }
.cart-item-opts  { font-size: .78rem; color: var(--text3); margin-bottom: .2rem; }
.cart-item-price { font-size: .95rem; font-weight: 700; color: var(--primary); }
.cart-item-ctrl  { display: flex; align-items: center; gap: .4rem; margin-top: .4rem; }
.cart-qty-btn {
  width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--border);
  background: var(--surface2); cursor: pointer; font-size: 1rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.cart-qty-btn:disabled { opacity: .35; cursor: default; }
.cart-qty-num { font-size: .95rem; font-weight: 600; min-width: 20px; text-align: center; }
.cart-remove-btn {
  background: none; border: none; cursor: pointer;
  color: var(--error, #ef4444); padding: .25rem; flex-shrink: 0;
}
.cart-footer {
  padding: 1rem;
  background: var(--surface);
  border-top: 1px solid var(--divider);
  position: sticky; bottom: 0;
}
.cart-subtotal { display: flex; justify-content: space-between; align-items: center; font-size: .95rem; }
.cart-total-val { font-size: 1.1rem; font-weight: 700; color: var(--primary); }

/* ── Checkout ─────────────────────────────────────────────────────────────── */
.checkout-wrap { padding: 1rem; padding-bottom: 4rem; max-width: 520px; margin: auto; }
.checkout-steps {
  display: flex; align-items: center; margin-bottom: 1.5rem; gap: 0;
}
.checkout-step { display: flex; flex-direction: column; align-items: center; flex: 1; }
.step-circle {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700; color: var(--text3);
  background: var(--surface2);
  transition: all .2s;
}
.checkout-step.active .step-circle { border-color: var(--primary); background: var(--primary); color: #fff; }
.checkout-step.done   .step-circle { border-color: var(--success,#10b981); background: var(--success,#10b981); color: #fff; }
.step-label { font-size: .72rem; margin-top: .3rem; color: var(--text3); }
.checkout-step.active .step-label { color: var(--primary); font-weight: 600; }
.step-line { flex: 1; height: 2px; background: var(--border); margin: 0 4px; margin-bottom: 18px; }
.checkout-section-title { font-size: .85rem; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .75rem; }
.checkout-field { margin-bottom: .75rem; }
.checkout-label { font-size: .82rem; color: var(--text2); display: block; margin-bottom: .3rem; }
.checkout-input {
  width: 100%; box-sizing: border-box;
  border: 1.5px solid var(--border); border-radius: 10px;
  padding: .6rem .85rem; font-size: .95rem;
  background: var(--surface2); color: var(--text);
  outline: none; transition: border-color .15s;
}
.checkout-input:focus { border-color: var(--primary); }
.shipping-list { display: flex; flex-direction: column; gap: .6rem; }
.shipping-option {
  display: flex; align-items: center; gap: .75rem;
  border: 1.5px solid var(--border); border-radius: 12px; padding: .75rem 1rem;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.shipping-option input { display: none; }
.shipping-option.selected { border-color: var(--primary); background: var(--primary-light, #e8f4f8); }
.shipping-info { flex: 1; }
.shipping-name { font-size: .9rem; font-weight: 600; }
.shipping-eta  { font-size: .78rem; color: var(--text3); }
.shipping-price { font-size: .9rem; font-weight: 700; color: var(--primary); }
.payment-methods { display: flex; flex-direction: column; gap: .6rem; }
.payment-opt {
  display: flex; align-items: center; gap: .75rem;
  border: 1.5px solid var(--border); border-radius: 12px; padding: .75rem 1rem;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.payment-opt input { display: none; }
.payment-opt.selected { border-color: var(--primary); background: var(--primary-light, #e8f4f8); }
.order-confirm { padding: 3rem 1.5rem; text-align: center; }
.order-confirm-icon { margin-bottom: 1rem; }
.order-confirm-title { font-size: 1.5rem; font-weight: 800; margin: 0 0 .5rem; }
.order-confirm-sub { color: var(--text2); font-size: .95rem; }

/* ── Orders ──────────────────────────────────────────────────────────────── */
.orders-list { padding: .75rem; }
.order-card {
  background: var(--surface); border-radius: 14px;
  padding: .85rem 1rem; margin-bottom: .85rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06); cursor: pointer;
}
.order-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: .5rem; }
.order-number { font-size: .9rem; font-weight: 700; }
.order-date   { font-size: .78rem; color: var(--text3); margin-top: .1rem; }
.order-status-badge { font-size: .75rem; font-weight: 700; padding: .2rem .6rem; border-radius: 20px; }
.order-thumbs { display: flex; gap: .4rem; margin: .5rem 0; align-items: center; }
.order-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.order-thumb-more { font-size: .78rem; color: var(--text3); }
.order-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: .4rem; }
.order-total { font-size: 1rem; font-weight: 700; color: var(--primary); }
.order-detail-section { padding: .75rem 0; border-bottom: 1px solid var(--divider); }
.order-detail-section:last-child { border-bottom: none; }
.order-detail-title { font-size: .82rem; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .5rem; }
.order-item-row { display: flex; align-items: center; gap: .75rem; padding: .4rem 0; }
.order-item-img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; }
.order-item-info { flex: 1; }
.order-timeline { display: flex; flex-direction: column; gap: .75rem; padding-left: .5rem; }
.order-timeline-item { display: flex; gap: .75rem; align-items: flex-start; }
.timeline-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary); flex-shrink: 0; margin-top: .25rem;
}

/* ── Games ───────────────────────────────────────────────────────────────── */
.games-cat-bar {
  display: flex;
  overflow-x: auto;
  gap: .4rem;
  padding: .6rem .75rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 56px;
  z-index: 10;
  scrollbar-width: none;
  min-height: 44px;
  align-items: center;
}
.games-cat-bar::-webkit-scrollbar { display: none; }
.games-cat-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .75rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  font-size: .78rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.games-cat-btn:hover  { background: var(--hover, rgba(0,0,0,.06)); color: var(--text1); }
.games-cat-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.game-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  transition: transform .18s, box-shadow .18s;
  overflow: hidden;
}
.game-card:hover  { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.16); }
.game-card:active { transform: scale(.97); box-shadow: none; }

/* Thumbnail — aspect-ratio 3:2, edge-to-edge */
.game-card-thumb {
  width: 100%; aspect-ratio: 3/2;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.game-card-img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Botão play no hover */
.game-card-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.42);
  opacity: 0; transition: opacity .18s;
}
.game-card-play .ms-icon { font-size: 3rem; color: #fff; filter: drop-shadow(0 2px 8px rgba(0,0,0,.6)); }
.game-card:hover .game-card-play { opacity: 1; }

/* Área de texto abaixo da imagem */
.game-card-info  { padding: .6rem .7rem .65rem; }
.game-card-title { font-size: .85rem; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: .25rem; }
.game-card-views { font-size: .7rem; color: var(--text3); display: flex; align-items: center; gap: .2rem; }
.game-card-views .ms-icon { font-size: .75rem; }

/* Badge de idioma no canto do card */
.game-card-lang {
  position: absolute; top: .35rem; right: .35rem;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: .62rem; font-weight: 700; letter-spacing: .03em;
  padding: .1rem .35rem; border-radius: 4px; pointer-events: none;
  backdrop-filter: blur(4px);
}

/* Overlay de descrição no hover */
.game-card-desc-ov {
  position: absolute; inset: 0;
  background: linear-gradient(transparent 20%, rgba(0,0,0,.88) 65%);
  color: #fff; font-size: .72rem; line-height: 1.4;
  padding: 1.5rem .6rem .55rem;
  display: flex; align-items: flex-end;
  opacity: 0; transition: opacity .22s;
  pointer-events: none; overflow: hidden;
}
.game-card:hover .game-card-desc-ov { opacity: 1; }

/* ── Top Visualizações ───────────────────────────────────────────────────── */
.games-top-scroll {
  display: flex; gap: .6rem; overflow-x: auto;
  padding: .3rem .75rem .75rem; scrollbar-width: none;
}
.games-top-scroll::-webkit-scrollbar { display: none; }

.games-top-card {
  flex-shrink: 0; display: flex; align-items: center; gap: .5rem;
  background: var(--surface); border-radius: 10px;
  padding: .45rem .65rem .45rem .4rem;
  cursor: pointer; min-width: 160px; max-width: 200px;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
  transition: transform .15s, box-shadow .15s;
}
.games-top-card:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.14); }
.games-top-card:active { transform: scale(.97); }

.games-top-rank {
  font-size: 1.15rem; font-weight: 900; color: var(--primary);
  min-width: 22px; text-align: center; line-height: 1; flex-shrink: 0;
}
.games-top-thumb {
  width: 44px; height: 44px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.games-top-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.games-top-info { flex: 1; min-width: 0; }
.games-top-title {
  font-size: .78rem; font-weight: 700; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: .15rem;
}

/* ── Paginação de games ──────────────────────────────────────────────────── */
.games-pg-btn {
  min-width: 32px; height: 32px; padding: 0 .4rem;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text2);
  font-size: .82rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s, border-color .15s;
}
.games-pg-btn:hover:not(:disabled):not(.active) { background: var(--hover, rgba(0,0,0,.06)); }
.games-pg-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.games-pg-btn:disabled { opacity: .35; cursor: default; }
.games-pg-btn .ms-icon { font-size: 1rem; }

/* ── Overlay tabs (Play | Comentários) ───────────────────────────────────── */
.game-ov-tabs {
  display: flex; background: #1a1a1a; border-bottom: 1px solid rgba(255,255,255,.1); flex-shrink: 0;
}
.game-ov-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .6rem .5rem; color: rgba(255,255,255,.55); background: none; border: none;
  font-size: .82rem; font-weight: 600; cursor: pointer;
  border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
}
.game-ov-tab.active { color: #fff; border-bottom-color: var(--primary); }
.game-ov-tab:hover:not(.active) { color: rgba(255,255,255,.8); }

.game-ov-badge {
  background: var(--primary); color: #fff;
  font-size: .65rem; font-weight: 700; line-height: 1;
  padding: .15rem .35rem; border-radius: 99px;
}

/* ── OTP login ───────────────────────────────────────────────────────────── */
.login-divider-thin { text-align: center; font-size: .82rem; color: var(--text3); margin: .75rem 0; position: relative; }
.login-divider-thin::before,
.login-divider-thin::after { content: ''; position: absolute; top: 50%; width: 42%; height: 1px; background: var(--divider); }
.login-divider-thin::before { left: 0; }
.login-divider-thin::after  { right: 0; }
.otp-ddi-select {
  border: 1.5px solid var(--border); border-radius: 10px;
  padding: .6rem .5rem; background: var(--surface2); color: var(--text);
  font-size: .9rem; outline: none;
}
.otp-digits { display: flex; gap: .5rem; justify-content: center; margin: .75rem 0; }
.otp-digit {
  width: 44px; height: 52px; text-align: center; font-size: 1.4rem; font-weight: 700;
  border: 2px solid var(--border); border-radius: 10px;
  background: var(--surface2); color: var(--text); outline: none;
  transition: border-color .15s;
}
.otp-digit:focus { border-color: var(--primary); }

/* ── Product detail ──────────────────────────────────────────────────────── */
.product-gallery { position: relative; background: var(--surface2); }
.product-gallery-main img { width: 100%; max-height: 320px; object-fit: contain; }
.product-thumbs { display: flex; gap: .4rem; padding: .5rem .75rem; overflow-x: auto; }
.product-thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex-shrink: 0; cursor: pointer; border: 2px solid transparent; }
.product-thumb.active { border-color: var(--primary); }
.product-info { padding: 1rem; }
.product-title { font-size: 1.1rem; font-weight: 800; margin: 0 0 .3rem; }
.product-price { font-size: 1.3rem; font-weight: 700; color: var(--primary); margin-bottom: .75rem; }
.product-options { margin-bottom: 1rem; }
.product-options-label { font-size: .82rem; color: var(--text3); margin-bottom: .4rem; }
.option-pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.option-pill {
  border: 1.5px solid var(--border); border-radius: 20px; padding: .3rem .8rem;
  font-size: .85rem; cursor: pointer; background: var(--surface2);
  transition: all .15s;
}
.option-pill.selected { border-color: var(--primary); background: var(--primary); color: #fff; }
.qty-stepper { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.qty-btn { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--surface2); cursor: pointer; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; }
.qty-num { font-size: 1rem; font-weight: 700; min-width: 28px; text-align: center; }

/* ── Gerenciador de módulos (Settings) ───────────────────────────────────── */
.settings-hint {
  font-size: .82rem; color: var(--text3);
  margin: -.25rem 0 .75rem; line-height: 1.5;
}
.mod-group { margin-bottom: 1rem; }
.mod-group-label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text3);
  padding: .3rem 0 .4rem; border-bottom: 1px solid var(--divider);
  margin-bottom: .25rem;
}
.mod-row {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--divider);
}
.mod-row:last-child { border-bottom: none; }
.mod-row-icon {
  font-size: 1.15rem; color: var(--text3); flex-shrink: 0;
  font-family: 'Material Symbols Rounded';
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  line-height: 1;
}
.mod-row-label { flex: 1; font-size: .9rem; }
.mod-row-disabled { opacity: .45; }
.mod-server-off {
  font-size: .72rem; color: var(--text3);
  background: var(--surface3); border-radius: 6px;
  padding: .15rem .45rem; white-space: nowrap;
}

.ai-modal-footer {
  display: flex; justify-content: flex-end; gap: .5rem;
  padding: .75rem 1.25rem 1rem;
  border-top: 1px solid var(--divider);
}
.xve-play-icon:hover { background: rgba(0,0,0,.65); }

/* Export progress */
.xve-export-progress {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.7); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
}
.xve-export-text {
  color: #fff; font-size: 1.1rem; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
}

/* Timeline / trim */
.xve-timeline-wrap {
  background: #0a0a0a; padding: .5rem .75rem .4rem;
  flex-shrink: 0;
}
.xve-time-labels {
  display: flex; justify-content: space-between;
  font-size: .75rem; color: #888; margin-bottom: .25rem;
}
.xve-timeline {
  position: relative; height: 28px;
}
.xve-timeline-range {
  position: absolute; top: 10px; height: 8px;
  background: var(--primary); border-radius: 4px;
  pointer-events: none;
  --playhead: 0%;
}
/* Playhead indicator */
.xve-timeline-range::after {
  content: '';
  position: absolute; top: -3px; left: var(--playhead);
  width: 3px; height: 14px; background: #fff; border-radius: 2px;
  transform: translateX(-50%);
  transition: left .1s linear;
}
/* Base track behind sliders */
.xve-timeline::before {
  content: ''; position: absolute; top: 10px; left: 0; right: 0;
  height: 8px; background: #2a2a2a; border-radius: 4px;
}
.xve-slider {
  position: absolute; top: 0; left: 0; right: 0; width: 100%;
  -webkit-appearance: none; appearance: none;
  height: 28px; background: transparent;
  pointer-events: none;
}
.xve-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 28px; border-radius: 4px;
  background: #fff; cursor: pointer;
  pointer-events: all;
  box-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.xve-slider::-moz-range-thumb {
  width: 18px; height: 28px; border-radius: 4px;
  background: #fff; cursor: pointer;
  pointer-events: all; border: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.xve-slider-end { z-index: 2; }

.xve-trim-labels {
  display: flex; justify-content: space-between;
  font-size: .72rem; color: #666; margin-top: .3rem;
}
.xve-trim-labels b { color: #aaa; }

/* Filter controls (videos share xie-presets) */
.xve-controls { overflow-x: auto; overflow-y: hidden; }
.xve-controls.xie-texto-mode { overflow-y: auto; overflow-x: hidden; max-height: 380px; }
.xve-presets  { flex-wrap: nowrap; padding: .5rem .75rem; }

/* Loading thumbs */
.xve-thumbs-loading {
  display: flex; align-items: center; justify-content: center;
  gap: .75rem; padding: 1.5rem;
  color: #777; font-size: .88rem;
}

/* ── Editor: text & sticker overlay layers ───────────────────────── */
.xie-layer {
  position: absolute; inset: 0;
  pointer-events: none; overflow: hidden; z-index: 10;
}
.xie-item {
  position: absolute; pointer-events: auto;
  cursor: move; transform: translate(-50%, -50%);
  user-select: none; touch-action: none;
}
.xie-item.selected .xie-item-content {
  outline: 2px dashed var(--primary);
  border-radius: 4px;
}
.xie-item-del {
  position: absolute; top: -12px; right: -12px;
  background: #e53935; color: #fff; border: none;
  border-radius: 50%; width: 22px; height: 22px;
  font-size: 13px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; z-index: 1;
}
.xie-item-resize {
  position: absolute; bottom: -14px;
  background: rgba(0,0,0,.7); color: #fff; border: none;
  border-radius: 50%; width: 22px; height: 22px;
  font-size: 1rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; z-index: 1;
  padding: 0;
}
.xie-item-resize-minus { left: calc(50% - 26px); }
.xie-item-resize-plus  { left: calc(50% + 4px); }
.xie-api-sticker-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem;
  padding: .4rem .75rem; max-height: 200px; overflow-y: auto;
}
.xie-api-sticker-btn {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  padding: .25rem; cursor: pointer; aspect-ratio: 1; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.xie-api-sticker-btn img { width: 100%; height: 100%; object-fit: contain; }
.xie-api-sticker-btn:hover { background: var(--surface3); }
.xie-sticker-col-btn {
  flex-direction: column; gap: 4px; height: auto; padding: .4rem .2rem; aspect-ratio: unset;
}
.xie-sticker-col-btn img { width: 48px; height: 48px; }
.xie-sticker-col-btn span {
  font-size: .65rem; color: var(--text2); text-align: center; line-height: 1.2;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block;
}
.xie-text-panel, .xie-sticker-panel { padding: .25rem 0; }
.xie-text-templates {
  display: flex; gap: .4rem; padding: .4rem .75rem;
  overflow-x: auto;
}
.xie-text-templates::-webkit-scrollbar { display: none; }
.xie-tmpl-btn.active { outline: 2px solid var(--primary) !important; }
.xie-sticker-cats {
  display: flex; gap: .3rem; padding: .4rem .75rem; overflow-x: auto;
}
.xie-sticker-cats::-webkit-scrollbar { display: none; }
.xie-scat-btn {
  flex-shrink: 0; background: none;
  border: 1px solid #333; color: #aaa;
  padding: .25rem .6rem; border-radius: 20px; cursor: pointer; font-size: .95rem;
}
.xie-scat-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.xie-emoji-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: .15rem; padding: .4rem .75rem; max-height: 148px; overflow-y: auto;
}
.xie-emoji-btn {
  background: none; border: none; font-size: 1.55rem;
  cursor: pointer; padding: .15rem; border-radius: 6px; text-align: center; line-height: 1.2;
}
.xie-emoji-btn:hover { background: rgba(255,255,255,.1); }

/* Effects grid */
.xie-effects-grid {
  display: grid !important; flex-direction: unset !important;
  grid-template-columns: repeat(3, 1fr); gap: .4rem;
  padding: .4rem .75rem; max-height: 200px; overflow-y: auto;
  overflow-x: hidden !important;
}
.xie-effects-grid .xie-preset { min-width: unset; width: 100%; flex: unset; }
.xie-effects-grid .xie-preset img,
.xie-effects-grid .xie-effect-thumb-ph {
  width: 100%; height: 64px; object-fit: cover; border-radius: 6px;
  border: 2px solid transparent; background: #222; display: block;
}
.xie-effects-grid .xie-preset.active img,
.xie-effects-grid .xie-preset.active .xie-effect-thumb-ph { border-color: var(--primary); }

/* Story create — foto + vídeo */
.story-pick-row {
  display: flex; gap: .75rem; margin-bottom: .5rem;
}
.story-pick-btn {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: .4rem; cursor: pointer;
  padding: .65rem; background: var(--surface3);
  border-radius: var(--radius-sm); font-size: .9rem; color: var(--text);
  transition: background .2s;
}
.story-pick-btn:hover { background: var(--surface2); }
.story-pick-btn .ms-icon { font-size: 1.2rem; color: var(--primary); }

/* Story destination selector */
.story-dest-label {
  font-size: .82rem; color: var(--text3); font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
}
.story-dest-row {
  display: flex; gap: .5rem;
}
.story-dest-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: .3rem;
  padding: .55rem .4rem; border-radius: var(--radius-sm);
  background: var(--surface3); border: 1.5px solid transparent;
  font-size: .82rem; color: var(--text2); cursor: pointer; transition: all .18s;
}
.story-dest-btn.active {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  border-color: var(--primary); color: var(--primary); font-weight: 600;
}
.story-dest-btn:not(.active):hover { background: var(--surface2); }

/* ── Reactions panel ─────────────────────────────────────────────────────── */
.reaction-wrap { position: relative; flex: 1; }
.reaction-panel {
  position: absolute; bottom: calc(100% + 6px); left: 0;
  display: flex; gap: .25rem;
  background: var(--surface); border: 1px solid var(--divider);
  border-radius: 999px; padding: .3rem .45rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  opacity: 0; pointer-events: none;
  transform: scale(.75) translateY(8px);
  transition: opacity .18s, transform .18s;
  z-index: 200; white-space: nowrap;
}
.reaction-panel.open {
  opacity: 1; pointer-events: all;
  transform: scale(1) translateY(0);
}
.reaction-opt {
  font-size: 1.5rem; background: none; border: none; cursor: pointer;
  padding: .15rem .2rem; border-radius: 50%;
  transition: transform .12s;
  line-height: 1;
}
.reaction-opt:hover, .reaction-opt.active { transform: scale(1.4); }
.reaction-icon { font-size: 1rem; line-height: 1; }
.like-btn.liked .reaction-icon { filter: none; }

/* ── Pinned post ─────────────────────────────────────────────────────────── */
.post-pinned { border-left: 3px solid var(--primary); }
.pin-badge {
  font-size: .75rem; color: var(--primary); font-weight: 600;
  padding: .3rem .75rem .1rem; display: flex; align-items: center;
}

/* ── Post author line ────────────────────────────────────────────────────── */
.post-author-line { display: flex; align-items: center; flex-wrap: wrap; gap: .2rem; }
.post-action-sub  { font-size: .82rem; color: var(--text3); font-weight: 400; }

/* ── Feeling badge ───────────────────────────────────────────────────────── */
.feeling-badge { font-size: .85rem; color: var(--text2); }

/* ── Reactions: image icons ──────────────────────────────────────────────── */
.reaction-img-icon      { width: 24px; height: 24px; object-fit: contain; vertical-align: middle; }
.reaction-panel-icon    { width: 32px; height: 32px; object-fit: contain; }
.reaction-opt           { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.reaction-opt-label     { font-size: .6rem; color: #fff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.8); line-height: 1; }

/* ── Story view count bar ────────────────────────────────────────────────── */
.story-stats-bar {
  position: absolute; bottom: 3.5rem; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.5); color: #fff; padding: .35rem .9rem; border-radius: 20px;
  align-items: center; gap: .5rem; font-size: .85rem; white-space: nowrap;
}
.story-stat-item { display: inline-flex; align-items: center; gap: .2rem; }
.story-stat-item .ms-icon { font-size: .9rem; }
.story-stat-sep { opacity: .55; }
.story-stat-views { pointer-events: auto; }

/* ── Sticker grid picker ─────────────────────────────────────────────────── */
.sticker-opt:hover { outline: 2px solid var(--primary); outline-offset: 1px; }

/* ── Tag chips ───────────────────────────────────────────────────────────── */
.tag-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  background: var(--hover); border-radius: 20px; padding: .2rem .5rem .2rem .25rem;
  font-size: .8rem;
}
.tag-chip img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }

/* ── Post text with background ───────────────────────────────────────────── */
#post-text.has-bg {
  min-height: 140px; border-radius: 12px;
  font-size: 1.2rem; font-weight: 600; text-align: center;
  transition: background .2s, color .2s;
}

/* ── Post location ───────────────────────────────────────────────────────── */
.post-location {
  font-size: .8rem; color: var(--text3); padding: .1rem .75rem .4rem;
  display: flex; align-items: center;
}

/* ── Multi-photo grid ────────────────────────────────────────────────────── */
.post-photos-grid {
  display: grid; gap: 2px; overflow: hidden;
  border-radius: 0;
}
.post-photos-grid.grid-1 { grid-template-columns: 1fr; max-height: 400px; }
.post-photos-grid.grid-2 { grid-template-columns: 1fr 1fr; max-height: 260px; }
.post-photos-grid.grid-3 { grid-template-columns: 1fr 1fr; max-height: 260px; }
.post-photos-grid.grid-3 .photo-grid-item:first-child { grid-row: span 2; }
.post-photos-grid.grid-4 { grid-template-columns: 1fr 1fr; max-height: 260px; }
.photo-grid-item {
  position: relative; overflow: hidden; cursor: pointer; background: var(--surface3);
}
.photo-grid-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .2s;
}
.photo-grid-item:hover img { transform: scale(1.03); }
.photo-more-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 700;
}

/* ── Field label (video/link sheets) ────────────────────────────────────── */
.field-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: .3rem;
}

/* ── YouTube / Dailymotion embed in feed ────────────────────────────────── */
.post-yt-embed {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  margin: .5rem 0;
  background: #000;
}

/* ── Clickable URLs in post body ────────────────────────────────────────── */
.post-url-link {
  color: var(--primary);
  text-decoration: none;
  word-break: break-all;
}
.post-url-link:hover { text-decoration: underline; }

/* ── Video library attachment title (sitevideo_video_new) ───────────────── */
.post-video-info  { padding: .3rem .8rem .6rem; }
.post-video-title { font-size: .9rem; font-weight: 700; color: var(--text); display: block; line-height: 1.35; margin-bottom: .2rem; }
.post-video-title:hover { color: var(--primary); }
.post-video-desc  { font-size: .82rem; color: var(--text3); line-height: 1.45; margin: 0; }
.post-video-card  { position: relative; cursor: pointer; }
.post-video-play-btn {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.25);
}
.post-video-play-btn .ms-icon { font-size: 3.5rem; color: #fff; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }

/* ── Post video ──────────────────────────────────────────────────────────── */
.post-video { position: relative; cursor: pointer; background: #000; max-height: 360px; overflow: hidden; }
.post-video-thumb { width: 100%; max-height: 360px; object-fit: cover; display: block; }
.post-video-thumb-placeholder { width: 100%; height: 220px; background: #111; }
.post-video-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.video-fullscreen-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.95); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .22s;
}
.video-fullscreen-overlay.open { opacity: 1; }
.vfs-close {
  position: absolute; top: 1rem; right: 1rem;
  background: rgba(255,255,255,.15); border: none; border-radius: 50%;
  width: 2.5rem; height: 2.5rem; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.vfs-cast {
  position: absolute; top: 1rem; right: 4rem;
  background: rgba(255,255,255,.15); border: none; border-radius: 50%;
  width: 2.5rem; height: 2.5rem; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.vfs-cast:hover { background: rgba(255,255,255,.28); }
.vfs-cast.casting { background: rgba(77,162,197,.55); }
.vfs-cast.casting .ms-icon { color: #4da2c5; }
.vfs-cast .ms-icon { font-size: 1.3rem; }
.vfs-video { max-width: 100%; max-height: 85vh; border-radius: 8px; }

/* ── Post music player ───────────────────────────────────────────────────── */
.post-music-player {
  display: flex; align-items: center; gap: .75rem;
  margin: 0; padding: .75rem;
  background: var(--surface3); border-radius: var(--radius-sm);
}
.post-music-info { flex: 1; min-width: 0; }
.post-music-title { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-music-artist { font-size: .78rem; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-music-play {
  background: none; border: none; cursor: pointer;
  color: var(--primary); font-size: 2rem; flex-shrink: 0;
  display: flex; align-items: center;
}

/* ── Link preview card ───────────────────────────────────────────────────── */
.post-link-preview {
  border: 1px solid var(--divider); border-radius: var(--radius-sm);
  overflow: hidden; cursor: pointer;
  transition: background .15s;
}
.post-link-preview:hover { background: var(--surface3); }
.link-preview-image { width: 100%; max-height: 200px; object-fit: cover; display: block; }
.link-preview-body { padding: .6rem .75rem; }
.link-preview-url { font-size: .72rem; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; }
.link-preview-title { font-weight: 600; font-size: .88rem; margin: .2rem 0; }
.link-preview-desc { font-size: .8rem; color: var(--text2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Link preview card (composer) ───────────────────────────────────────── */
.link-preview-card {
  position: relative; border: 1px solid var(--divider); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--surface2);
}
.link-preview-video-wrap {
  position: relative; padding-bottom: 56.25%; background: #000;
}
.link-preview-thumb {
  width: 100%; max-height: 160px; object-fit: cover; display: block;
}
.link-preview-info { padding: .5rem .75rem; padding-right: 2.2rem; }
.link-preview-host { font-size: .7rem; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .15rem; }
.link-preview-title { font-weight: 600; font-size: .85rem; }
.link-preview-desc  { font-size: .78rem; color: var(--text2); margin-top: .1rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.link-preview-remove {
  position: absolute; top: .4rem; right: .4rem;
  background: rgba(0,0,0,.55); color: #fff; border: none; border-radius: 50%;
  width: 22px; height: 22px; font-size: .8rem; cursor: pointer; line-height: 22px; text-align: center;
}

/* ── Shared post card ────────────────────────────────────────────────────── */
.shared-post-card {
  border: 1px solid var(--divider); border-radius: var(--radius-sm);
  padding: .75rem; margin: 0; background: var(--surface3);
}
.shared-post-header { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.shared-post-body { font-size: .88rem; margin-bottom: .4rem; color: var(--text); word-break: break-word; }
.shared-post-image { width: 100%; max-height: 240px; object-fit: cover; border-radius: 4px; }

/* ── Embedded post stub (async loaded shared post) ──────────────────────── */
.post-embedded-stub {
  display: flex; align-items: center; gap: .5rem; padding: .65rem .75rem;
  border: 1px dashed var(--divider); border-radius: var(--radius-sm);
  background: var(--surface3); cursor: pointer; color: var(--text3);
  margin: 0;
}
.post-embedded-stub:hover { background: var(--surface2); }

/* ── Post likes bar ──────────────────────────────────────────────────────── */
.post-likes-bar {
  padding: .25rem .75rem .4rem; font-size: .8rem; color: var(--text3);
  cursor: pointer; border-top: 1px solid var(--divider);
}
.post-likes-bar:hover { color: var(--primary); }

/* ── Hashtag link ────────────────────────────────────────────────────────── */
.post-hashtag { color: var(--primary); text-decoration: none; font-weight: 500; }
.post-hashtag:hover { text-decoration: underline; }

/* ── People suggestions card ─────────────────────────────────────────────── */
.people-suggestion-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 1rem; margin-bottom: .75rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
.people-suggestion-title {
  font-weight: 700; font-size: .9rem; color: var(--text2);
  margin-bottom: .75rem;
}
.people-suggestion-list { display: flex; flex-direction: column; gap: .6rem; }
.people-suggestion-item {
  display: flex; align-items: center; gap: .6rem; cursor: pointer;
  padding: .25rem 0;
}
.people-suggestion-item:hover { background: transparent; }
.people-suggestion-name { flex: 1; font-size: .88rem; font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Feeling picker option ───────────────────────────────────────────────── */
.feeling-option {
  display: flex; flex-direction: column; align-items: center;
  gap: .2rem; padding: .5rem .25rem; border: none;
  background: var(--surface3); border-radius: var(--radius-sm);
  cursor: pointer; font-size: .78rem; color: var(--text);
  transition: background .15s;
}
.feeling-option:hover { background: var(--surface2); }

/* ── Detail page layout ──────────────────────────────────────────────────── */
.detail-page { padding-bottom: var(--bottomnav-h); }
.detail-cover-img {
  width: 100%; max-height: 280px; object-fit: cover; display: block;
}
.detail-content { padding: .85rem .75rem; }
.detail-main-title { font-size: 1.25rem; font-weight: 800; margin: 0 0 .5rem; line-height: 1.3; }
.detail-byline {
  display: flex; align-items: center; flex-wrap: wrap; gap: .35rem;
  font-size: .85rem; color: var(--text2); margin-bottom: .75rem;
}
.detail-body-text {
  font-size: .95rem; line-height: 1.75; color: var(--text1);
  margin-bottom: 1rem; word-break: break-word;
}
/* Rich HTML content inside blog body */
.detail-body-text p  { margin: .75em 0; }
.detail-body-text h1,.detail-body-text h2,.detail-body-text h3,
.detail-body-text h4,.detail-body-text h5,.detail-body-text h6 {
  font-weight: 700; line-height: 1.3; margin: 1.1em 0 .4em; color: var(--text);
}
.detail-body-text h1 { font-size: 1.5rem; }
.detail-body-text h2 { font-size: 1.25rem; }
.detail-body-text h3 { font-size: 1.1rem; }
.detail-body-text ul,.detail-body-text ol { padding-left: 1.5rem; margin: .6em 0; }
.detail-body-text li { margin: .3em 0; }
.detail-body-text a  { color: var(--primary); text-decoration: underline; word-break: break-all; }
.detail-body-text img { max-width: 100%; border-radius: 8px; margin: .5em 0; display: block; }
.detail-body-text blockquote {
  border-left: 3px solid var(--primary); margin: .75em 0; padding: .5em 1em;
  background: var(--surface2); border-radius: 0 6px 6px 0; color: var(--text2); font-style: italic;
}
.detail-body-text pre,.detail-body-text code {
  background: var(--surface2); border-radius: 6px; font-family: monospace; font-size: .88rem;
}
.detail-body-text pre { padding: .75rem 1rem; overflow-x: auto; margin: .5em 0; }
.detail-body-text code { padding: .1em .4em; }
.detail-body-text strong,.detail-body-text b { font-weight: 700; color: var(--text); }
.detail-body-text em,.detail-body-text i { font-style: italic; }
.detail-body-text hr { border: none; border-top: 1px solid var(--divider); margin: 1em 0; }
.detail-body-text table { width: 100%; border-collapse: collapse; margin: .75em 0; font-size: .88rem; }
.detail-body-text th,.detail-body-text td { border: 1px solid var(--divider); padding: .4em .6em; text-align: left; }
.detail-body-text th { background: var(--surface2); font-weight: 600; }
.detail-actions-bar {
  display: flex; gap: .6rem; margin-bottom: 1rem;
  flex-wrap: wrap;
}
.detail-section-title {
  font-size: .85rem; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: .05em;
  margin: .75rem 0 .5rem; padding-bottom: .3rem;
  border-bottom: 1px solid var(--divider);
}
.detail-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: .75rem 0; }
.detail-tag {
  background: var(--surface3); border-radius: 20px;
  padding: .25rem .65rem; font-size: .78rem; color: var(--primary);
}

/* detail header (groups, etc.) */
.detail-cover {
  width: 100%; height: 180px; background: var(--surface3);
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  background-size: cover; background-position: center;
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-header {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: 0 .75rem .75rem;
  background: var(--surface);
  position: relative; z-index: 1;
}
.detail-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  object-fit: cover; border: 3px solid var(--surface);
  box-shadow: 0 2px 8px rgba(0,0,0,.15); flex-shrink: 0;
}
.detail-header-info { flex: 1; padding-top: .35rem; padding-bottom: .25rem; }
.detail-title { font-size: 1.1rem; font-weight: 800; margin: 0 0 .15rem; }
.detail-meta { font-size: .8rem; color: var(--text3); }
/* Group photo edit overlays */
.grp-edit-cover {
  position: absolute; bottom: .5rem; right: .5rem; z-index: 2;
  background: rgba(0,0,0,.55); border-radius: 50%;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #fff;
}
.grp-edit-cover:hover { background: rgba(0,0,0,.75); }
/* Avatar wrap is the flex child — pull it up so avatar overlaps the cover */
.detail-avatar-edit-wrap { position: relative; flex-shrink: 0; margin-top: -2rem; }
.grp-edit-avatar {
  position: absolute; bottom: 0; right: -2px; z-index: 2;
  background: var(--primary); border-radius: 50%;
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #fff;
}
.grp-edit-avatar i { font-size: .75rem; }

.detail-actions {
  display: flex; gap: .6rem; padding: .5rem .75rem .75rem;
  border-bottom: 1px solid var(--divider); flex-wrap: wrap;
}
.detail-body { padding: .75rem; font-size: .9rem; line-height: 1.6; color: var(--text2); }
.detail-tabs {
  display: flex; border-bottom: 2px solid var(--divider);
  padding: 0 .5rem; gap: .25rem;
}
.detail-tab {
  flex: 1; background: none; border: none; cursor: pointer;
  padding: .65rem .5rem; font-size: .9rem; font-weight: 600;
  color: var(--text3); border-bottom: 2.5px solid transparent;
  margin-bottom: -2px; transition: color .15s, border-color .15s;
}
.detail-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Group detail extras ──────────────────────────────────────────────────── */
.group-privacy-badge {
  display: inline-block; padding: .1rem .5rem; border-radius: 20px;
  font-size: .72rem; font-weight: 700; letter-spacing: .03em;
}
.group-privacy-badge.public  { background: rgba(0,163,255,.15);  color: var(--primary); }
.group-privacy-badge.closed  { background: rgba(255,180,0,.15);   color: #d4960a; }
.group-privacy-badge.secret  { background: rgba(220,50,50,.12);   color: var(--error); }
.group-owner-row {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem .75rem .5rem; cursor: pointer;
}
.group-owner-row:active { background: var(--hover); }
.group-info-block {
  display: flex; flex-direction: column; gap: .5rem;
  padding: .25rem 0;
}
.group-info-row {
  display: flex; align-items: flex-start; gap: .6rem;
  font-size: .875rem; color: var(--text2); line-height: 1.4;
}
.group-info-row i { font-size: 1rem; color: var(--text3); flex-shrink: 0; margin-top: .05rem; }
.group-info-row a { color: var(--primary); }

/* ── Video detail ────────────────────────────────────────────────────────── */
.video-detail-player { background: #000; }

/* ── Create Album photo picker ───────────────────────────────────────────── */
.album-create-photo-pick {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .4rem; padding: 1.1rem;
  border: 1.5px dashed var(--divider); border-radius: .75rem;
  cursor: pointer; color: var(--text2);
  transition: border-color .15s, background .15s;
}
.album-create-photo-pick:hover { border-color: var(--primary); background: var(--surface2); }
.album-create-photo-thumbs {
  display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem;
}
.album-create-thumb {
  width: 64px; height: 64px; border-radius: .4rem;
  object-fit: cover; border: 1px solid var(--divider);
}
.album-create-thumb-more {
  display: flex; align-items: center; justify-content: center;
  background: var(--surface3); color: var(--text2);
  font-size: .8rem; font-weight: 600;
}

/* ── Album detail hero ───────────────────────────────────────────────────── */
.album-hero { position:relative; width:100%; background:var(--surface3); }
.album-hero-img { width:100%; height:240px; object-fit:cover; display:block; }
.album-hero-no-cover { width:100%; height:140px; background:var(--surface3); display:flex; align-items:center; justify-content:center; }
.album-hero-no-cover i { font-size:3rem; color:var(--text3); }
.album-hero-gradient { position:absolute; inset:0; background:linear-gradient(to bottom, rgba(0,0,0,.45) 0%, transparent 38%, rgba(0,0,0,.65) 100%); pointer-events:none; }
.album-hero-bar { position:absolute; top:0; left:0; right:0; display:flex; align-items:center; justify-content:space-between; padding:.55rem .75rem; z-index:2; }
.album-hero-icon-btn { width:36px; height:36px; border-radius:50%; background:rgba(0,0,0,.42); border:none; color:#fff; font-size:1.05rem; display:flex; align-items:center; justify-content:center; cursor:pointer; }
.album-hero-title { position:absolute; bottom:0; left:0; right:0; padding:.6rem 1rem .75rem; color:#fff; font-size:1.1rem; font-weight:700; z-index:2; line-height:1.3; text-shadow:0 1px 3px rgba(0,0,0,.5); }
.album-detail-meta { display:flex; align-items:center; gap:.75rem; padding:.8rem 1rem; border-bottom:1px solid var(--divider); }
.album-detail-avatar { width:42px; height:42px; border-radius:50%; object-fit:cover; flex-shrink:0; border:2px solid var(--divider); }
.album-detail-info { flex:1; min-width:0; }
.album-detail-owner-name { font-size:.9rem; font-weight:600; color:var(--text1); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.album-detail-sub { font-size:.76rem; color:var(--text3); margin-top:.15rem; }
.album-action-bar { display:flex; border-bottom:1px solid var(--divider); }
.album-action-btn { flex:1; display:flex; align-items:center; justify-content:center; gap:.35rem; padding:.65rem .4rem; background:none; border:none; color:var(--text2); font-size:.82rem; cursor:pointer; }
.album-action-btn:active { background:var(--surface2); }
.album-action-btn.album-liked { color:var(--primary); }
.album-desc { padding:.7rem 1rem; font-size:.86rem; color:var(--text2); border-bottom:1px solid var(--divider); line-height:1.5; }

/* ── Album grid & lightbox ───────────────────────────────────────────────── */
.album-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}
.album-photo-item {
  aspect-ratio: 1; overflow: hidden; cursor: pointer;
  background: var(--surface3); border-radius: 4px;
  position: relative;
}
.album-photo-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .2s;
  display: block;
}
.album-photo-item:hover img { transform: scale(1.06); }
/* Fotos tab — masonry layout (proporção natural) */
.photo-masonry {
  columns: 2;
  column-gap: 4px;
  padding: 4px;
}
.photo-masonry-item {
  break-inside: avoid;
  margin-bottom: 4px;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface3);
  display: block;
}
.photo-masonry-item img {
  width: 100%; height: auto;
  display: block;
  transition: transform .2s;
}
.photo-masonry-item:hover img { transform: scale(1.03); }
.album-lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.95);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
}
.album-lightbox img {
  max-width: 100vw; max-height: 85vh; object-fit: contain; border-radius: 4px;
  display: block;
}
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.15); border: none; border-radius: 50%;
  width: 44px; height: 44px; font-size: 1.6rem; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 10; transition: background .15s;
}
.lb-nav:hover { background: rgba(255,255,255,.3); }
.lb-prev { left: .75rem; }
.lb-next { right: .75rem; }
.lb-actions {
  position: absolute; top: .75rem; right: .75rem;
  display: flex; gap: .5rem;
}
.lb-close-btn, .lb-delete-btn {
  background: rgba(255,255,255,.15); border: none; border-radius: 8px;
  padding: .4rem .75rem; color: #fff; cursor: pointer; font-size: .9rem;
  transition: background .15s;
}
.lb-close-btn:hover { background: rgba(255,255,255,.3); }
.lb-delete-btn { color: #ff6b6b; }
.lb-delete-btn:hover { background: rgba(255,100,100,.3); }
.lb-toolbar {
  position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%);
  display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; justify-content: center;
}
.lb-tool-btn {
  background: rgba(255,255,255,.18); border: none; border-radius: 8px;
  padding: .35rem .7rem; color: #fff; cursor: pointer; font-size: .82rem;
  transition: background .15s; white-space: nowrap;
}
.lb-tool-btn:hover { background: rgba(255,255,255,.32); }
/* Album card menu button */
.card-menu-btn {
  position: absolute; top: .4rem; right: .4rem; z-index: 2;
  background: rgba(0,0,0,.5); color: #fff; border: none; border-radius: 50%;
  width: 30px; height: 30px; font-size: 1.1rem; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  padding: 0;
}
/* Action sheet overlay */
.action-sheet-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 500;
}
.action-sheet { padding-bottom: env(safe-area-inset-bottom, 0); }
.sheet-item {
  display: flex; align-items: center; gap: .75rem;
  width: 100%; background: none; border: none;
  padding: .85rem 1.25rem; font-size: 1rem; color: var(--text);
  cursor: pointer; text-align: left; border-bottom: 1px solid var(--divider);
}
.sheet-item:hover { background: var(--hover, var(--surface3)); }
.sheet-item i { font-size: 1.1rem; color: var(--text2); }
.sheet-item-danger { color: var(--error, #e63946); }
.sheet-item-danger i { color: var(--error, #e63946); }
/* ── Lightbox social/full-screen extensions ──────────────────────────────── */
.lb-full {
  flex-direction: column;
  justify-content: center;
}
.lb-top-bar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: .5rem .75rem; background: linear-gradient(to bottom, rgba(0,0,0,.7), transparent);
  z-index: 20;
}
.lb-top-title {
  flex: 1; text-align: center; color: #fff;
  font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 .5rem;
}
.lb-top-btn {
  background: rgba(255,255,255,.12); border: none; border-radius: 8px;
  width: 36px; height: 36px; color: #fff; font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s; flex-shrink: 0;
}
.lb-top-btn:hover { background: rgba(255,255,255,.28); }
.lb-top-btn i { font-size: 1rem; }
.lb-caption {
  position: absolute; bottom: 64px; left: 0; right: 0;
  text-align: center; color: rgba(255,255,255,.85); font-size: .88rem;
  padding: .4rem 1rem; pointer-events: none;
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
}
.lb-social-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-around;
  background: rgba(0,0,0,.55); backdrop-filter: blur(6px);
  padding: .55rem .5rem calc(.55rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255,255,255,.08); z-index: 20;
}
.lb-social-btn {
  background: none; border: none; color: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: .2rem;
  font-size: .78rem; padding: .25rem .6rem; border-radius: 8px;
  transition: background .15s; min-width: 56px;
}
.lb-social-btn:hover { background: rgba(255,255,255,.12); }
.lb-social-btn i { font-size: 1.2rem; }
.lb-social-btn.lb-liked { color: var(--primary, #3b82f6); }
.lb-social-spinner {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: .6rem 0;
}
.album-thumbs { display: flex; gap: .4rem; overflow-x: auto; padding: .4rem 0; }
.classified-thumb {
  width: 54px; height: 54px; border-radius: 8px; object-fit: cover;
  cursor: pointer; border: 2px solid transparent; flex-shrink: 0;
  transition: border-color .15s;
}
.classified-thumb.active { border-color: var(--primary); }

/* ── Classified detail ───────────────────────────────────────────────────── */
.classified-price-display {
  font-size: 1.5rem; font-weight: 800; color: var(--primary);
  margin-bottom: .5rem;
}
.classified-photos { margin-bottom: .75rem; }
.classified-thumbs {
  display: flex; gap: .4rem; overflow-x: auto; padding-top: .4rem;
}
.classified-meta-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.classified-contact-section { margin-top: 1rem; }
.classified-contact-btns { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .5rem; }
.classified-contact-btns a { text-decoration: none; display: inline-flex; align-items: center; gap: .35rem; }

/* ── Crowdfunding detail ─────────────────────────────────────────────────── */
.fund-detail-progress { margin: .75rem 0; }
.fund-bar-lg { height: 12px; border-radius: 99px; background: var(--surface3); overflow: hidden; }
.fund-bar-lg .fund-bar-fill { height: 100%; background: var(--primary); border-radius: 99px; transition: width .4s; }
.fund-detail-stats {
  display: flex; justify-content: space-between;
  margin: .5rem 0; gap: .5rem;
}
.fund-detail-stat { display: flex; flex-direction: column; font-size: .85rem; }
.fund-detail-stat strong { font-size: 1.1rem; font-weight: 800; color: var(--primary); }
.fund-detail-stat span { color: var(--text3); font-size: .78rem; }
.fund-detail-pct { align-items: center; }
.fund-detail-meta {
  display: flex; flex-wrap: wrap; gap: .75rem;
  font-size: .82rem; color: var(--text3); margin-top: .4rem;
}
.pledge-amounts { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .25rem; }
.pledge-preset {
  border: 1.5px solid var(--border); border-radius: 20px;
  padding: .4rem .85rem; background: var(--surface2); color: var(--text);
  font-size: .9rem; cursor: pointer; transition: all .15s;
}
.pledge-preset:hover { border-color: var(--primary); background: var(--primary-light); }
.pledge-preset.active { border-color: var(--primary); background: var(--primary); color: #fff; }

/* ── Forum replies ───────────────────────────────────────────────────────── */
.forum-reply .comment-bubble { background: var(--surface3); }
.forum-body { padding: .5rem 0; line-height: 1.6; }
.forum-section-stats { font-size: .72rem; color: var(--text3); margin-top: .2rem; }
.forum-topic-actions {
  display: flex; gap: .5rem; padding: .6rem .75rem .25rem;
  border-top: 1px solid var(--border); margin-top: .5rem;
}
.forum-reply-actions {
  display: flex; gap: .5rem; margin-top: .45rem;
}
.btn-link-sm {
  display: inline-flex; align-items: center; gap: .3rem;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  border-radius: 999px; padding: .22rem .7rem;
  font-size: .72rem; font-weight: 600; cursor: pointer;
  transition: background .15s, opacity .15s;
  white-space: nowrap;
}
.btn-link-sm:hover { background: color-mix(in srgb, var(--primary) 22%, transparent); }
.btn-link-sm.danger {
  background: color-mix(in srgb, var(--error) 12%, transparent);
  color: var(--error); border-color: color-mix(in srgb, var(--error) 30%, transparent);
}
.btn-link-sm.danger:hover { background: color-mix(in srgb, var(--error) 22%, transparent); }
.forum-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem .75rem; border-bottom: 1px solid var(--border);
  background: var(--bg2);
}
.forum-section-header-title {
  font-size: .85rem; font-weight: 600; color: var(--text1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%;
}

/* ── Forum detail header ─────────────────────────────────────────────────── */
.forum-detail-titlebar {
  display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem;
  margin-bottom: .6rem;
}
.forum-detail-titlebar .detail-main-title { margin: 0; flex: 1; }
.forum-topic-meta {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .5rem;
  padding: .5rem 0 .75rem;
  border-bottom: 1px solid var(--divider);
  margin-bottom: .75rem;
}
.forum-topic-author { display: flex; align-items: center; gap: .5rem; }
.forum-topic-author-info { display: flex; flex-direction: column; gap: .1rem; }
.forum-author-name { font-size: .85rem; font-weight: 600; color: var(--text1); line-height: 1.2; }
.forum-author-date { font-size: .72rem; color: var(--text3); }
.forum-topic-stats { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.forum-stat-chip {
  font-size: .7rem; font-weight: 600;
  padding: .2rem .55rem; border-radius: 99px;
  background: var(--surface3); color: var(--text2);
  white-space: nowrap;
}
.forum-stat-locked { background: var(--error-soft, #3a1a1a); color: var(--error); }

/* ── Forum replies section ───────────────────────────────────────────────── */
.forum-replies-section { padding: 0 .75rem .5rem; }
.forum-replies-header {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text3);
  padding: .5rem 0 .4rem;
  border-bottom: 1px solid var(--divider);
  margin-bottom: .25rem;
}
.forum-load-more-btn {
  display: block; width: 100%; margin: .6rem 0 1rem;
  padding: .55rem 1rem;
  background: var(--surface2); border: 1px solid var(--divider);
  border-radius: 8px; color: var(--primary);
  font-size: .85rem; font-weight: 600;
  cursor: pointer; text-align: center;
}
.forum-load-more-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Forum pagination ─────────────────────────────────────────────────────── */
.forum-pagination {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: .3rem;
  padding: .75rem 1rem 1rem;
}
.pg-btn {
  min-width: 2rem; height: 2rem; padding: 0 .45rem;
  border-radius: 6px; border: 1px solid var(--divider);
  background: var(--surface2); color: var(--text1);
  font-size: .8rem; font-weight: 600; cursor: pointer;
  transition: background .15s, color .15s;
}
.pg-btn:hover:not(:disabled) { background: var(--primary); color: #fff; border-color: var(--primary); }
.pg-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); cursor: default; }
.pg-btn:disabled:not(.active) { opacity: .4; cursor: default; }
.pg-ellipsis { color: var(--text3); font-size: .85rem; padding: 0 .15rem; align-self: center; }

.forum-reply-bar {
  position: sticky; bottom: var(--bottomnav-h);
  border-top: 1px solid var(--divider);
  background: var(--surface);
}
.forum-reply-bar--expanded {
  align-items: flex-end;
  padding: .6rem .75rem;
  gap: .6rem;
}

/* ── Forum category group header ─────────────────────────────────────────── */
.forum-category-header {
  padding: .55rem 1rem .35rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--surface2);
  border-top: 1px solid var(--divider);
  margin-top: .25rem;
}
.forum-category-header:first-child { margin-top: 0; border-top: none; }

/* ── Music player ────────────────────────────────────────────────────────── */
.music-card.playing .row-card-title { color: var(--primary); font-weight: 700; }
.music-card.playing .music-play-overlay { opacity: 1; }
.music-thumb { position: relative; width: 48px; height: 48px; border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.music-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.music-play-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.2rem; opacity: 0; transition: opacity .18s;
}
.music-card:hover .music-play-overlay { opacity: 1; }

/* Mini bar */
.music-mini-bar {
  display: none; position: fixed; bottom: var(--bottomnav-h); left: 0; right: 0;
  background: var(--surface); border-top: 1px solid var(--divider);
  align-items: center; gap: .75rem; padding: .5rem .75rem;
  z-index: 90; box-shadow: 0 -2px 12px rgba(0,0,0,.12);
}
.mmb-cover { width: 40px; height: 40px; border-radius: 6px; overflow: hidden; flex-shrink: 0; background: var(--surface3); }
.mmb-cover img { width: 100%; height: 100%; object-fit: cover; }
.mmb-info { flex: 1; min-width: 0; cursor: pointer; }
.mmb-title  { font-size: .88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mmb-artist { font-size: .75rem; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mmb-controls { display: flex; align-items: center; gap: .25rem; }
.mmb-btn { background: none; border: none; cursor: pointer; color: var(--text); font-size: 1.2rem; padding: .35rem; border-radius: 50%; transition: background .15s; display: flex; align-items: center; }
.mmb-btn:hover { background: var(--surface3); }
.mmb-play { background: var(--primary); color: #fff; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; }
.mmb-play:hover { background: var(--primary-dark); }

/* Music search bar */
.music-search-wrap { padding: .5rem 1rem .25rem; }
.music-search-box {
  display: flex; align-items: center; gap: .4rem;
  background: var(--surface2); border-radius: 24px;
  padding: .4rem .75rem .4rem .9rem;
  border: 1px solid var(--divider);
}
.music-search-box .xi { font-size: 1.1rem; color: var(--text3); flex-shrink: 0; }
.music-search-input {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: .9rem; color: var(--text);
}
.music-search-input::placeholder { color: var(--text3); }

/* Full player overlay */
.music-player-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: linear-gradient(170deg, var(--primary-dark, #3a7d99) 0%, var(--bg) 60%);
  display: flex; flex-direction: column; align-items: center;
  padding: 0 1.5rem 1.5rem; overflow-y: auto;
  transform: translateY(100%); transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.music-player-overlay.open { transform: translateY(0); }
.mpo-header {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 1rem 0 .75rem;
}
.mpo-down-btn { background: none; border: none; cursor: pointer; color: var(--text); font-size: 1.4rem; padding: .3rem; }
.mpo-playing-from { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--text3); }
.mpo-cover { width: 260px; height: 260px; border-radius: 16px; object-fit: cover; box-shadow: 0 8px 32px rgba(0,0,0,.3); margin: .75rem auto; }
.mpo-info { text-align: center; margin: .75rem 0; }
.mpo-title  { font-size: 1.15rem; font-weight: 800; }
.mpo-artist { font-size: .9rem; color: var(--text3); }
.mpo-seek-wrap { width: 100%; cursor: pointer; padding: .5rem 0; }
.mpo-seek-track { position: relative; height: 4px; background: var(--surface3); border-radius: 2px; }
.mpo-seek-fill  { height: 100%; background: var(--primary); border-radius: 2px; }
.mpo-seek-thumb {
  position: absolute; top: 50%; transform: translate(-50%,-50%);
  width: 14px; height: 14px; border-radius: 50%; background: var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.mpo-time {
  display: flex; justify-content: space-between;
  font-size: .75rem; color: var(--text3); margin-bottom: .5rem; width: 100%;
}
.mpo-controls { display: flex; align-items: center; justify-content: center; gap: 1.25rem; margin: .5rem 0 1rem; }
.mpo-ctrl-btn {
  background: none; border: none; cursor: pointer; color: var(--text);
  font-size: 1.4rem; padding: .35rem; border-radius: 50%; transition: background .15s;
  display: flex; align-items: center; justify-content: center;
}
.mpo-ctrl-btn:hover { background: rgba(255,255,255,.1); }
.mpo-ctrl-btn.active { color: var(--primary); }
.mpo-play-btn {
  background: var(--primary); color: #fff;
  width: 56px; height: 56px; border-radius: 50%;
  font-size: 1.8rem;
}
.mpo-play-btn:hover { background: var(--primary-dark); }
.mpo-queue { width: 100%; }
.mpo-queue-section-title { font-size: .82rem; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .5rem; }
.mpo-queue-list { display: flex; flex-direction: column; gap: .3rem; }
.mpo-queue-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .5rem .6rem; border-radius: 10px; cursor: pointer;
  transition: background .15s;
}
.mpo-queue-item:hover, .mpo-queue-item.active { background: rgba(255,255,255,.08); }
.mpo-queue-item.active .mpo-queue-title-text { color: var(--primary); font-weight: 700; }
.mpo-queue-item img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.mpo-queue-track-info { flex: 1; min-width: 0; }
.mpo-queue-title-text  { font-size: .88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mpo-queue-artist-text { font-size: .75rem; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Scrollbar custom (tema) ─────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface2); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; opacity: .7; }

/* ── Product Reviews ─────────────────────────────────────────────────────── */
#pd-reviews-section { margin-top: .5rem; }
.pd-review-form     { background: var(--surface2); border-radius: 12px; padding: .875rem; margin-top: .75rem; }
#pd-star-picker span { transition: color .1s; user-select: none; }
#pd-star-picker span:hover { color: var(--warning) !important; }

/* ── Sticker Pack Detail ─────────────────────────────────────────────────── */
.sticker-pack-preview {
  display: flex; flex-wrap: wrap; gap: .4rem; margin: .75rem 0;
  background: var(--surface2); border-radius: 12px; padding: .625rem;
}
.sticker-pack-thumb {
  width: 52px; height: 52px; object-fit: contain; border-radius: 6px;
}
.sticker-price-tag {
  font-size: .78rem; font-weight: 700; color: var(--primary);
  background: var(--surface2); border-radius: 6px; padding: .2rem .45rem;
  margin-top: .35rem; text-align: center;
}

/* ── Create FAB ──────────────────────────────────────────────────────────── */
.create-fab {
  position: fixed;
  right: 1rem;
  bottom: calc(var(--bottom-nav-h, 64px) + .75rem);
  z-index: 150;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform .15s, opacity .15s;
}
.create-fab:active  { transform: scale(.93); }
.create-fab.hidden  { display: none; }

/* ── Create Content Sheet ────────────────────────────────────────────────── */
.create-sheet       { max-height: 90vh; }
.create-sheet-content {
  overflow-y: auto;
  padding: 1rem;
  padding-bottom: calc(env(safe-area-inset-bottom) + 1rem);
}
.cc-field           { margin-bottom: .75rem; }
.cc-label           { display: block; font-size: .8rem; font-weight: 600; color: var(--text2); margin-bottom: .3rem; }
.cc-textarea        { width: 100%; resize: vertical; min-height: 90px; }
.poll-opt-row       { display: flex; align-items: center; gap: .4rem; margin-bottom: .45rem; }

/* ── FAB (Floating Action Button) ─────────────────────────────────────────── */
.fab {
  position: fixed; bottom: calc(env(safe-area-inset-bottom) + 72px); right: 1.1rem;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--primary); color: #fff;
  transition: bottom .25s ease;
  border: none; cursor: pointer; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
  font-size: 1.5rem; transition: transform .15s, box-shadow .15s;
}
.fab:active { transform: scale(.92); box-shadow: 0 2px 8px rgba(0,0,0,.22); }
body.has-mini-bar .fab { bottom: calc(env(safe-area-inset-bottom) + 72px + 56px); }

/* ── Card action row (edit/delete on owned cards) ──────────────────────────── */
.card-actions {
  display: flex; gap: .4rem; padding: .4rem .6rem .6rem;
  border-top: 1px solid var(--divider);
}
.card-action-btn {
  flex: 1; padding: .3rem .5rem; font-size: .78rem; font-weight: 600;
  border: 1px solid var(--divider); border-radius: 6px;
  background: none; cursor: pointer; color: var(--text2);
  transition: background .12s, color .12s;
}
.card-action-btn:hover        { background: var(--hover); color: var(--text); }
.card-action-btn.danger:hover { color: var(--error); border-color: var(--error); }

/* ── Crowdfunding Detail Tabs ────────────────────────────────────────────── */
.fund-detail-tabs   { border-bottom: 1px solid var(--divider); }
details summary::-webkit-details-marker { display: none; }

/* ── Downloads Page ──────────────────────────────────────────────────────── */
#downloads-list     { padding-bottom: 2rem; }

/* ── Event Calendar ──────────────────────────────────────────────────────── */
#cal-sheet          { max-height: 95vh; }
.cal-sheet-inner    { padding: .5rem 0 1rem; }
.cal-month-header   {
  display: flex; align-items: center; justify-content: space-between;
  padding: .4rem 1rem .6rem;
}
.cal-month-title    { font-weight: 700; font-size: 1rem; }
.cal-nav-btn        {
  background: none; border: none; cursor: pointer;
  padding: .35rem .6rem; border-radius: 8px; font-size: 1.1rem;
  color: var(--primary);
}
.cal-nav-btn:active { background: var(--surface2); }
.cal-day-header-row {
  display: grid; grid-template-columns: repeat(7, 1fr);
  padding: 0 .5rem;
}
.cal-header-cell    {
  text-align: center; font-size: .7rem; font-weight: 600;
  color: var(--text3); padding: .2rem 0;
}
.cal-grid-cells     {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 2px; padding: .25rem .5rem .5rem;
}
.cal-cell           { min-height: 44px; padding: 1px; }
.cal-day-cell       {
  border-radius: 8px; cursor: pointer; padding: 4px 2px 3px;
  display: flex; flex-direction: column; align-items: center;
  transition: background .12s;
  user-select: none;
}
.cal-day-cell:active { background: var(--surface3); }
.cal-today          { background: var(--primary-light); font-weight: 700; }
.cal-today .cal-day-num { color: var(--primary); }
.cal-has-events     { background: var(--surface2); }
.cal-selected       { background: var(--primary) !important; border-radius: 8px; }
.cal-selected .cal-day-num { color: #fff !important; }
.cal-day-num        { font-size: .8rem; color: var(--text1); line-height: 1; }
.cal-dots           { display: flex; gap: 2px; margin-top: 2px; flex-wrap: wrap; justify-content: center; }
.cal-dot            { width: 5px; height: 5px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.cal-day-detail     { padding: .75rem 1rem; border-top: 1px solid var(--divider); }
.cal-day-detail h3  { font-size: .9rem; font-weight: 700; margin-bottom: .5rem; }
.cal-event-row      {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem 0; border-bottom: 1px solid var(--divider);
  cursor: pointer; font-size: .85rem;
}
.cal-event-row:last-child { border-bottom: none; }
.cal-event-thumb    {
  width: 36px; height: 36px; border-radius: 6px; object-fit: cover;
  background: var(--surface2); flex-shrink: 0;
}
.cal-event-name     { color: var(--text1); flex: 1; font-weight: 500; }

/* ── Group / Store / Video Management Panels ─────────────────────────────── */
.manage-sheet        { max-height: 92vh; }
.manage-tabs         {
  display: flex; border-bottom: 1px solid var(--divider);
  padding: 0 .75rem; gap: .25rem;
}
.manage-tab-btn      {
  background: none; border: none; padding: .55rem .75rem;
  font-size: .85rem; cursor: pointer; border-bottom: 2px solid transparent;
  color: var(--text2); transition: color .15s, border-color .15s;
}
.manage-tab-btn.active { border-color: var(--primary); color: var(--primary); font-weight: 600; }
.manage-panel        { padding: 1rem; overflow-y: auto; max-height: 72vh; }
.manage-panel label  { display: block; font-size: .8rem; font-weight: 600; color: var(--text2); margin-bottom: .3rem; }
.manage-panel select,
.manage-panel input[type="text"],
.manage-panel textarea {
  width: 100%; box-sizing: border-box; margin-bottom: .75rem;
}
.manage-actions      { display: flex; gap: .5rem; margin-top: .5rem; }
.manage-actions .btn { flex: 1; }
.pending-member-row  {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem 0; border-bottom: 1px solid var(--divider);
}
.pending-member-row:last-child  { border-bottom: none; }
.pending-member-row img         { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.pending-member-row .pm-name    { flex: 1; font-size: .9rem; font-weight: 500; }
.pending-member-row .pm-actions { display: flex; gap: .35rem; }

/* ── Managed card (Store / Videos) ──────────────────────────────────────── */
.managed-card        { position: relative; }
.managed-card-actions {
  display: flex; gap: .4rem; padding: .4rem .5rem .5rem;
  border-top: 1px solid var(--divider);
}
.managed-card-actions .btn { flex: 1; font-size: .76rem; padding: .3rem .5rem; }

/* ── Module tabs (channel detail, etc.) ─────────────────────────────────── */
.module-tabs {
  display: flex;
  border-bottom: 2px solid var(--divider);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.module-tabs::-webkit-scrollbar { display: none; }
.module-tab {
  padding: .55rem .9rem;
  font-size: .85rem;
  color: var(--text2);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 500;
  flex-shrink: 0;
  transition: color .15s, border-color .15s;
}
.module-tab:hover  { color: var(--text1); }
.module-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ── Card context menu (⋮ button on managed cards) ───────────────────────── */
.card-ctx-wrap {
  position: absolute; top: .4rem; right: .4rem; z-index: 3;
}
.card-ctx-btn {
  width: 28px; height: 28px;
  background: rgba(0,0,0,.5); color: #fff;
  border: none; border-radius: 50%;
  font-size: 1.2rem; font-weight: 700; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.card-ctx-menu {
  display: none; position: absolute; right: 0; top: 32px;
  background: var(--surface); border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
  min-width: 130px; overflow: hidden; z-index: 200;
}
.card-ctx-menu.show     { display: block; }
.card-ctx-item {
  padding: .65rem .9rem; font-size: .875rem; cursor: pointer;
  display: flex; align-items: center; gap: .5rem;
}
.card-ctx-item:hover    { background: var(--surface2); }
.card-ctx-item.danger   { color: var(--error); }

/* ── Onboarding / Welcome ────────────────────────────────────────────────── */
.onboarding-root     {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center;
  padding: 2rem 1.5rem 0;
  background: var(--bg);
  overflow: hidden;
  z-index: 10;
}
.onboarding-slides   {
  width: 100%; flex: 1; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative;
}
.onboarding-slide    {
  display: none; flex-direction: column; align-items: center;
  text-align: center; animation: obSlideIn .3s ease;
}
.onboarding-slide.active { display: flex; }
@keyframes obSlideIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
.ob-emoji            {
  font-size: 5rem; line-height: 1;
  width: 120px; height: 120px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.75rem;
}
.ob-title            { font-size: 1.5rem; font-weight: 800; color: var(--text1); margin-bottom: .6rem; }
.ob-sub              { font-size: .95rem; color: var(--text2); line-height: 1.5; max-width: 320px; }
.ob-dots             { display: flex; gap: .45rem; margin: 1.25rem 0 .75rem; flex-shrink: 0; }
.ob-dot              {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border); transition: background .2s, width .2s;
  cursor: pointer;
}
.ob-dot.active       { background: var(--primary); width: 22px; border-radius: 4px; }
.ob-actions          {
  width: 100%; max-width: 360px; flex-shrink: 0;
  padding: 0 0 max(1.25rem, env(safe-area-inset-bottom, 1.25rem));
}

/* ── xConfirm Dialog ──────────────────────────────────────────────────── */
.xdialog-overlay {
  position: fixed; inset: 0; z-index: 10100;
  background: rgba(0,0,0,.5); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; animation: xdFadeIn .15s ease;
}
@keyframes xdFadeIn { from { opacity: 0; } to { opacity: 1; } }
.xdialog {
  background: var(--surface); border-radius: 16px;
  padding: 1.5rem; width: 100%; max-width: 320px;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  animation: xdSlideUp .2s ease;
}
@keyframes xdSlideUp {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.xdialog-msg {
  font-size: 1rem; color: var(--text1); line-height: 1.5;
  margin-bottom: 1.25rem; text-align: center;
}
.xdialog-actions {
  display: flex; gap: .75rem; justify-content: flex-end;
}
.xdialog-actions .btn { flex: 1; }

/* ── Pinned message bar ──────────────────────────────────────────────────── */
.chat-pinned-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .75rem;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  font-size: .8rem;
  position: sticky;
  top: 0;
  z-index: 15;
  cursor: pointer;
}
.chat-pinned-bar.hidden { display: none; }
.pinned-preview-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.pinned-unpin-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text3); padding: 2px; line-height: 1;
}
.pinned-unpin-btn .ms-icon { font-size: 14px; vertical-align: middle; }

/* ── Member search dropdown (group creation) ─────────────────────────────── */
.member-search-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0; right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  z-index: 200;
  max-height: 200px;
  overflow-y: auto;
}
.member-search-dropdown.hidden { display: none; }
.member-search-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .75rem;
  cursor: pointer;
  transition: background .12s;
}
.member-search-item:hover { background: var(--surface); }
.member-search-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.member-search-name { font-size: .875rem; color: var(--text); }
.member-search-empty,
.member-search-loading {
  padding: .75rem;
  text-align: center;
  color: var(--text3);
  font-size: .8rem;
}
.spinner-sm {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .5s linear infinite;
  vertical-align: middle;
}

/* ── Member chips ────────────────────────────────────────────────────────── */
.member-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  min-height: 4px;
  margin-bottom: .25rem;
}
.member-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  border-radius: 99px;
  padding: .15rem .5rem .15rem .2rem;
  font-size: .8rem;
}
.chip-avatar {
  width: 20px; height: 20px;
  border-radius: 50%;
  object-fit: cover;
}
.chip-remove {
  background: none; border: none;
  cursor: pointer; color: var(--primary);
  font-size: 1rem; line-height: 1; padding: 0;
}

/* ── @mention picker ─────────────────────────────────────────────────────── */
.mention-picker {
  position: absolute;
  bottom: 100%;
  left: 0; right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -4px 16px rgba(0,0,0,.1);
  max-height: 160px;
  overflow-y: auto;
  z-index: 100;
}
.mention-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .75rem;
  cursor: pointer;
  font-size: .875rem;
  transition: background .12s;
}
.mention-item:hover,
.mention-item.focused { background: var(--surface); }
.mention-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* ── Group admin panel ───────────────────────────────────────────────────── */
.group-admin-member {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 0;
  border-bottom: 1px solid var(--border);
}
.group-admin-member:last-child { border-bottom: none; }
.group-admin-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.group-admin-name { font-size: .9rem; color: var(--text); }
.group-admin-role { font-size: .72rem; color: var(--text3); text-transform: capitalize; }
.group-admin-actions { display: flex; gap: .3rem; flex-shrink: 0; }
.group-admin-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .25rem .4rem;
  cursor: pointer;
  color: var(--text3);
  line-height: 1;
  transition: color .12s, border-color .12s;
}
.group-admin-btn .ms-icon { font-size: 18px; vertical-align: middle; }
.group-admin-btn:hover { color: var(--primary); border-color: var(--primary); }
.group-admin-btn.danger:hover { color: var(--error, #e53935); border-color: var(--error, #e53935); }

/* ── Settings — browser push notification row ─────────────────────────── */
.settings-push-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem .1rem;
  border-top: 1px solid var(--border);
}
.settings-push-hint {
  font-size: .75rem;
  color: var(--text3);
  margin-top: .15rem;
  line-height: 1.3;
}
.push-status-badge {
  font-size: .72rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.push-status-active  { background: rgba(46,204,113,.15); color: var(--success, #2ecc71); }
.push-status-blocked { background: rgba(231,76,60,.12);  color: var(--error,   #e74c3c); }
.btn-push-enable {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .35rem .75rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity .15s;
}
.btn-push-enable:hover   { opacity: .88; }
.btn-push-enable:disabled { opacity: .5; cursor: default; }

/* ── PWA Install — drawer button & iOS sheet ──────────────────────────── */
#drawer-install-btn .ms-icon { color: var(--primary); }

.ios-install-inner {
  padding: 1.25rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.ios-install-header {
  display: flex;
  align-items: center;
  gap: .85rem;
}
.ios-install-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  flex-shrink: 0;
}
.ios-install-title { font-weight: 700; font-size: 1rem; color: var(--text); }
.ios-install-sub   { font-size: .8rem; color: var(--text3); }
.ios-install-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  padding: .25rem;
  line-height: 1;
}
.ios-install-steps { display: flex; flex-direction: column; gap: .6rem; }
.ios-install-step {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .85rem;
  background: var(--surface2);
  border-radius: 10px;
  font-size: .9rem;
  color: var(--text);
}
.ios-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ios-step-icon { color: var(--primary); font-size: 1.2rem; flex-shrink: 0; }
.ios-install-arrow {
  text-align: center;
  font-size: .8rem;
  color: var(--text3);
  padding-top: .25rem;
}

/* ── Store View Page ──────────────────────────────────────────────────────── */
.store-view-wrap { display: flex; flex-direction: column; min-height: 100%; }
.store-banner { width: 100%; height: 160px; overflow: hidden; background: var(--surface2); }
.store-banner img { width: 100%; height: 100%; object-fit: cover; }
.store-banner-placeholder { background: linear-gradient(135deg, var(--primary-light), var(--surface2)); }
.store-header-info {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem; border-bottom: 1px solid var(--divider);
}
.store-logo-wrap { flex-shrink: 0; }
.store-logo {
  width: 60px; height: 60px; border-radius: 12px; object-fit: cover;
  border: 2px solid var(--surface); margin-top: -30px; position: relative;
  background: var(--surface2);
}
.store-logo-default {
  width: 60px; height: 60px; border-radius: 12px;
  background: var(--primary-light); display: flex; align-items: center;
  justify-content: center; color: var(--primary); font-size: 1.5rem;
  margin-top: -30px; position: relative; border: 2px solid var(--surface);
}
.store-header-meta { flex: 1; min-width: 0; }
.store-view-title { font-size: 1rem; font-weight: 700; margin-bottom: .2rem; }
.store-open-badge {
  font-size: .72rem; font-weight: 700; padding: .15rem .5rem;
  border-radius: 20px; display: inline-block;
}
.store-open-badge.open   { background: #d1fae520; color: #10b981; }
.store-open-badge.closed { background: #fee2e220; color: #ef4444; }
.store-rating-stars { color: var(--warning); font-size: .9rem; line-height: 1; }

/* Store tabs */
.store-tabs {
  display: flex; border-bottom: 2px solid var(--divider);
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
  flex-shrink: 0;
}
.store-tabs::-webkit-scrollbar { display: none; }
.store-tab-btn {
  padding: .6rem .9rem; font-size: .85rem; color: var(--text2);
  background: none; border: none; border-bottom: 2px solid transparent;
  margin-bottom: -2px; cursor: pointer; white-space: nowrap;
  font-weight: 500; flex-shrink: 0; transition: color .15s, border-color .15s;
}
.store-tab-btn:hover  { color: var(--text1); }
.store-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* Store info rows */
.store-info-row {
  display: flex; align-items: center; gap: .6rem; padding: .5rem 0;
  border-bottom: 1px solid var(--divider); font-size: .9rem; color: var(--text2);
}
.store-info-row:last-child { border-bottom: none; }
.store-info-row .ms-icon  { color: var(--primary); flex-shrink: 0; }

/* Coupon cards */
.store-coupon-card {
  background: var(--surface2); border-radius: 10px;
  border: 1.5px dashed var(--divider); padding: .75rem 1rem;
  margin-bottom: .65rem;
}
.store-coupon-code {
  font-size: 1.05rem; font-weight: 800; letter-spacing: .08em;
  color: var(--primary); margin-bottom: .2rem;
}
.store-coupon-title { font-size: .9rem; color: var(--text); font-weight: 500; }
.store-coupon-disc  { font-size: .82rem; color: var(--text2); margin-top: .2rem; }

/* Cart coupon row */
.cart-coupon-wrap {
  display: flex; gap: .5rem; margin-bottom: .75rem; align-items: center;
}
.cart-coupon-wrap .form-control { flex: 1; font-size: .88rem; }

/* ── Store main page ──────────────────────────────────────────────────────── */
.store-main-wrap { display: flex; flex-direction: column; min-height: 100%; position: relative; }
.store-tab-body  { flex: 1; overflow-y: auto; padding-bottom: 5rem; }

/* Search bar */
.store-search-bar {
  display: flex; align-items: center; gap: .5rem;
  padding: .45rem .75rem; background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.store-search-bar input {
  flex: 1; background: none; border: none; outline: none;
  font-size: .9rem; color: var(--text);
}

/* FAB button */
.store-fab {
  position: fixed; bottom: calc(var(--bottomnav-h) + 1rem); right: 1rem;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--primary); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.25); cursor: pointer; z-index: 100;
  transition: transform .15s;
}
.store-fab:active { transform: scale(.93); }
.store-fab .ms-icon { font-size: 1.5rem; }

/* Android-style store hero card */
.store-list { display: flex; flex-direction: column; }
.store-hero-card {
  position: relative;            /* anchor for avatar + menu button */
  background: var(--surface);
  border-bottom: 1px solid var(--divider);
}
.store-hero-banner {
  width: 100%; height: 180px; overflow: hidden; /* only clips the banner image */
  background: var(--surface2);
}
.store-hero-banner > img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
/* Avatar is a SIBLING of .store-hero-banner, so it is never clipped */
.store-hero-avatar-wrap {
  position: absolute; top: calc(180px - 26px); left: 50%; transform: translateX(-50%);
  z-index: 2; pointer-events: none;
}
.store-hero-avatar {
  width: 52px; height: 52px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--surface); background: var(--surface2);
  display: block;
}
.store-hero-info {
  padding: 1.75rem .75rem .9rem; text-align: center;
}
.store-hero-name {
  font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: .2rem;
}
.store-hero-cat  { font-size: .82rem; color: var(--text3); margin-bottom: .25rem; }
.store-hero-meta {
  font-size: .8rem; color: var(--text3);
  display: flex; gap: .75rem; justify-content: center; margin-top: .2rem;
}
/* Three-dot button overlaid on managed card banner */
.store-card-menu-btn {
  position: absolute; top: .5rem; right: .5rem; z-index: 3;
  background: rgba(0,0,0,.45); border: none; border-radius: 50%;
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #fff;
}
.store-card-menu-btn .ms-icon { font-size: 1.2rem; }
/* Store view edit buttons */
.store-edit-btn {
  position: absolute; background: rgba(0,0,0,.5); border: none; border-radius: 50%;
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #fff; z-index: 5;
}
.store-edit-cover-btn  { bottom: .5rem; right: .5rem; }
.store-edit-avatar-btn { bottom: -4px; right: -4px; width: 24px; height: 24px; }
.store-edit-avatar-btn .ms-icon { font-size: .85rem; }

/* Category grid (3-column, Android-style) */
.store-cat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--divider); padding-top: 1px;
}
.store-cat-tile {
  background: var(--surface); display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 1.2rem .5rem; cursor: pointer; text-align: center;
  min-height: 110px;
}
.store-cat-tile:active { background: var(--surface2); }
.store-cat-icon {
  width: 44px; height: 44px; margin-bottom: .5rem;
  display: flex; align-items: center; justify-content: center;
}
.store-cat-icon img { width: 100%; height: 100%; object-fit: contain; }
.store-cat-name {
  font-size: .78rem; color: var(--text); line-height: 1.3;
  word-break: break-word;
}

/* Category browse label */
.store-cat-label {
  padding: .5rem .75rem; font-size: .85rem; font-weight: 600; color: var(--text2);
  display: flex; align-items: center; gap: .3rem;
  border-bottom: 1px solid var(--divider);
}

/* Create store sheet */
.crs-section-title {
  font-size: .95rem; font-weight: 700; color: var(--text); margin-bottom: 1rem;
}
.store-package-card {
  background: var(--surface2); border-radius: 10px;
  border: 1.5px solid var(--border); padding: .9rem 1rem;
  margin-bottom: .6rem; cursor: pointer; transition: border-color .15s;
}
.store-package-card:hover { border-color: var(--primary); }
.store-package-name  { font-size: .95rem; font-weight: 700; color: var(--text); }
.store-package-price { font-size: .9rem; font-weight: 600; color: var(--primary); }
.store-package-price.free { color: #10b981; }
.store-package-desc  { font-size: .82rem; color: var(--text3); margin-top: .3rem; }

/* Context menu (bottom sheet style) */
.context-menu-list { padding: .25rem 0 .5rem; }
.context-menu-item {
  display: flex; align-items: center; gap: .85rem;
  width: 100%; background: none; border: none; text-align: left;
  padding: .85rem 1.25rem; font-size: .95rem; color: var(--text); cursor: pointer;
}
.context-menu-item:hover { background: var(--surface2); }
.context-menu-item .ms-icon { font-size: 1.25rem; color: var(--text2); flex-shrink: 0; }
.context-menu-item.danger        { color: var(--error); }
.context-menu-item.danger .ms-icon { color: var(--error); }

/* ── Call UI ─────────────────────────────────────────────────────────────── */
.call-incoming {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: var(--surface); border-top: 1px solid var(--border);
  border-radius: 1.2rem 1.2rem 0 0; padding: 1.25rem 1.5rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 -4px 32px rgba(0,0,0,.35); animation: slideUp .25s ease;
}
.call-outgoing {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: var(--surface); border-top: 1px solid var(--border);
  border-radius: 1.2rem 1.2rem 0 0; padding: 1.5rem 1.5rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 -4px 32px rgba(0,0,0,.35); animation: slideUp .25s ease;
}
.call-incoming-info, .call-outgoing-info {
  display: flex; align-items: center; gap: 1rem;
}
.call-avatar {
  width: 52px; height: 52px; border-radius: 50%; object-fit: cover;
}
.call-peer-name  { font-size: 1rem; font-weight: 700; color: var(--text); }
.call-type-label { font-size: .82rem; color: var(--text3); display: flex; align-items: center; gap: .25rem; margin-top: .15rem; }
.call-type-label .ms-icon { font-size: 1rem; }
.call-outgoing-icon { font-size: 2.2rem; color: var(--primary); }
.call-incoming-btns { display: flex; gap: 1rem; }

.call-btn-reject, .call-btn-accept {
  width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}
.call-btn-reject { background: #ef4444; color: #fff; }
.call-btn-accept { background: #10b981; color: #fff; }
.call-btn-reject .ms-icon, .call-btn-accept .ms-icon { font-size: 1.6rem; }

.call-pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* Active call overlay */
.call-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: #000; display: flex; flex-direction: column;
}
.call-remote-wrap {
  flex: 1; position: relative; background: #111;
  display: flex; align-items: center; justify-content: center;
}
.call-video-box { width: 100%; height: 100%; }
.call-video-box video { width: 100%; height: 100%; object-fit: cover; }
.call-audio-bg {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
}
.call-audio-bg .ms-icon { font-size: 6rem; color: rgba(255,255,255,.2); }
.call-local-video {
  position: absolute; bottom: 7rem; right: 1rem;
  width: 90px; height: 130px; border-radius: .75rem; overflow: hidden;
  border: 2px solid rgba(255,255,255,.3); z-index: 10;
}
.call-local-video video { width: 100%; height: 100%; object-fit: cover; }
.call-timer-row {
  position: absolute; top: 1rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .1rem; z-index: 10;
}
.call-timer       { font-size: .85rem; color: rgba(255,255,255,.8); font-variant-numeric: tabular-nums; }
.call-peer-label  { font-size: 1rem; font-weight: 700; color: #fff; }
.call-controls {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  display: flex; gap: 1.25rem; z-index: 10;
}
.call-ctrl-btn {
  width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.15); color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.call-ctrl-btn .ms-icon { font-size: 1.6rem; }
.call-ctrl-btn:hover  { background: rgba(255,255,255,.25); }
.call-ctrl-btn.active { background: rgba(255,255,255,.9); color: #111; }
.call-end-btn         { background: #ef4444 !important; }
.call-end-btn:hover   { background: #dc2626 !important; }

/* Call buttons in chat topbar */
.call-topbar-btns { display: flex; gap: .1rem; }
.call-topbar-btns .topbar-btn { color: var(--primary); }
