/* ============================================================
   EVA X — DESKTOP LAYOUT (≥1024px)
   Referencia: sidebar + contenido ancho (estilo discovery desktop)
   ============================================================ */

/* Pestañas Chicas/Chicos — visibles en móvil; desktop MQ refuerza layout */
.candy-cats {
  display: flex;
}

@media (min-width: 1024px) {
  :root {
    --sidebar-w: 240px;
    --content-max: 1320px;
    --eva-bg: #000000;
    --eva-surface: #0c0c0e;
  }

  html, body {
    overflow: hidden;
    height: 100%;
  }

  body {
    flex-direction: row;
    background: var(--eva-bg);
  }

  /* ── Sidebar ── */
  #nav {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-w);
    max-width: none;
    height: 100vh;
    margin: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 2px;
    padding: 18px 14px 16px;
    border-top: none;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    background: var(--eva-bg);
    box-shadow: none;
    z-index: 120;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .nav-brand {
    display: flex;
    align-items: center;
    padding: 4px 10px 14px;
    margin-bottom: 2px;
    border-bottom: none;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #fff;
    flex-shrink: 0;
  }

  .nav-brand span {
    background: linear-gradient(135deg, #fff, var(--theme-pk, var(--pk)));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .ni-discover,
  .ni-premium {
    display: flex !important;
  }

  .ni .ni-txt {
    font-size: inherit;
    font-weight: inherit;
  }

  .ni-badge {
    margin-left: auto;
    font-size: 0.58rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    line-height: 1.2;
  }

  #nav .ni.on {
    color: var(--theme-pk, var(--pk));
    background: var(--theme-glow2, rgba(124, 58, 237, 0.12));
    box-shadow: inset 3px 0 0 var(--theme);
    border-radius: 0 10px 10px 0;
  }

  #nav .ni-premium {
    gap: 8px;
  }

  #nav .ni-premium .ni-badge {
    margin-left: 0;
  }

  /* ── Botón + Crear y menú desplegable (estilo CAI) ── */
  .nav-create-wrap {
    position: relative;
    flex-shrink: 0;
    margin-bottom: 12px;
  }

  .nav-create-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin: 0;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: #f1f5f9;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
  }

  .nav-create-btn:hover,
  .nav-create-wrap.open .nav-create-btn,
  .nav-create-wrap:hover .nav-create-btn {
    background: var(--theme-glow2, rgba(124, 58, 237, 0.15));
    border-color: color-mix(in srgb, var(--theme) 45%, transparent);
  }

  .nav-create-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 200;
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #141418;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
    animation: navMenuIn 0.16s ease;
  }

  @keyframes navMenuIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .nav-create-wrap.open .nav-create-menu,
  .nav-create-wrap:hover:not(.force-closed) .nav-create-menu {
    display: flex;
  }

  .nav-create-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #e2e8f0;
    font-size: 0.84rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .nav-create-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
  }

  .nav-create-item .nci-ico {
    width: 22px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
    opacity: 0.9;
  }

  /* Ocultar ítem “Crear” duplicado del nav inferior */
  #ni-create {
    display: none !important;
  }

  .nav-side-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    padding: 9px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
  }

  .nav-side-search svg {
    opacity: 0.45;
    flex-shrink: 0;
  }

  .nav-side-search input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #e2e8f0;
    font-size: 0.82rem;
  }

  .nav-side-search input::placeholder {
    color: #64748b;
  }

  #nav .ni {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: #94a3b8;
    transition: background 0.2s ease, color 0.2s ease;
  }

  #nav .ni svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transform: none !important;
    filter: none !important;
  }

  #nav .ni:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fda4cf;
  }

  #nav .ni.on svg {
    transform: none !important;
    filter: none !important;
  }

  #nav .ni::after {
    display: none;
  }

  .nav-spacer {
    flex: 1;
    min-height: 12px;
  }

  .nav-recent,
  .nav-groups-block {
    flex-shrink: 0;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  #nav-groups-list {
    max-height: 160px;
  }

  .nav-recent-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 0 10px 8px;
  }

  .nav-recent-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 220px;
    overflow-y: auto;
  }

  .nav-recent-empty {
    font-size: 0.75rem;
    color: #475569;
    padding: 8px 10px;
  }

  .nav-recent-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    padding-right: 22px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
    position: relative;
  }

  .nav-recent-unread-dot {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff3d8d;
    box-shadow: 0 0 0 2px rgba(15, 15, 20, 0.9);
  }

  .nav-recent-item:hover {
    background: rgba(255, 255, 255, 0.06);
  }

  .nav-recent-ava {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #7c3aed, #db2777);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
  }

  .nav-recent-ava img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .nav-recent-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .nav-recent-info b {
    font-size: 0.78rem;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav-recent-info span {
    font-size: 0.68rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav-user-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-top: 10px;
    flex-shrink: 0;
  }

  .nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease;
  }

  .nav-user:hover {
    background: rgba(255, 255, 255, 0.08);
  }

  .nav-settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    flex-shrink: 0;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  }

  .nav-settings-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 61, 141, 0.4);
    color: #fff;
  }

  .nav-user-ava {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #7c3aed, #c026d3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
  }

  .nav-user-ava img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .nav-user-name {
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* ── Main content ── */
  #app,
  .app {
    margin-left: var(--sidebar-w);
    max-width: none;
    width: calc(100% - var(--sidebar-w));
    min-height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--eva-bg);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 61, 141, 0.3) transparent;
  }

  .scr {
    padding-bottom: 32px;
  }

  /* Welcome — oculto en Candy layout */
  .desktop-welcome {
    display: none !important;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 28px 36px 8px;
    width: 100%;
  }

  .desktop-welcome-text {
    font-size: 1.05rem;
    color: #94a3b8;
    font-weight: 500;
  }

  .desktop-welcome-name {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #f8fafc;
    margin-top: 2px;
  }

  #s-explore .tb {
    display: none;
  }

  #s-explore .disc-search {
    display: none;
  }

  #s-explore .pills,
  #s-explore .disc-pills {
    display: none !important;
  }

  #s-explore .pill {
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  /* ── Pestañas superiores estilo Candy (Chicas / Chicos / +18) ── */
  .candy-cats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 20px 36px 12px;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .candy-cat {
    position: relative;
    padding: 8px 4px 12px;
    border: none;
    background: none;
    color: #94a3b8;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
  }

  .candy-cat:hover {
    color: #e2e8f0;
  }

  .candy-cat.on {
    color: #fff;
  }

  .candy-cat.on::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    border-radius: 999px;
    background: var(--accent-grad, linear-gradient(90deg, var(--theme), var(--theme-pk)));
    box-shadow: 0 0 12px var(--theme-glow, rgba(124, 58, 237, 0.35));
  }

  .candy-cat.adult.on::after {
    background: linear-gradient(90deg, #f43f5e, var(--theme-pk, var(--pk)));
  }

  .candy-home {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 28px;
    width: 100%;
    box-sizing: border-box;
  }

  .candy-hero,
  .candy-hero-wrap {
    height: 420px;
    margin: 12px 0 20px;
    width: 100%;
    box-sizing: border-box;
    border-radius: 20px;
    border-color: color-mix(in srgb, var(--theme) 20%, transparent);
  }

  .candy-hero-content {
    left: 28px;
    bottom: 28px;
    max-width: 50%;
  }

  .candy-hero-slide.is-right .candy-hero-content {
    left: auto;
    right: 28px;
    max-width: 50%;
  }

  .candy-hero-name {
    font-size: 3.15rem;
    font-style: italic;
  }

  .candy-hero-sub {
    font-size: 1.08rem;
    max-width: 420px;
    -webkit-line-clamp: unset;
  }

  .candy-hero-side {
    display: flex;
    position: absolute;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    text-align: right;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }

  .candy-hero-new {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 8px;
    background: var(--theme);
    color: #fff;
    margin-bottom: 6px;
  }

  .candy-hero-side-txt {
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    color: #fff;
    text-shadow: 0 0 30px var(--theme-glow);
    line-height: 1;
  }

  .candy-hero-side-sub {
    font-size: 0.78rem;
    color: var(--theme-pk, var(--pk));
    font-weight: 600;
  }

  .candy-ava-ring {
    width: 76px;
    height: 76px;
    padding: 3px;
  }

  .candy-ava-name {
    font-size: 0.78rem;
    max-width: 80px;
  }

  /* Nuevas experiencias */
  .candy-experiences {
    margin: 0 0 28px;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
  }

  .candy-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0 0 14px;
  }

  .candy-exp-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    width: 100%;
    box-sizing: border-box;
  }

  .candy-exp-card {
    position: relative;
    height: 300px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    padding: 0;
    background: #111;
    transition: transform 0.2s ease, border-color 0.2s ease;
  }

  .candy-exp-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 61, 141, 0.35);
  }

  .candy-exp-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.75);
    transition: filter 0.2s ease;
  }

  .candy-exp-card:hover .candy-exp-bg {
    filter: brightness(0.9);
  }

  .candy-exp-roulette {
    background: linear-gradient(135deg, #4c1d95 0%, #831843 50%, #9d174d 100%);
  }

  .candy-exp-create {
    background: linear-gradient(135deg, #1e1b4b, #581c87);
  }

  .candy-exp-groups {
    background: linear-gradient(135deg, #0f172a, #312e81);
  }

  .candy-exp-adult {
    background: linear-gradient(135deg, #450a0a, #831843, #be185d);
  }

  .candy-exp-label {
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 2;
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  }

  .candy-exp-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    background: #ef4444;
    color: #fff;
  }

  #promo-resurrection {
    margin: 24px 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
  }
  .promo-resurrection-banner {
    height: 220px;
    border-radius: 20px;
  }
  .promo-resurrection-content {
    padding: 28px 36px;
    max-width: min(600px, 62%);
  }
  .promo-resurrection-bg {
    object-position: 74% 20%;
  }

  /* Ocultar secciones CAI duplicadas en home Candy */
  #disc-featured-wrap,
  #disc-trending-wrap,
  #disc-new-wrap,
  #disc-foryou-wrap {
    display: none !important;
  }

  .disc-section {
    margin-bottom: 28px;
  }

  .disc-section-hdr {
    max-width: var(--content-max);
    margin: 0 auto 12px;
    padding: 0 36px;
  }

  .disc-section-title {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
  }

  /* Hero cards — imagen grande arriba (Para ti, Trending…) */
  .disc-hscroll.hero-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    overflow: visible;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 36px 8px;
  }

  .disc-hscroll.hero-row .xcard {
    position: relative;
    flex: none;
    width: auto;
    min-width: 0;
    min-height: 300px;
    border-radius: 16px;
    overflow: hidden;
  }

  .disc-hscroll.hero-row .xcard-bg {
    inset: 0;
    filter: blur(0) brightness(0.55);
    opacity: 0.35;
  }

  .disc-hscroll.hero-row .xcard-content {
    align-items: stretch;
    justify-content: flex-end;
    padding: 0;
    min-height: 300px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.25) 55%, transparent 100%);
  }

  .disc-hscroll.hero-row .xcard-ava {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 72%;
    margin: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  .disc-hscroll.hero-row .xcard-ava img,
  .disc-hscroll.hero-row .xcard-ava .xcard-video {
    object-fit: cover;
    object-position: top center;
  }

  .disc-hscroll.hero-row .xbody {
    align-items: flex-start;
    text-align: left;
    padding: 14px 16px 16px;
    width: 100%;
    position: relative;
    z-index: 2;
  }

  .disc-hscroll.hero-row .xname {
    text-align: left !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
  }

  .disc-hscroll.hero-row .xdesc {
    text-align: left !important;
    -webkit-line-clamp: 3 !important;
    font-size: 0.8rem !important;
    color: #cbd5e1 !important;
    line-height: 1.45 !important;
  }

  .disc-hscroll.hero-row .xtags {
    justify-content: flex-start;
  }

  .disc-hscroll.hero-row .xfollow {
    top: 10px;
    right: 10px;
  }

  /* Grid personajes — tarjetas portrait estilo Candy */
  .xlist {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 16px !important;
    padding: 0 36px 36px !important;
    max-width: var(--content-max);
    margin: 0 auto;
  }

  .xlist .xcard {
    min-height: 300px;
    border-radius: 16px;
    border-color: rgba(255, 255, 255, 0.06);
    background: var(--eva-surface);
  }

  .xlist .xcard:hover {
    border-color: rgba(255, 61, 141, 0.35);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 61, 141, 0.12);
  }

  .xlist .xcard-bg {
    inset: 0;
    filter: none;
    opacity: 1;
  }

  .xlist .xcard-content {
    padding: 0;
    min-height: 300px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, transparent 50%);
    justify-content: flex-end;
  }

  .xlist .xcard-ava {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 78%;
    margin: 0;
    border-radius: 16px 16px 0 0;
    border: none;
    box-shadow: none;
  }

  .xlist .xcard-ava img,
  .xlist .xcard-ava .xcard-video {
    object-fit: cover;
    object-position: top center;
  }

  .xlist .xbody {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 12px 14px 14px;
    text-align: left;
  }

  .xlist .xname {
    text-align: left !important;
    font-size: 0.95rem !important;
    color: #fff !important;
  }

  .xlist .xfollow {
    border-color: rgba(255, 61, 141, 0.5);
    color: var(--theme-pk, var(--pk));
  }

  .xlist .xfollow:hover {
    background: rgba(255, 61, 141, 0.2);
  }

  .disc-section-title {
    color: #f8fafc !important;
  }

  /* Grupos: visibles al filtrar "Grupos" o en vista home (JS controla display) */
  .groups-section {
    display: none;
  }

  body.disc-grupos .groups-section,
  #s-explore.disc-home-preview .groups-section {
    display: block !important;
  }

  /* Chat — columna central + panel perfil derecho */
  .chatview.on {
    left: var(--sidebar-w);
    right: 0;
    width: auto;
    display: flex;
    flex-direction: column;
  }

  #cv .cv-shell {
    flex: 1;
    min-height: 0;
  }

  #cv .cv-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    background: radial-gradient(circle at 50% 12%, rgba(168, 85, 247, 0.04), transparent 65%), #0c0c15;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
  }

  #cv .cv-main .chdr {
    max-width: 740px;
    width: 100%;
    margin: 0 auto;
    padding: 12px 20px;
    box-sizing: border-box;
    background: rgba(12, 12, 21, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 10;
  }

  #cv .cv-main .msgs {
    max-width: 740px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px 20px;
    box-sizing: border-box;
    flex: 1;
    overflow-y: auto;
  }

  #cv .cv-main .vv-bar,
  #cv .cv-main .call-active-chip {
    max-width: 740px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
  }

  #cv .cv-main .ibar {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: transparent;
    border: none;
    padding-bottom: 8px;
  }

  #cv .cv-main .ibar-inner {
    max-width: 740px;
    width: 100%;
    margin: 0 auto 12px;
    box-sizing: border-box;
  }

  #cv .cv-main .attach-panel,
  #cv .cv-main .media-draft-bar {
    max-width: 740px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
  }

  #cv .cv-profile-panel {
    display: flex !important;
    width: 360px;
    min-width: 320px;
    max-width: 380px;
    background: #0e0e1a;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    transition: all .25s ease;
  }

  #cv .cv-profile-panel.collapsed {
    display: none !important;
  }

  #cv-profile-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  #cv .cv-prof-close {
    display: flex !important;
  }

  /* Grupo — columna central + panel ajustes derecho */
  #gcv .gcv-shell {
    flex: 1;
    min-height: 0;
  }

  #gcv .gcv-main {
    flex: 1;
    min-width: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
  }

  #gcv .gcv-main .chdr,
  #gcv .gcv-main .msgs,
  #gcv .gcv-main .ibar-inner,
  #gcv .gcv-main .call-active-chip,
  #gcv .gcv-main .gcv-story-active-bar {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
  }

  #gcv .gcv-main .msgs {
    padding-bottom: 12px;
  }

  #gcv .gcv-main .ibar-inner {
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
  }

  #gcv .gcv-settings-panel {
    display: flex !important;
    width: min(340px, 32vw);
    min-width: 280px;
  }

  #gcv-settings-toggle {
    display: none !important;
  }

  .gcv-set-close {
    display: none !important;
  }

  /* Sin bloque de bienvenida duplicado — miembros en panel derecho */
  #cv .cv-main .msgs > div[style*="text-align:center"],
  #gcv .gcv-main .msgs > div[style*="text-align:center"] {
    display: none;
  }

  #s-chats .tb,
  #s-chats .clist,
  #s-profile .tb,
  #s-profile .prof-body,
  #s-create .wiz,
  #s-notes .tb,
  #s-notes .notes-wrap {
    max-width: var(--content-max);
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }

  #pwa-install-bar {
    left: calc(var(--sidebar-w) + 24px);
    right: 24px;
    bottom: 24px;
    max-width: 480px;
  }

  /* ── Panel Ajustes (estilo CAI) ── */
  .desktop-settings {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
  }

  .desktop-settings.open {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
  }

  .desktop-settings-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
  }

  .desktop-settings-panel {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    width: min(720px, calc(100vw - var(--sidebar-w) - 48px));
    max-width: 720px;
    margin: 24px 24px 24px calc(var(--sidebar-w) + 16px);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #0e0e12;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
    transform: translateX(-16px);
    opacity: 0;
    transition: transform 0.24s ease, opacity 0.24s ease;
    overflow: hidden;
    max-height: calc(100vh - 48px);
  }

  .desktop-settings.open .desktop-settings-panel {
    transform: translateX(0);
    opacity: 1;
  }

  .desktop-settings-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
  }

  .desktop-settings-hdr b {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f8fafc;
  }

  .desktop-settings-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .desktop-settings-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
  }

  .desktop-settings-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .desktop-settings-tabs {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 200px;
    flex-shrink: 0;
    padding: 14px 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    overflow-y: auto;
  }

  .dstab {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #94a3b8;
    font-size: 0.84rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .dstab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
  }

  .dstab.on {
    background: rgba(255, 61, 141, 0.15);
    color: #fda4cf;
    font-weight: 600;
  }

  .desktop-settings-body {
    flex: 1;
    overflow-y: auto;
    padding: 22px 24px 28px;
  }

  .ds-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .ds-ava {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #7c3aed, #db2777);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
  }

  .ds-ava img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .ds-field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 4px;
  }

  .ds-val {
    font-size: 0.92rem;
    color: #e2e8f0;
    font-weight: 500;
  }

  .ds-hint {
    font-size: 0.84rem;
    color: #94a3b8;
    line-height: 1.55;
    margin: 0;
  }

  .ds-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-width: 140px;
    padding: 10px 18px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.15s ease;
  }

  .ds-btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
  }

  .ds-btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
  }

  .ds-btn.danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
  }

  .ds-link {
    display: inline-block;
    margin-top: 6px;
    padding: 0;
    border: none;
    background: none;
    color: #a78bfa;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .ds-link:hover {
    color: #c4b5fd;
  }

  /* Wizard crear personaje — layout ancho escritorio */
  #s-create .wiz {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 36px 36px;
  }

  #s-create .tb {
    max-width: 640px;
    padding-left: 36px;
    padding-right: 36px;
  }
}

