/* ============================================================
   desk-shell.css — VoxLounge DESKTOP SHELL (qid:651, Phase 0)
   ONE nav, TWO styles. The SAME #bottom-nav element is the minimal bottom bar
   on mobile (unchanged) and, at >=1024px, a persistent collapsible LEFT
   SIDEBAR — except inside a live room, where it flips BACK to the minimal
   bottom bar so the stage goes full-width (never leave the live).
   Nothing here runs below 1024px, so the phone app is byte-for-byte unchanged.
   The room flip keys off body[data-view="room"] (set by VoxShell).
   All colour/shape tokens come from theme.css so it themes in both palettes.
   ============================================================ */

:root {
  --desk-sidebar-w: 244px;
  --desk-sidebar-w-collapsed: 68px;
  --desk-sidebar-cur: var(--desk-sidebar-w);
  --feed-rail-zone: 324px;   /* feed-desk.css right rail: 304px width + 20px inset */
}
body.desk-collapsed { --desk-sidebar-cur: var(--desk-sidebar-w-collapsed); }

/* Desktop-only chrome (brand / go-live label / me-chip / collapse pin) is
   injected into #bottom-nav by VoxShell and hidden everywhere by default so
   the mobile bottom bar never shows it. */
.nav-desk-only { display: none; }

