/* ======================= */
/* VARIABLES Y RESET */
/* ======================= */
:root {
    --primary-color: #1DA1F2;
    --primary-dark: #0d8ddb;
    --background-light: #ffffff;
    --background-card: #f8f9fa;
    --text-primary: #14171a;
    --text-secondary: #657786;
    --border-color: #e0e0e0;
    --success-color: #00ba7c;
    --error-color: #e74c3c;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --cursor-glow-rgb: 29, 161, 242;
    --cursor-glow-deep-rgb: 14, 115, 176;
}

[data-theme="dark"] {
    --background-light: #0f172a;
    --background-card: #111827;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --border-color: #374151;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: var(--background-light);
    color: var(--text-primary);
    transition: all 0.3s ease;
    line-height: 1.6;
}

/* ======================= */
/* HEADER MODERNO */
/* ======================= */
.main-header {
    background: var(--background-light);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 20px;
}

.logo-section {
    display: flex;
    align-items: center;
    height: 50px;
}

.logo {
    width: 200px;
    height: 200px;
    object-fit: contain;
    display: block;
    filter: none;
    transition: filter 0.25s ease;
}

[data-theme="dark"] .logo,
body.modo-oscuro .logo {
    filter: brightness(0) invert(1) !important;
}

html.tema-oscuro-init .logo {
    filter: brightness(0) invert(1) !important;
}


.nav-center {
    display: flex;
    gap: 30px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    text-decoration: none;
    color: var(--text-secondary);
    padding: 10px 16px;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background: var(--primary-color);
    color: white;
}

.nav-notif-badge {
    /* Se posiciona relativo al ícono, no al botón completo */
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(2px);
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #e53935;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    padding: 0 5px;
    border: 2px solid var(--background-light, #fff);
    box-shadow: 0 1px 4px rgba(0,0,0,0.22);
    pointer-events: none;
    /* Animación de entrada */
    animation: badge-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    z-index: 2;
}

@keyframes badge-pop {
    from { transform: translateX(2px) scale(0.4); opacity: 0; }
    to   { transform: translateX(2px) scale(1);   opacity: 1; }
}

/* Wrapper del ícono para anclar el badge */
.nav-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cursor-glow-bubble {
    position: fixed;
    left: 0;
    top: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    background: radial-gradient(circle, rgba(var(--cursor-glow-rgb),0.95) 0%, rgba(var(--cursor-glow-deep-rgb),0.85) 55%, rgba(var(--cursor-glow-rgb),0.2) 100%);
    box-shadow: 0 0 12px rgba(var(--cursor-glow-rgb),0.95), 0 0 26px rgba(var(--cursor-glow-rgb),0.7), 0 0 42px rgba(var(--cursor-glow-rgb),0.45);
    transform: translate(-50%, -50%);
    transition: transform 0.05s linear;
}

.cursor-glow-trail {
    position: fixed;
    left: 0;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    background: rgba(var(--cursor-glow-rgb),0.7);
    box-shadow: 0 0 10px rgba(var(--cursor-glow-rgb),0.95), 0 0 22px rgba(var(--cursor-glow-rgb),0.7), 0 0 34px rgba(var(--cursor-glow-rgb),0.5);
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    animation: cursorTrailFade 0.5s ease-out forwards;
}

@keyframes cursorTrailFade {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.25);
    }
}

.cursor-click-burst {
    position: fixed;
    left: 0;
    top: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(var(--cursor-glow-rgb), 0.9);
    pointer-events: none;
    z-index: 9997;
    transform: translate(-50%, -50%) scale(0.55);
    box-shadow: 0 0 12px rgba(var(--cursor-glow-rgb), 0.9), 0 0 24px rgba(var(--cursor-glow-rgb), 0.55);
    animation: cursorClickBurst 0.48s ease-out forwards;
}

.cursor-click-spark {
    position: fixed;
    left: 0;
    top: 0;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(var(--cursor-glow-rgb), 0.95);
    pointer-events: none;
    z-index: 9996;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 9px rgba(var(--cursor-glow-rgb), 0.95), 0 0 20px rgba(var(--cursor-glow-rgb), 0.65);
    animation: cursorClickSpark 0.5s ease-out forwards;
}

@keyframes cursorClickBurst {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.55);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(4.5);
    }
}

@keyframes cursorClickSpark {
    0% {
        opacity: 0.95;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + (var(--dx) * 1px)), calc(-50% + (var(--dy) * 1px))) scale(0.2);
    }
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 15px;
    color: var(--text-secondary);
}

.search-input {
    padding: 10px 15px 10px 45px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    background: var(--background-card);
    color: var(--text-primary);
    width: 280px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    width: 320px;
}

/* Resultados del buscador (dropdown) */
.search-results {
    box-shadow: var(--shadow);
    border-radius: 8px;
    overflow: hidden;
}
.search-results .search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    background: var(--background-light);
}
.search-results .search-result-item:last-child {
    border-bottom: none;
}
.search-results .search-result-item img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.search-results .search-result-item span {
    font-size: 14px;
    color: var(--text-primary);
}
.search-results .search-result-item:hover {
    background: var(--background-card);
}