@media (min-width: 1400px) {
  .disc-hscroll.hero-row {
    grid-template-columns: repeat(4, 1fr);
  }

  .xlist {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

@media (min-width: 1680px) {
  .disc-hscroll.hero-row {
    grid-template-columns: repeat(5, 1fr);
  }

  .xlist {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

/* ============================================================
   SIDEBAR IN CHAT (desktop only — never apply on mobile)
   ============================================================ */
@media (min-width: 1024px) {
  body.chat-active {
    --sidebar-w: 240px;
  }

  body.chat-active #nav {
    width: 240px !important;
    padding: 18px 14px 16px !important;
    align-items: stretch !important;
    background: #0b0b14 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.07) !important;
    z-index: 100 !important;
  }

  body.chat-active .nav-brand {
    display: flex !important;
    font-size: 1.25rem !important;
    padding: 4px 10px 14px !important;
    justify-content: flex-start !important;
  }

  body.chat-active .nav-brand span,
  body.chat-active .ni-txt,
  body.chat-active .ni-badge,
  body.chat-active .nav-create-btn span,
  body.chat-active .nav-user-name,
  body.chat-active .nav-groups-hdr {
    display: inline-block !important;
  }

  body.chat-active .nav-create-btn {
    width: 100% !important;
    border-radius: 12px !important;
    height: auto !important;
    padding: 11px 16px !important;
    justify-content: center !important;
    font-size: .88rem !important;
    font-weight: 700 !important;
  }

  body.chat-active .ni {
    justify-content: flex-start !important;
    padding: 10px 14px !important;
    width: 100% !important;
  }

  body.chat-active .ni svg {
    margin-right: 12px !important;
    width: 20px !important;
    height: 20px !important;
  }
}

/* Mobile: ocultar elementos solo-desktop (keep candy-cats visible) */
@media (max-width: 1023px) {
  .nav-brand,
  .nav-create-wrap,
  .nav-side-search,
  .nav-spacer,
  .nav-recent,
  .nav-groups-block,
  .nav-user-row,
  .ni-discover,
  .ni-premium,
  .desktop-welcome,
  .desktop-settings {
    display: none !important;
  }

  /* Chicas / Chicos / +18 for phone discover */
  .candy-cats {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 10px 16px 6px;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .candy-cat {
    position: relative;
    padding: 6px 2px 10px;
    border: none;
    background: none;
    color: #94a3b8;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
  }

  .candy-cat.on {
    color: #fff;
  }

  .candy-cat.on::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--theme, #7c3aed), var(--pk, #c026d3));
  }
}