@media (min-width: 1024px) {

  /* ── the one nav, DESKTOP style = left sidebar (NOT while in a room) ───── */
  body:not([data-view="room"]) .bottom-nav:not(.hidden) {
    top: 0; bottom: 0; left: 0; right: auto;
    width: var(--desk-sidebar-cur);
    height: 100dvh; padding: 15px 12px;
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 3px;
    border-top: none; border-right: 1px solid var(--border-color);
    background: var(--bg-primary, #0c0c14);
    background: color-mix(in srgb, var(--bg-primary, #0c0c14) 92%, transparent);
    overflow: hidden;
    transition: width .18s ease;
  }

  /* reveal the desktop chrome inside the sidebar */
  body:not([data-view="room"]) .bottom-nav .nav-desk-only { display: flex; }

  /* nav items: icon-over-label (mobile) -> icon+label row (desktop) */
  body:not([data-view="room"]) .bottom-nav .nav-item {
    flex: 0 0 auto; flex-direction: row; justify-content: flex-start;
    gap: 13px; width: 100%; padding: 11px 12px;
    border-radius: var(--radius, 10px);
    transition: background .14s, color .14s;
  }
  body:not([data-view="room"]) .bottom-nav .nav-item .nav-ic { width: 21px; height: 21px; flex: 0 0 auto; }
  body:not([data-view="room"]) .bottom-nav .nav-item .nav-label { font-size: 14px; font-weight: 600; letter-spacing: 0; white-space: nowrap; }
  body:not([data-view="room"]) .bottom-nav .nav-item:hover { background: rgba(var(--accent-primary-rgb), 0.08); color: var(--text-primary); }
  body:not([data-view="room"]) .bottom-nav .nav-item.active { color: var(--text-primary); background: rgba(var(--accent-primary-rgb), 0.14); box-shadow: inset 2px 0 0 var(--accent-primary); }
  body:not([data-view="room"]) .bottom-nav .nav-item.active .nav-ic { filter: drop-shadow(0 0 6px rgba(var(--accent-primary-rgb), 0.5)); }

  /* badge rides the row, not the mobile center */
  body:not([data-view="room"]) .bottom-nav .nav-item .nav-badge { position: static; margin-left: auto; }

  /* vertical order: brand, Feed, Rooms, Messages, Profile, GO LIVE, (push) me */
  body:not([data-view="room"]) .bottom-nav .nav-brand    { order: 0; }
  body:not([data-view="room"]) .bottom-nav #nav-home     { order: 1; }
  body:not([data-view="room"]) .bottom-nav #nav-live     { order: 2; }
  body:not([data-view="room"]) .bottom-nav #nav-messages { order: 3; }
  body:not([data-view="room"]) .bottom-nav #nav-profile  { order: 4; }
  body:not([data-view="room"]) .bottom-nav #nav-create   { order: 5; }
  body:not([data-view="room"]) .bottom-nav .nav-me       { order: 6; margin-top: auto; }

  /* GO LIVE: round center FAB -> full-width CTA */
  body:not([data-view="room"]) .bottom-nav .nav-create {
    width: 100%; height: auto; align-self: stretch; margin: 7px 0 2px;
    flex-direction: row; justify-content: center; gap: 9px;
    border-radius: var(--radius, 10px); padding: 11px;
    font-family: var(--font-heading, inherit); font-weight: 800; font-size: 13px; letter-spacing: .05em;
    color: #05060a; box-shadow: 0 4px 16px rgba(var(--accent-primary-rgb), 0.35);
  }
  body:not([data-view="room"]) .bottom-nav .nav-create svg { width: 18px; height: 18px; }
  body:not([data-view="room"]) .bottom-nav .nav-create:hover { filter: brightness(1.08); }

  /* brand */
  .bottom-nav .nav-brand {
    align-items: center; gap: 9px; padding: 4px 8px 8px;
    font-family: var(--font-heading, inherit); font-weight: 800; font-size: 18px; letter-spacing: .04em;
    color: var(--text-primary);
  }
  .bottom-nav .nav-brand-spark {
    width: 10px; height: 10px; border-radius: 2px; flex: 0 0 auto;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary, var(--accent-primary)));
    box-shadow: 0 0 8px var(--accent-primary);
    animation: nav-breathe 2.6s ease-in-out infinite;
  }
  @keyframes nav-breathe { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(.8); } }
  .bottom-nav .nav-collapse {
    margin-left: auto; width: 26px; height: 26px; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    background: none; border: 1px solid transparent; border-radius: 7px;
    color: var(--text-secondary); cursor: pointer; font-size: 15px;
    transition: background .14s, color .14s, border-color .14s;
  }
  .bottom-nav .nav-collapse:hover { background: rgba(var(--accent-primary-rgb), 0.08); color: var(--text-primary); border-color: var(--border-color); }

  /* me-chip */
  .bottom-nav .nav-me {
    align-items: center; gap: 10px; padding: 10px 6px 2px;
    border-top: 1px solid var(--border-color); cursor: pointer;
  }
  .bottom-nav .nav-me-av {
    width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary, var(--accent-primary)));
    background-size: cover; background-position: center;  /* MUST follow the shorthand — it resets background-size */
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 14px; color: #05060a;
  }
  .bottom-nav .nav-me-meta { min-width: 0; }
  .bottom-nav .nav-me-name { font-size: 13px; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bottom-nav .nav-me-sub { font-size: 11px; color: var(--text-dim, var(--text-secondary)); display: flex; align-items: center; gap: 5px; }
  .bottom-nav .nav-me-dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; background: var(--accent-success, #39d98a); box-shadow: 0 0 6px var(--accent-success, #39d98a); }
  .bottom-nav .nav-me-dot.offline { background: var(--text-dim, #6b7280); box-shadow: none; }

  /* ── settings gear + sign-out footer (qid:651): the lobby-header strip, moved into
       the sidebar so Settings/Sign-out are reachable from every view ─────────────── */
  body:not([data-view="room"]) .bottom-nav .nav-foot-actions {
    order: 7; display: flex; gap: 8px; align-items: center; padding: 8px 6px 4px; margin-top: 4px;
  }
  .bottom-nav .nav-gear, .bottom-nav .nav-signout {
    width: 36px; height: 36px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02); color: var(--text-secondary);
    font-size: 17px; cursor: pointer;
    transition: transform .16s ease, background .14s, color .14s, border-color .14s;
  }
  .bottom-nav .nav-gear:hover {
    background: rgba(var(--accent-primary-rgb), 0.1); color: var(--text-primary);
    border-color: rgba(var(--accent-primary-rgb), 0.4); transform: rotate(45deg);
  }
  .bottom-nav .nav-signout:hover {
    background: rgba(255, 77, 79, 0.12); color: var(--accent-danger, #ff6b6b);
    border-color: rgba(255, 77, 79, 0.4);
  }
  /* collapsed rail: stack the two icons vertically */
  body.desk-collapsed:not([data-view="room"]) .bottom-nav .nav-foot-actions { flex-direction: column; }
  /* the lobby-header Settings + Sign Out are now redundant on desktop — hide them there */
  body:not([data-view="room"]) .lobby-header #btn-settings,
  body:not([data-view="room"]) .lobby-header #btn-logout { display: none; }

  /* ── collapsed: icons only ─────────────────────────────────────────────── */
  body.desk-collapsed:not([data-view="room"]) .bottom-nav .nav-item .nav-label,
  body.desk-collapsed:not([data-view="room"]) .bottom-nav .nav-brand > span:not(.nav-brand-spark):not(.nav-collapse),
  body.desk-collapsed:not([data-view="room"]) .bottom-nav .nav-create .nav-create-label,
  body.desk-collapsed:not([data-view="room"]) .bottom-nav .nav-me-meta { display: none; }
  /* keep the collapse control visible when collapsed — it IS the expand toggle */
  body.desk-collapsed:not([data-view="room"]) .bottom-nav .nav-collapse { margin-left: 0; }
  body.desk-collapsed:not([data-view="room"]) .bottom-nav .nav-item,
  body.desk-collapsed:not([data-view="room"]) .bottom-nav .nav-create,
  body.desk-collapsed:not([data-view="room"]) .bottom-nav .nav-me { justify-content: center; }
  body.desk-collapsed:not([data-view="room"]) .bottom-nav .nav-brand { justify-content: center; padding-left: 0; padding-right: 0; }

  /* ── inset every (non-room) view by the current sidebar width ──────────── */
  body:not([data-view="room"]) .view.active { padding-left: var(--desk-sidebar-cur); transition: padding-left .18s ease; }

  /* keep the sidebar visible inside an open DM thread on desktop (there is an
     all-width `body.dm-thread-active .bottom-nav{display:none}` rule meant for
     the mobile composer — it must not blank the desktop sidebar). */
  body:not([data-view="room"]).dm-thread-active .bottom-nav { display: flex; }

  /* Feed column centering (qid:651 Phase 0 polish). .feed-card is
     `max-width:460px; margin:0 auto` inside #feed-scroll, which spans the WHOLE
     post-sidebar width — including the zone the fixed right rail floats over —
     so the card centered as if the rail weren't there (fat left gutter, card
     shoved toward the rail). Reserve the rail's zone on the scroll column so the
     auto-centering lands in the TRUE free space between sidebar and rail. */
  body:not([data-view="room"]) #feed-view .feed-scroll { padding-right: var(--feed-rail-zone); }

  /* Center the feed's own topbar over that same free space:
     free zone = [sidebar, 100% - rail-zone]; its center = 50% + (sidebar - rail)/2. */
  body:not([data-view="room"]) #feed-view > .feed-topbar {
    left: calc(50% + ((var(--desk-sidebar-cur) - var(--feed-rail-zone)) / 2));
    transition: left .18s ease;   /* slide in sync with the view inset on collapse, don't jump */
  }
}

/* ── Profile section desktop header band + grid (qid:651 Phase 1) ──────────── */
@media (min-width: 1024px) {
  body:not([data-view="room"]) #profile-view .profile-page { max-width: 880px; padding-top: 30px; }
  body:not([data-view="room"]) #profile-view .profile-top { gap: 22px; margin-bottom: 16px; }
  body:not([data-view="room"]) #profile-view .profile-avatar {
    flex: 0 0 108px; width: 108px; height: 108px; font-size: 42px;
  }
  body:not([data-view="room"]) #profile-view .profile-name { font-size: 26px; }
  body:not([data-view="room"]) #profile-view .profile-username { font-size: 15px; }
  body:not([data-view="room"]) #profile-view .profile-bio { font-size: 15px; max-width: 620px; }
  body:not([data-view="room"]) #profile-view .profile-stats { max-width: 420px; }
  body:not([data-view="room"]) #profile-view .profile-actions { max-width: 420px; }
  /* wider, denser post grid on desktop */
  body:not([data-view="room"]) #profile-view .profile-posts {
    grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 8px;
  }
  body:not([data-view="room"]) #profile-view .profile-cell { border-radius: 10px; }
}