.settings-toggle {
    background: var(--background-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.settings-toggle:hover {
    background: var(--primary-color);
    color: white;
}

.settings-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 3100;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.settings-modal {
    width: min(420px, 94vw);
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--background-light);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.26);
    overflow: hidden;
    transform: translateY(10px) scale(0.98);
    opacity: 0;
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.settings-modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.settings-modal-overlay.open .settings-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.settings-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.settings-modal-head h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.settings-close-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.settings-modal-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: min(72vh, 640px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #1da1f2 transparent;
}

.settings-modal-body::-webkit-scrollbar {
    width: 10px;
}

.settings-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.settings-modal-body::-webkit-scrollbar-thumb {
    background: #1da1f2;
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.settings-modal-body::-webkit-scrollbar-thumb:hover {
    background: #1093dd;
    background-clip: padding-box;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-section h4 {
    margin: 0;
    font-size: 13px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.settings-option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--background-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 14px;
}

.settings-select {
    border: 1px solid var(--border-color);
    background: var(--background-light);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 8px 10px;
    min-width: 150px;
}

.settings-range {
    width: min(220px, 42vw);
    accent-color: var(--primary-color);
    cursor: pointer;
}

.settings-color-palette {
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.settings-color-swatch:hover {
    transform: translateY(-1px);
}

.settings-color-swatch.active {
    border-color: #ffffff;
    box-shadow: 0 0 0 2px var(--primary-color);
}

.color-blue { background: #1da1f2; }
.color-pink { background: #ff52aa; }
.color-green { background: #16b981; }
.color-red { background: #ef4444; }

.settings-action-btn {
    border: 1px solid var(--border-color);
    background: var(--background-light);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.settings-action-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.settings-action-btn.danger:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}

.settings-actions-inline {
    display: flex;
    gap: 8px;
}

.settings-links-inline a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 13px;
}

.settings-links-inline a:hover {
  text-decoration: underline;
}

.settings-more-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-more-link {
  display: grid;
  gap: 4px;
  padding: 12px 12px;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(29, 161, 242, 0.3);
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(29, 161, 242, 0.18), transparent 64%),
    var(--background-light);
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

body.modo-oscuro .settings-more-link {
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(29, 161, 242, 0.18), transparent 64%),
    rgba(255, 255, 255, 0.04);
  border-color: rgba(29, 161, 242, 0.32);
}

.settings-more-link i {
  font-size: 18px;
  color: #1da1f2;
}

.settings-more-link span {
  font-weight: 900;
  letter-spacing: -0.2px;
}

.settings-more-link small {
  color: #657786;
  font-weight: 700;
}

body.modo-oscuro .settings-more-link small {
  color: rgba(255, 255, 255, 0.74);
}

.settings-more-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(29, 161, 242, 0.18);
  border-color: rgba(29, 161, 242, 0.5);
}

.settings-more-soon {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(100, 116, 139, 0.45);
  background: rgba(100, 116, 139, 0.06);
  color: inherit;
}

body.modo-oscuro .settings-more-soon {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.08);
}

.settings-more-soon i {
  color: rgba(100, 116, 139, 0.9);
}

body.modo-oscuro .settings-more-soon i {
  color: rgba(203, 213, 225, 0.9);
}

.settings-more-soon strong {
  display: block;
  font-weight: 900;
}

.settings-more-soon small {
  display: block;
  color: #657786;
  font-weight: 700;
}

body.modo-oscuro .settings-more-soon small {
  color: rgba(255, 255, 255, 0.72);
}

@media (max-width: 540px) {
  .settings-more-grid {
    grid-template-columns: 1fr;
  }
}

.settings-option-info {
    display: flex;
    flex-direction: column;
}

.settings-option-info strong {
    color: var(--text-primary);
    font-size: 14px;
}

.settings-option-info small {
    color: var(--text-secondary);
    font-size: 12px;
}

.settings-switch {
    position: relative;
    width: 46px;
    height: 26px;
    display: inline-flex;
    align-items: center;
}

.settings-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.settings-switch-slider {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: #cbd5e1;
    position: relative;
    transition: background 0.25s ease;
}

.settings-switch-slider::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    left: 3px;
    top: 3px;
    transition: transform 0.25s ease;
}

.settings-switch input:checked + .settings-switch-slider {
    background: #1da1f2;
}

.settings-switch input:checked + .settings-switch-slider::before {
    transform: translateX(20px);
}

.settings-feedback-card {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(29, 161, 242, 0.1), transparent 60%), var(--background-card);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-feedback-stars {
    display: flex;
    gap: 6px;
}

.settings-star-btn {
    border: none;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    color: #cbd5e1;
    cursor: pointer;
    transition: transform 0.15s ease, color 0.15s ease, text-shadow 0.15s ease;
}

.settings-star-btn:hover {
    transform: translateY(-1px) scale(1.05);
}

.settings-star-btn.active {
    color: #1da1f2;
    text-shadow: 0 0 14px rgba(29, 161, 242, 0.45);
}

.settings-feedback-text {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--background-light);
    color: var(--text-primary);
    padding: 10px 11px;
    font-family: inherit;
    resize: vertical;
    min-height: 84px;
}

.settings-feedback-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.settings-feedback-actions small {
    color: var(--text-secondary);
}

body.compact-feed .post-card {
    padding: 14px;
}

body.compact-feed .post-content {
    padding: 9px 0;
}

body.compact-feed .main-layout {
    gap: 14px;
}

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

body.hide-sensitive-media .post-media-frame img,
body.hide-sensitive-media .post-media-frame video {
    filter: blur(14px);
    transition: filter 0.2s ease;
}

body.hide-sensitive-media .post-media-frame:hover img,
body.hide-sensitive-media .post-media-frame:hover video {
    filter: blur(0);
}

body.hide-local-ads .feed-ad-card {
    display: none !important;
}

body.hide-local-ads .sidebar-ad-card .adsbygoogle {
    display: none !important;
}

.profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
    cursor: pointer;
}

/* ======================= */
/* LAYOUT PRINCIPAL */
/* ======================= */
.main-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 20px;
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
    min-height: calc(100vh - 80px);
}

/* ======================= */
/* SIDEBAR IZQUIERDA */
/* ======================= */
.left-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-card {
    background: var(--background-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.sidebar-card h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 16px;
}

.quimii-updates-card {
    overflow: hidden;
    padding: 14px;
    background:
      radial-gradient(130% 90% at 10% 0%, rgba(29, 161, 242, 0.14), transparent 60%),
      radial-gradient(120% 80% at 90% 100%, rgba(0, 186, 124, 0.1), transparent 62%),
      var(--background-card);
}

.feed-updates-card {
    margin-bottom: 14px;
    border: 1px solid rgba(29, 161, 242, 0.3);
    box-shadow: 0 16px 34px rgba(29, 161, 242, 0.16), var(--shadow);
}

.updates-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.updates-head h3 {
    margin: 0;
}

.updates-live-pill {
    border: 1px solid rgba(29, 161, 242, 0.4);
    color: #1da1f2;
    font-size: 10px;
    letter-spacing: 0.08em;
    font-weight: 800;
    border-radius: 999px;
    padding: 3px 8px;
    background: rgba(29, 161, 242, 0.09);
}

.updates-carousel {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(29, 161, 242, 0.26);
    min-height: 250px;
}

.updates-track {
    display: flex;
    width: 100%;
    transition: transform 0.45s cubic-bezier(.22, .61, .36, 1);
}

.updates-slide {
    min-width: 100%;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 9px;
    min-height: 250px;
    position: relative;
    isolation: isolate;
}

.updates-slide::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.15) 0%, rgba(15, 23, 42, 0.55) 100%);
}

.updates-slide::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    right: -72px;
    top: -72px;
    background: rgba(255, 255, 255, 0.12);
    filter: blur(2px);
    z-index: -1;
}

.updates-tag {
    align-self: flex-start;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
}

.updates-title {
    color: #ffffff;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.15;
    text-wrap: balance;
}

.updates-desc {
    color: rgba(255, 255, 255, 0.92);
    font-size: 14px;
    line-height: 1.5;
}

.updates-meta {
    color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
    font-weight: 600;
}

.updates-slide {
    animation: updatesPopIn 0.36s cubic-bezier(.22,.61,.36,1);
}

.updates-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease, background 0.18s ease;
    z-index: 3;
}

.updates-nav:hover {
    background: rgba(29, 161, 242, 0.8);
    transform: translateY(-50%) scale(1.06);
}

.updates-nav.prev {
    left: 8px;
}

.updates-nav.next {
    right: 8px;
}

.updates-dots {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 3;
}

.updates-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    padding: 0;
    transition: transform 0.18s ease, background 0.18s ease;
}

.updates-dot.active {
    background: #ffffff;
    transform: scale(1.25);
}

.updates-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 3;
}

.updates-progress span {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #1da1f2 0%, #34d399 100%);
    box-shadow: 0 0 14px rgba(29, 161, 242, 0.6);
    transition: width 0.08s linear;
}

@keyframes updatesPopIn {
    from {
        opacity: 0.2;
        transform: scale(0.985) translateY(6px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.home-donation-box {
    margin-top: 14px;
    border: 1px solid rgba(29, 161, 242, 0.35);
    background: linear-gradient(160deg, rgba(29, 161, 242, 0.12), rgba(29, 161, 242, 0.03));
    border-radius: 12px;
    padding: 12px;
}

.home-donation-box h4 {
    margin: 0 0 6px;
    color: var(--text-primary);
    font-size: 14px;
}

.home-donation-box p {
    margin: 0 0 8px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

.home-donation-paypal strong {
    color: var(--text-primary);
}

.home-donation-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 10px;
    padding: 8px 12px;
    border: 1px solid transparent;
    background: var(--primary-color);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.home-donation-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(29, 161, 242, 0.25);
    filter: brightness(1.03);
}

.trending-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.trending-search-wrap {
    margin-bottom: 10px;
}
.trending-search-input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13px;
    background: var(--background-light);
    color: var(--text-primary);
}
.trending-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.trend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}
.trend-item-btn {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: background 0.2s ease;
}
.trend-item-btn:hover {
    background: rgba(29, 161, 242, 0.08);
    border-radius: 8px;
}

.trend-tag {
    color: var(--primary-color);
    font-weight: 500;
    cursor: pointer;
}

.trend-count {
    font-size: 12px;
    color: var(--text-secondary);
}

.active-friends {
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* Limitar la altura del listado y permitir scroll si hay muchos amigos activos */
    max-height: 300px;
    overflow-y: auto;
    padding-right: 6px; /* espacio para la barra */
}

/* Scrollbar minimalista */
.active-friends::-webkit-scrollbar {
    width: 6px;
}
.active-friends::-webkit-scrollbar-track {
    background: transparent;
}
.active-friends::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.12);
    border-radius: 6px;
}
.active-friends::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.18);
}
/* Firefox */
.active-friends {
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.12) transparent;
}

[data-theme="dark"] .active-friends::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
}
[data-theme="dark"] .active-friends {
    scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.friend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.3s ease;
    cursor: pointer;
}

.friend-item:hover {
    background: var(--primary-color);
    color: white;
}

.friend-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.friend-info {
    flex: 1;
}

.friend-name {
    font-size: 14px;
    font-weight: 500;
}

.friend-status {
    font-size: 12px;
    opacity: 0.8;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color);
    display: inline-block;
    margin-right: 5px;
}