/* ═══ Profile DANK build-out (qid:651) — base, applies mobile + desktop ════ */
.profile-cover {
  height: 124px; border-radius: 16px; margin: 2px 0 -46px;
  background: linear-gradient(120deg, var(--accent-primary), var(--accent-secondary, var(--accent-primary)) 55%, var(--accent-tertiary, var(--accent-secondary, var(--accent-primary))));
  background-size: 220% 220%; animation: profile-cover-shift 10s ease-in-out infinite;
  position: relative; overflow: hidden;
  box-shadow: inset 0 -46px 60px -24px rgba(0,0,0,.6);
}
.profile-cover::after { content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 28% 18%, rgba(255,255,255,.22), transparent 55%); }
@keyframes profile-cover-shift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

#profile-head .profile-top { position: relative; z-index: 2; align-items: flex-end; padding: 0 2px; }
#profile-head .profile-avatar {
  border: 3px solid var(--bg-primary, #0c0c14);
  box-shadow: 0 0 0 2px var(--accent-primary), 0 10px 26px rgba(0,0,0,.55);
  position: relative;
}
#profile-head .profile-name { text-shadow: 0 1px 10px rgba(0,0,0,.5); }
.profile-presence {
  position: absolute; right: 3px; bottom: 3px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent-success, #39d98a); border: 2.5px solid var(--bg-primary, #0c0c14);
  box-shadow: 0 0 8px var(--accent-success, #39d98a);
}
#profile-head .profile-stat { transition: transform .14s, border-color .14s, background .14s; }
#profile-head .profile-stat:hover { transform: translateY(-2px); border-color: var(--border-hover, var(--accent-primary)); background: rgba(var(--accent-primary-rgb), 0.07); }
#profile-head .profile-follow { background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary, var(--accent-primary))); border: none; color: #05060a; font-weight: 800; }
#profile-head .profile-follow.following { background: transparent; color: var(--text-primary); border: 1.5px solid var(--border-hover, rgba(255,255,255,.4)); }
#profile-head .profile-edit { border: 1.5px solid var(--border-hover, var(--accent-primary)); background: rgba(var(--accent-primary-rgb), 0.08); color: var(--text-primary); font-weight: 700; }
#profile-head .profile-edit:hover { background: rgba(var(--accent-primary-rgb), 0.16); }
#profile-posts .profile-cell { transition: transform .18s, box-shadow .18s; }
#profile-posts .profile-cell:hover { transform: scale(1.03); box-shadow: 0 8px 22px rgba(0,0,0,.55); z-index: 2; }

@media (min-width: 1024px) {
  body:not([data-view="room"]) #profile-view .profile-cover { height: 184px; margin-bottom: -56px; }
  body:not([data-view="room"]) #profile-view .profile-avatar { margin-bottom: 4px; }
}

/* ═══ Alive-profile (qid:651) — live badge, live ring, drop-in CTA ═════════ */
.profile-live-pill {
  position: absolute; top: 12px; right: 14px; z-index: 3;
  display: flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px; border: none; cursor: pointer;
  background: rgba(10,10,16,.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: #fff; font-family: var(--font-heading, inherit); font-weight: 800; font-size: 11px; letter-spacing: .08em;
  box-shadow: 0 2px 10px rgba(0,0,0,.4);
}
.profile-live-pill .plp-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff3b5c; box-shadow: 0 0 8px #ff3b5c; animation: plp-pulse 1.4s ease-in-out infinite; }
@keyframes plp-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.7); } }