/* ======================= */
/* FEED PRINCIPAL */
/* ======================= */
.feed-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.create-post-card {
    background: var(--background-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.post-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    background: var(--background-light);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.post-input:hover {
    background: var(--background-card);
}

.post-actions {
    display: flex;
    gap: 10px;
    justify-content: space-around;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 20px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* ======================= */
/* MODAL CREAR POST */
/* ======================= */
.modal-post {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}
.modal-content {
  background: var(--background-light);
  border-radius: var(--radius);
  width: 95%;
  max-width: 430px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: modalIn 0.2s;
}
@keyframes modalIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px 12px 22px;
  border-bottom: 1px solid var(--border-color);
}
.modal-header h3 {
  color: var(--primary-color);
  font-size: 20px;
}
.close-modal {
  background: none;
  border: none;
  font-size: 26px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
}
.modal-body {
  padding: 18px 22px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.author-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 5px;
}
.author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-color);
}
.privacy-select {
  margin-top: 2px;
  padding: 4px 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--background-light);
  color: var(--text-primary);
  font-size: 13px;
}
.modal-media-options {
  display: flex;
  gap: 10px;
  margin-bottom: 5px;
}
.media-option-btn {
  background: var(--background-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.2s;
}
.media-option-btn:hover, .media-option-btn.active {
  background: var(--primary-color);
  color: white;
}
.poll-creator {
  background: var(--background-card);
  border-radius: 10px;
  padding: 14px 12px 10px 12px;
  border: 1px solid var(--border-color);
  margin-bottom: 0;
}
.poll-label {
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 6px;
  display: block;
}
.poll-title-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-bottom: 10px;
  font-size: 15px;
  background: var(--background-light);
  color: var(--text-primary);
}
.poll-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.poll-settings {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.poll-multi-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}
.poll-multi-toggle input {
  accent-color: var(--primary-color);
}
.poll-option-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.poll-option-input {
  flex: 1;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  font-size: 14px;
  background: var(--background-light);
  color: var(--text-primary);
}
.remove-option-btn {
  background: none;
  border: none;
  color: var(--error-color);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.2s;
}
.remove-option-btn:hover {
  background: var(--error-color);
  color: white;
}
.add-option-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 6px 16px;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  transition: background 0.2s;
}
.add-option-btn:hover {
  background: var(--primary-dark);
}
.post-textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--background-light);
  color: var(--text-primary);
  font-size: 14px;
  resize: vertical;
  margin-bottom: 10px;
}
.media-preview {
  margin-bottom: 10px;
  min-height: 60px;
}
.publish-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 10px 24px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.3s ease;
  font-size: 16px;
}
.publish-btn:hover {
  background: var(--primary-dark);
}

/* ======================= */
/* FEED DE PUBLICACIONES */
/* ======================= */
.hashtag-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.hashtag-filter-pill {
    background: rgba(29, 161, 242, 0.12);
    color: var(--text-primary);
    border: 1px solid rgba(29, 161, 242, 0.3);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 13px;
}
.clear-hashtag-filter-btn {
    border: 1px solid var(--border-color);
    background: var(--background-card);
    color: var(--text-primary);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.clear-hashtag-filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.feed-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

.loading-feed {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}
.loading-feed-minimal {
    padding: 6px 4px 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--text-secondary);
    opacity: 0.9;
}
.loading-dots::after {
    content: "...";
    display: inline-block;
    width: 1.2em;
    overflow: hidden;
    vertical-align: bottom;
    animation: loadingDots 1.1s steps(4, end) infinite;
}
.feed-container.feed-refreshing::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 0;
    width: 35%;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent 0%, #1da1f2 45%, transparent 100%);
    animation: feedLoadBar 1.1s ease-in-out infinite;
}
.feed-container.feed-refreshing::after {
    content: "Cargando publicaciones...";
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    pointer-events: none;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--text-secondary);
    background: color-mix(in srgb, var(--background-card) 88%, transparent);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 4px 10px;
    box-shadow: var(--shadow);
    animation: loadingPulse 1.1s ease-in-out infinite;
}
.feed-skeleton-card {
    height: 180px;
    border-radius: var(--radius);
    background: linear-gradient(90deg, var(--background-card) 0%, var(--background-light) 50%, var(--background-card) 100%);
    background-size: 220% 100%;
    animation: feedSkeleton 1.2s ease-in-out infinite;
    box-shadow: var(--shadow);
}
@keyframes feedLoadBar {
    0% { transform: translateX(0); opacity: 0.7; }
    50% { transform: translateX(120%); opacity: 1; }
    100% { transform: translateX(260%); opacity: 0.6; }
}
@keyframes feedSkeleton {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}
@keyframes loadingDots {
    0% { width: 0; }
    100% { width: 1.2em; }
}
@keyframes loadingPulse {
    0% { opacity: 0.55; transform: translateX(-50%) translateY(0); }
    50% { opacity: 1; transform: translateX(-50%) translateY(-1px); }
    100% { opacity: 0.55; transform: translateX(-50%) translateY(0); }
}

.post-card {
    background: var(--background-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    position: relative;
}

.post-card.optimistic-upload {
    border: 1px solid rgba(29, 161, 242, 0.35);
    box-shadow: 0 10px 30px rgba(29, 161, 242, 0.18);
}

.post-card.optimistic-upload::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    top: 0;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, #1da1f2, transparent);
    animation: optimisticPostSweep 1.05s ease-in-out infinite;
}