#profile-head .profile-avatar.is-live { animation: live-ring 1.8s ease-in-out infinite; }
@keyframes live-ring {
  0%,100% { box-shadow: 0 0 0 2px #ff3b5c, 0 0 14px rgba(255,59,92,.45), 0 10px 26px rgba(0,0,0,.55); }
  50%     { box-shadow: 0 0 0 3px #ff3b5c, 0 0 28px rgba(255,59,92,.75), 0 10px 26px rgba(0,0,0,.55); }
}

.profile-live-cta {
  display: flex; align-items: center; gap: 10px; width: 100%; max-width: 420px;
  margin: 2px 0 14px; padding: 12px 15px; border-radius: 12px; cursor: pointer; text-align: left;
  background: linear-gradient(135deg, rgba(255,59,92,.18), rgba(255,59,92,.06));
  border: 1px solid rgba(255,59,92,.5); color: var(--text-primary);
  font-weight: 700; font-size: 14px; transition: background .14s, transform .12s;
}
.profile-live-cta:hover { background: linear-gradient(135deg, rgba(255,59,92,.3), rgba(255,59,92,.12)); transform: translateY(-1px); }
.profile-live-cta .plc-pulse { width: 10px; height: 10px; border-radius: 50%; background: #ff3b5c; box-shadow: 0 0 10px #ff3b5c; flex: 0 0 auto; animation: plp-pulse 1.4s ease-in-out infinite; }
.profile-live-cta .plc-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-live-cta .plc-arrow { font-size: 18px; color: #ff6b84; flex: 0 0 auto; }

/* Live COVER video (qid:651) — the owner's room plays in the banner when they're live. Sits above
   the gradient (0) + its ::after highlight, below the avatar/name (2) and the LIVE pill (3). */
.profile-cover-media { position: absolute; inset: 0; z-index: 1; border-radius: 16px; overflow: hidden; background: #05060a; }
.profile-cover.has-live-video { animation: none; }               /* hold the gradient still behind video */
.profile-cover.has-live-video::after { opacity: .3; }            /* ease the white highlight over the feed */
.profile-cover-media .vox-tile { background: transparent; }
/* Owner-only "just me ↔ all cams" toggle on the cover (sits opposite the LIVE pill). */
.profile-cover-toggle {
  position: absolute; left: 12px; top: 12px; z-index: 3;
  padding: 4px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.28); background: rgba(10,10,16,.55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: #fff; font-family: var(--font-heading, inherit); font-weight: 700; font-size: 10px; letter-spacing: .06em;
}
.profile-cover-toggle.on { border-color: var(--accent-primary); color: var(--accent-primary); }

/* ═══ Feed GRID layout (qid:650) — OPT-IN via Settings (vox-feed-layout=grid), DESKTOP only ═══════
   Purely a class on #feed-view; the feed.js render path (#feed-scroll) is untouched. Column stays
   the default. The grid fills the TRUE free zone between the sidebar and the right rail. */
@media (min-width: 1024px) {
  body:not([data-view="room"]) #feed-view.feed-grid .feed-scroll {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px; align-content: start;
    padding: 70px 24px 28px;
    padding-right: calc(var(--feed-rail-zone) + 24px);   /* keep the right rail clear */
    scroll-snap-type: none;
  }
  #feed-view.feed-grid .feed-card {
    max-width: none; margin: 0; width: auto; height: auto;
    aspect-ratio: 3 / 4; border: none; border-radius: 16px;
    scroll-snap-align: none; scroll-snap-stop: unset;
    box-shadow: 0 8px 26px rgba(0, 0, 0, .45);
    transition: transform .16s, box-shadow .16s;
  }
  #feed-view.feed-grid .feed-card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(0, 0, 0, .6); }
}