.post-upload-pill {
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    color: #1da1f2;
    background: rgba(29, 161, 242, 0.12);
    border: 1px solid rgba(29, 161, 242, 0.28);
}

.post-upload-pill i {
    animation: pulseIcon 0.9s ease-in-out infinite;
}

.post-action:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.home-inline-toast {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%) translateY(12px);
    opacity: 0;
    z-index: 5000;
    border-radius: 999px;
    border: 1px solid rgba(29, 161, 242, 0.4);
    background: color-mix(in srgb, var(--background-card) 85%, #1da1f2 15%);
    color: var(--text-primary);
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.home-inline-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.home-inline-toast.clickable {
    pointer-events: auto;
    cursor: pointer;
}

@keyframes optimisticPostSweep {
    0% { transform: translateX(-35%); opacity: 0.6; }
    50% { transform: translateX(0%); opacity: 1; }
    100% { transform: translateX(35%); opacity: 0.6; }
}

@keyframes pulseIcon {
    0% { opacity: 0.65; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0.65; transform: scale(0.95); }
}

.post-card.sensitive-post .post-content,
.post-card.sensitive-post .poll-card,
.post-card.sensitive-post .post-media-frame {
    filter: blur(26px);
    transition: filter 0.18s ease;
    pointer-events: none;
    user-select: none;
}

.post-card.sensitive-post.sensitive-revealed .post-content,
.post-card.sensitive-post.sensitive-revealed .poll-card,
.post-card.sensitive-post.sensitive-revealed .post-media-frame {
    filter: blur(0);
    pointer-events: auto;
    user-select: auto;
}

.sensitive-overlay {
    position: absolute;
    inset: 56px 16px 92px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 3;
}

.post-card.sensitive-post.sensitive-revealed .sensitive-overlay {
    opacity: 0;
    pointer-events: none;
}

.sensitive-reveal-btn {
    pointer-events: auto;
    border: 1px solid rgba(29, 161, 242, 0.38);
    background: rgba(15, 23, 42, 0.62);
    color: #ffffff;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(3px);
}

.sensitive-reveal-btn:hover {
    background: #1da1f2;
}

.report-thanks-overlay {
    position: fixed;
    inset: 0;
    z-index: 3300;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 14px;
}

.report-thanks-card {
    width: min(420px, 94vw);
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--background-light);
    box-shadow: 0 24px 52px rgba(0, 0, 0, 0.34);
    padding: 18px;
}

.report-thanks-card h4 {
    margin: 0 0 8px;
    color: var(--text-primary);
    font-size: 18px;
}

.report-thanks-card p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 14px;
}

.report-thanks-actions {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
}

.report-thanks-btn {
    border: none;
    border-radius: 10px;
    background: #1da1f2;
    color: #fff;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.feed-ad-card {
    border: 1px dashed var(--border-color);
    background: var(--background-card);
    padding: 14px;
}

.feed-ad-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

.feed-ad-unit {
    width: 100%;
    min-height: 120px;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.post-author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.post-author-info {
    flex: 1;
}

.post-author-name {
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.post-author-name:hover {
    text-decoration: underline;
}

.post-featured-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #1da1f2;
    background: rgba(29, 161, 242, 0.12);
    border: 1px solid rgba(29, 161, 242, 0.35);
    letter-spacing: 0.02em;
}

.post-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.post-content {
    margin-bottom: 15px;
    line-height: 1.5;
}
.hashtag-link {
    border: none;
    background: transparent;
    color: #1da1f2;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}
.hashtag-link:hover {
    text-decoration: underline;
}

.post-content a.message-link,
.poll-title a.message-link {
    color: #1da1f2;
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-all;
}

.comment-text .message-link,
.comment-reply-text .message-link {
    color: #1da1f2;
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-word;
}

.comment-text .message-link:hover,
.comment-reply-text .message-link:hover {
    color: #0d8ddb;
}

.mention-link {
    font-weight: 700;
    display: inline-block;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(29, 161, 242, 0.14);
    border: 1px solid rgba(29, 161, 242, 0.38);
    text-decoration: none;
}

.post-content a.message-link:hover,
.poll-title a.message-link:hover {
    color: #0d8ddb;
}

.comment-input.mention-typing,
.post-textarea.mention-typing {
    color: #1da1f2 !important;
    font-weight: 600;
}

.post-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    background: #0f172a;
}

.post-video {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    max-height: 100%;
    background: black;
    object-fit: contain;
}

.post-media-frame {
    width: 100%;
    min-height: 220px;
    max-height: 560px;
    height: clamp(220px, 42vw, 560px);
    margin-bottom: 15px;
    border-radius: 12px;
    overflow: hidden;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-media-frame.media-failed {
    position: relative;
}

.post-media-frame.media-failed::after {
    content: "No se pudo cargar el contenido";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(226, 232, 240, 0.78);
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.2px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
}

/* Video player: default HTML5 (sin custom UI) */

.post-stats {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.post-actions-row {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 4px;
}

.post-action {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.post-action:hover {
    background: var(--primary-color);
    color: white;
}

.post-requim-meta {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.post-action.report-sensitive-btn.reported {
    color: #e74c3c;
}

.post-action.report-sensitive-btn.reported i {
    color: #e74c3c;
}

.post-sensitive-toggle-row {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.post-sensitive-toggle-row input {
    accent-color: #e74c3c;
}

/* ======================= */
/* CHAT RAPIDO FLOTANTE */
/* ======================= */
.quick-chat-widget {
    position: fixed;
    right: 24px;
    bottom: 102px;
    z-index: 1200;
}

.quick-chat-launcher {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(145deg, #1da1f2, #0d8ddb);
    color: #fff;
    box-shadow: 0 10px 24px rgba(13, 141, 219, 0.32);
    cursor: pointer;
    font-size: 19px;
}

.quick-chat-panel {
    position: absolute;
    right: 0;
    bottom: 66px;
    width: 340px;
    max-height: 72vh;
    background: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.22);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.quick-chat-head {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: var(--background-card);
}

.quick-chat-head h4 {
    font-size: 14px;
    color: var(--text-primary);
}

.quick-chat-head-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.quick-chat-open-full,
.quick-chat-close,
.quick-chat-back {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
}

.quick-chat-open-full:hover,
.quick-chat-close:hover,
.quick-chat-back:hover {
    color: #1da1f2;
    background: rgba(29, 161, 242, 0.12);
}

.quick-chat-body {
    display: flex;
    flex-direction: column;
    min-height: 360px;
    height: 480px;
    max-height: calc(72vh - 54px);
}

.quick-chat-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 6px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.quick-chat-list::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.quick-chat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
}

.quick-chat-item:hover {
    background: var(--background-card);
}

.quick-chat-item-info {
    min-width: 0;
    flex: 1;
}

.quick-chat-avatar-wrap {
    position: relative;
}

.quick-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.quick-chat-status {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--background-light);
    background: #ccc;
}

.quick-chat-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.quick-chat-preview {
    font-size: 12px;
    color: var(--text-secondary);
}

.quick-chat-unread {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #1da1f2;
    color: #000;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.quick-chat-room {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.quick-chat-back {
    margin: 8px;
    width: auto;
    padding: 0 10px;
    justify-content: flex-start;
    gap: 6px;
}

.quick-chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.quick-chat-messages::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.quick-chat-bubble {
    max-width: 78%;
    border-radius: 14px;
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.35;
}

.quick-chat-bubble.sent {
    align-self: flex-end;
    background: #1da1f2;
    color: #fff;
}

.quick-chat-bubble.received {
    align-self: flex-start;
    background: var(--background-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.quick-chat-input-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border-top: 1px solid var(--border-color);
    background: var(--background-card);
}

.quick-chat-input {
    flex: 1;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 10px 14px;
    background: var(--background-light);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.2;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.quick-chat-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.9;
}

.quick-chat-input:focus {
    border-color: rgba(29, 161, 242, 0.45);
    box-shadow: 0 0 0 3px rgba(29, 161, 242, 0.12);
}

.quick-chat-send {
    min-width: 38px;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: #1da1f2;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.16s ease, background 0.2s ease;
}

.quick-chat-send:hover {
    background: #0d8ddb;
    transform: scale(1.04);
}

/* ======================= */
/* BOTON FLOTANTE */
/* ======================= */
/* ======================= */
.floating-action-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(29, 161, 242, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    z-index: 1000;
}

.floating-action-btn:hover {
    transform: scale(1.1);
    background: var(--primary-dark);
}

/* ======================= */
/* RESPONSIVE */
/* ======================= */
@media (max-width: 1200px) {
    .main-layout {
        grid-template-columns: 280px minmax(0, 1fr);
        gap: 15px;
    }

    .nav-center {
        gap: 20px;
    }

    .search-input {
        width: 200px;
    }

    .search-input:focus {
        width: 240px;
    }
}

@media (max-width: 968px) {
    .main-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "feed"
            "left";
    }

    .left-sidebar {
        grid-area: left;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .feed-section {
        grid-area: feed;
    }

    .nav-container {
        flex-wrap: wrap;
        gap: 15px;
    }

    .nav-center {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .search-input {
        width: 150px;
    }
}

@media (max-width: 768px) {
    .main-layout {
        padding: 0 15px;
    }

    .nav-container {
        padding: 10px 15px;
    }

    .logo-text {
        display: none;
    }

    .nav-link span {
        display: none;
    }

    .nav-link {
        padding: 10px;
    }

    .search-input {
        display: none;
    }

    .left-sidebar {
        grid-template-columns: 1fr;
    }

    .floating-action-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }

    .quick-chat-widget {
        right: 16px;
        bottom: 84px;
    }

    .quick-chat-launcher {
        width: 48px;
        height: 48px;
    }

    .quick-chat-panel {
        width: min(92vw, 360px);
        right: 0;
        bottom: 58px;
        max-height: 68vh;
    }

    .quick-chat-body {
        height: 62vh;
        min-height: 320px;
    }
}

@media (max-width: 480px) {
    .main-layout {
        padding: 0 10px;
        gap: 10px;
    }

    .nav-container {
        padding: 8px 10px;
    }

    .modal-content {
        width: 95%;
        margin: 10px;
    }

    .sidebar-card {
        padding: 15px;
    }

    .create-post-card {
        padding: 15px;
    }

    .post-card {
        padding: 15px;
    }
}

.loading {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-style: italic;
}

.hidden {
    display: none !important;
}

/* ======================= */
/* ESTILOS DE COMENTARIOS */
/* ======================= */
.comments-section {
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    margin-top: 10px;
}

.comments-container {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.loading-comments,
.no-comments {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-style: italic;
}

.comment-item {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.comment-item:hover {
    background: var(--background-light);
}

.comment-item-pending {
    opacity: 0.82;
}

.comment-pending-badge {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-secondary);
}

.comment-item.replying {
    border: 2px solid var(--primary-color);
    background: #eaf6fd;
}

.comment-actions {
    margin-top: 6px;
    display: flex;
    gap: 8px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.comment-author {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.comment-time {
    font-size: 11px;
    color: var(--text-secondary);
}

.comment-text {
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-primary);
}

.comment-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
    position: relative;
}

.comment-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--background-light);
    color: var(--text-primary);
    font-size: 14px;
}

.comment-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.comment-delete-btn,
.comment-reply-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s;
}

.comment-delete-btn:hover,
.comment-reply-btn:hover {
    background: var(--primary-color);
    color: white;
}

.comment-reply-preview {
  background: var(--primary-color, #eaf6fd);
  opacity: 0.7;
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 13px;
  display: flex;
  gap: 4px;
  align-items: center;
}
.comment-reply-author {
  font-weight: bold;
  color: #1da1f2;
}
.comment-reply-text {
  color: #333;
}

.comment-submit-btn {
  background: #1da1f2;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 16px;
  cursor: pointer;
  margin-left: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.comment-submit-btn i {
  font-size: 18px;
}
.comment-submit-btn:hover {
  background: #1482b8;
}
.comment-input-container {
  display: flex;
  align-items: center;
  gap: 0;
  position: relative;
}
.comment-input {
  flex: 1;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #ddd;
}
.comment-reply-box {
  margin-bottom: 6px;
}
.whatsapp-reply-preview {
  background: #eaf6fd;
  border-left: 4px solid #1da1f2;
  opacity: 0.95;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.whatsapp-reply-preview .reply-author {
  font-weight: bold;
  color: #1da1f2;
  margin-right: 4px;
}
.whatsapp-reply-preview .reply-text {
  color: #333;
  flex: 1;
}
.whatsapp-reply-preview .close-reply-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 16px;
  cursor: pointer;
  margin-left: 8px;
  transition: color 0.2s;
}
.whatsapp-reply-preview .close-reply-btn:hover {
  color: #1da1f2;
}

.comment-reply-inline {
    background: #eaf6fd;
    border-left: 3px solid #1da1f2;
    opacity: 0.85;
    padding: 6px 12px;
    border-radius: 7px;
    margin-bottom: 6px;
    font-size: 13px;
    display: flex;
    gap: 6px;
    align-items: center;
}

.comment-reply-inline .comment-reply-author {
    font-weight: bold;
    color: #1da1f2;
    margin-right: 4px;
}

.comment-reply-inline .comment-reply-text {
    color: #333;
    flex: 1;
}

.comment-mention-dropdown {
  position: absolute;
  left: 0;
  right: 58px;
  bottom: calc(100% + 8px);
  background: var(--background-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 8;
  max-height: 220px;
  overflow-y: auto;
}

.comment-mention-item {
  width: 100%;
  border: none;
  background: transparent;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}

.comment-mention-item span {
  color: var(--text-secondary);
  font-size: 12px;
}

.comment-mention-item.active,
.comment-mention-item:hover {
  background: rgba(29, 161, 242, 0.12);
}

.post-mention-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  background: var(--background-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 10;
  max-height: 240px;
  overflow-y: auto;
}

.post-mention-item {
  width: 100%;
  border: none;
  background: transparent;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}

.post-mention-item span {
  color: var(--text-secondary);
  font-size: 12px;
}

.post-mention-item.active,
.post-mention-item:hover {
  background: rgba(29, 161, 242, 0.12);
}

.post-shared-target {
  outline: 2px solid var(--primary-color);
  box-shadow: 0 0 0 4px rgba(29, 161, 242, 0.18);
  transition: box-shadow 0.2s ease, outline 0.2s ease;
}

.share-open {
  overflow: hidden;
}

.share-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2200;
  background: rgba(12, 20, 30, 0.38);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.share-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.share-modal {
  width: min(480px, 94vw);
  max-height: 86vh;
  overflow: auto;
  background: var(--background-light);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.share-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.share-modal-head h4 {
  font-size: 16px;
  color: var(--text-primary);
}

.share-close-btn {
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
}

.share-main-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.share-main-btn {
  border: 1px solid var(--border-color);
  background: var(--background-card);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 600;
  cursor: pointer;
}

.share-main-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.share-user-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.share-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--background-card);
}

.share-user-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.share-user-meta img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.share-user-meta span {
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-send-btn {
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--primary-color);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.share-send-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.share-loading {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  padding: 8px 0;
}

/* ======================= */
/* ESTILOS DE ENCUESTA */
/* ======================= */
.poll-card {
  background: var(--background-card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
}
.poll-title {
  font-weight: bold;
  font-size: 16px;
  color: var(--primary-color);
  margin-bottom: 10px;
}
.poll-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.poll-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: none;
  background: #eaf6fd;
  border-radius: 8px;
  padding: 8px 12px;
  gap: 12px;
  border-left: 4px solid var(--primary-color);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
[data-theme="dark"] .poll-option-row {
  background: #222c36;
  border-left: 4px solid #1da1f2;
}
.poll-option-text {
  flex: 1;
  font-size: 15px;
  color: var(--text-primary);
}
.poll-option-count {
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 22px;
  text-align: right;
}
.poll-option-row.selected {
  background: rgba(29, 161, 242, 0.2);
  box-shadow: 0 6px 16px rgba(29, 161, 242, 0.18);
  transform: translateY(-1px);
}
.poll-option-row.poll-anim {
  animation: pollPick 0.26s ease;
}
.poll-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}
@keyframes pollPick {
  0% {
    transform: scale(0.98);
  }
  60% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}
.vote-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.vote-btn:disabled {
  background: #ccc;
  color: #888;
  cursor: not-allowed;
}
.vote-btn:hover:not(:disabled) {
  background: var(--primary-dark);
}
.poll-creator {
  background: var(--background-card);
  border-radius: 10px;
  padding: 14px 12px 10px 12px;
  border: 1px solid var(--border-color);
  margin-bottom: 0;
}
.poll-label {
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 6px;
  display: block;
}
.poll-title-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-bottom: 10px;
  font-size: 15px;
  background: var(--background-light);
  color: var(--text-primary);
}
.poll-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.poll-option-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.poll-option-input {
  flex: 1;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  font-size: 14px;
  background: var(--background-light);
  color: var(--text-primary);
}
.remove-option-btn {
  background: none;
  border: none;
  color: var(--error-color);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.2s;
}
.remove-option-btn:hover {
  background: var(--error-color);
  color: white;
}
.add-option-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 6px 16px;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  transition: background 0.2s;
}
.add-option-btn:hover {
  background: var(--primary-dark);
}
.back-chat-btn {
  margin-bottom: 10px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 8px 18px;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}
.back-chat-btn:hover {
  background: var(--primary-dark);
}

/* Invitado */
.guest-mode #fab,
.guest-mode .create-post-card {
  display: none !important;
}

.auth-required-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.55);
  z-index: 10050;
}

.auth-required-card {
  width: min(480px, 94vw);
  background: var(--background-light);
  border: 1px solid rgba(29, 161, 242, 0.2);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.32);
  color: var(--text-primary);
  position: relative;
}

.auth-required-card h4 {
  margin-top: 0;
  margin-bottom: 10px;
}

.auth-required-card p {
  margin-bottom: 18px;
  color: var(--text-secondary);
}

.auth-required-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-required-btn {
  flex: 1 1 auto;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.auth-required-btn:hover {
  opacity: 0.92;
}

.auth-secondary-btn {
  background: var(--background-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.auth-required-close {
  position: absolute;
  right: 10px;
  top: 10px;
  background: transparent;
  border: none;
  font-size: 19px;
  cursor: pointer;
  color: var(--text-secondary);
}

.guest-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 18, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(8px);
}

.guest-modal {
  width: min(520px, 92vw);
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.98), rgba(11, 16, 26, 0.98));
  border: 1px solid rgba(29, 161, 242, 0.25);
  border-radius: 18px;
  padding: 24px;
  color: #e6eef8;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.45);
}

.guest-modal h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.guest-modal p {
  font-size: 14px;
  color: #b7c4d6;
  line-height: 1.6;
  margin-bottom: 18px;
}

.guest-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.guest-modal-primary,
.guest-modal-tertiary,
.guest-modal-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.guest-modal-primary {
  background: linear-gradient(135deg, rgba(29, 161, 242, 0.95), rgba(41, 205, 255, 0.95));
  color: #0b1220;
}

.guest-modal-tertiary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #e9f1ff;
}

.guest-modal-secondary {
  background: transparent;
  border-color: rgba(29, 161, 242, 0.35);
  color: #a7c6e6;
}

.guest-modal-primary:hover,
.guest-modal-tertiary:hover,
.guest-modal-secondary:hover {
  filter: brightness(1.08);
}

/* ─────────────────────────────────────────────────────────────────
   HOME SPLASH / PANTALLA DE CARGA
───────────────────────────────────────────────────────────────── */

/* La barra llega al 100% y SE QUEDA ahí — el cierre lo hace JS */
@keyframes homeSplashBarFill {
  0%   { width: 0%; }
  65%  { width: 75%; }
  100% { width: 100%; }
}
@keyframes homeSplashScaleIn {
  0%   { transform: scale(0.7); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes homeSplashFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes homeSplashTipIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Colores hardcodeados para no depender de variables CSS que aún no cargaron */
.home-splash {
  position: fixed;
  inset: 0;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
/* Tema oscuro: se aplica cuando el script inline del <head> setea data-theme antes de pintar */
[data-theme="dark"] .home-splash {
  background: #0f172a;
}
.home-splash.home-splash--exit {
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
}

.home-splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.home-splash-logo {
  width: 76px;
  height: 76px;
  animation: homeSplashScaleIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.home-splash-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.home-splash-logo-fallback {
  width: 76px;
  height: 76px;
  background: #1DA1F2;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(29, 161, 242, 0.4);
}
.home-splash-logo-fallback span {
  font-size: 38px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.home-splash-wordmark {
  font-size: 28px;
  font-weight: 700;
  /* Colores fijos para cada tema — sin depender de variables */
  color: #0b1220;
  letter-spacing: -0.5px;
  animation: homeSplashFadeUp 0.45s 0.15s ease both;
}
[data-theme="dark"] .home-splash-wordmark {
  color: #f1f5f9;
}

.home-splash-loader {
  width: 150px;
  height: 3px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
  opacity: 0;
  animation: homeSplashFadeUp 0.3s 0.3s ease forwards;
}
[data-theme="dark"] .home-splash-loader {
  background: #1e293b;
}
.home-splash-bar {
  height: 100%;
  width: 0%;
  background: #1DA1F2;
  border-radius: 99px;
  /* duración controlada por JS via --splash-duration; fallback 2.5s */
  animation: homeSplashBarFill var(--splash-duration, 2.5s) cubic-bezier(0.16, 1, 0.3, 1) 0.35s forwards;
}

.home-splash-tip {
  margin-top: 4px;
  max-width: 270px;
  text-align: center;
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.55;
  min-height: 38px;
  padding: 0 14px;
  opacity: 0;
  animation: homeSplashTipIn 0.4s 0.7s ease forwards;
}
[data-theme="dark"] .home-splash-tip {
  color: #94a3b8;
}