/* ============ TOP NAV ============ */
.top-nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h); min-height: var(--nav-h); min-height: var(--nav-h);
  background: var(--pink-dark);
  display: flex; align-items: center; gap: 6px;
  padding: 0 14px;
  z-index: 100;
  box-shadow: var(--shadow-nav);
}

.nav-logo { height: 75px; width: auto; flex-shrink: 0; cursor: pointer; }

.nav-search {
  display: flex; align-items: center;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-pill);
  padding: 4px 12px; gap: 6px; flex-shrink: 0;
}
.nav-search input {
  background: none; border: none; outline: none;
  font-size: 13px; color: var(--white); width: 110px;
  font-family: var(--font-body);
}
.nav-search input::placeholder { color: rgba(255,255,255,0.65); }
.nav-search svg { color: rgba(255,255,255,0.8); flex-shrink:0; }

.nav-icons { display: flex; align-items: center; gap: 2px; flex: 1; overflow: hidden; }

.nav-icon-btn {
  width: 45px; height: 45px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  transition: background var(--dur-fast);
  flex-shrink: 0; color: var(--white);
}
.nav-icon-btn:hover { background: rgba(255,255,255,0.2); }
.nav-icon-btn img { width: 32px; height: 32px; display: block; filter: brightness(0) invert(1); }
.nav-icon-btn svg { width: 28px; height: 28px; }
.nav-icon-btn.go-live-btn img { width: 38px; height: 38px; }

.nav-divider { width: 1px; height: 32px; background: rgba(255,255,255,0.3); flex-shrink: 0; margin: 0 2px; }

.nav-golive {
  display: flex; align-items: center; gap: 6px;
  background: var(--yellow);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  font-size: 13px; font-weight: bold; color: var(--black);
  font-family: var(--font-display);
  transition: transform var(--dur-fast) var(--ease-bounce), box-shadow var(--dur-fast);
  flex-shrink: 0; white-space: nowrap; text-decoration: none;
  letter-spacing: 0.02em;
}
.nav-golive:hover { transform: scale(1.05); box-shadow: 0 4px 20px rgba(250,212,72,0.6); background: #ffe066; }

.nav-dm, .nav-hearts {
  width: 45px; height: 45px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-pill);
  transition: background var(--dur-fast); flex-shrink: 0;
  color: var(--white);
}
.nav-dm:hover, .nav-hearts:hover { background: rgba(255,255,255,0.2); }
.nav-dm img, .nav-hearts img {  width: 32px; height: 32px;  filter: brightness(0) invert(1); }

.nav-avatar {
  width: 42px; height: 42px; flex-shrink: 0;
}
.avatar-placeholder {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 2px solid var(--white);
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: bold; color: var(--white);
}


/* ============ MOBILE ACCOUNT DROPDOWN ============ */
.mobile-account-btn {
  display: none;
  align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  cursor: pointer; flex-shrink: 0;
  transition: background var(--dur-fast);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 13px;
}
.mobile-account-btn:hover { background: rgba(255,255,255,0.35); }
.mobile-account-btn img { width: 28px; height: 28px; }

@media (max-width: 720px) {
  .mobile-account-btn { display: flex; }
}

/* ============ RESPONSIVE NAV COLLAPSE ============ */
/* Hide icons progressively as space shrinks */
@media (max-width: 1200px) {
  .nav-icons .nav-icon-btn:nth-child(n+9) { display: none; }
}
@media (max-width: 1000px) {
  .nav-icons .nav-icon-btn:nth-child(n+7) { display: none; }
  .nav-icons .nav-divider { display: none; }
}
@media (max-width: 860px) {
  .nav-icons .nav-icon-btn:nth-child(n+5) { display: none; }
}
@media (max-width: 720px) {
  .nav-icons { display: none; }
  .nav-search { display: none; }
  .nav-divider { display: none; }
  .nav-golive { padding: 6px 10px; font-size: 12px; }
}
@media (max-width: 480px) {
  .nav-golive { display: none; }
  .nav-logo { height: 52px; }
  .top-nav { min-height: var(--nav-h); padding: 0 10px; flex-wrap: nowrap; }
  .nav-avatar { display: flex !important; }
  .mobile-account-btn { display: flex !important; }
}
@media (max-width: 360px) {
  .nav-logo { height: 44px; }
  .top-nav { gap: 4px; padding: 0 8px; }
}

/* ============ LEFT SIDEBAR ============ */
.left-sidebar {
  position: fixed; top: var(--nav-h); left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--nav-h));
  background: var(--white);
  border-right: 2px solid var(--pink-light);
  display: flex; flex-direction: column;
  padding: var(--space-sm) 0; z-index: 90; overflow-y: auto;
}
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; font-size: 14px; color: var(--black);
  transition: background var(--dur-fast); cursor: pointer;
  position: relative;
}
.sidebar-item:hover { background: var(--pink-light); }
.sidebar-item.active { background: var(--yellow); font-weight: bold; }
.sidebar-item.active::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--pink-dark);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.sidebar-item img { width: 22px; height: 22px; flex-shrink: 0; }
.sidebar-item.golive { color: var(--go-live); font-weight: bold; }
.sidebar-item.golive .sidebar-dot {
  width: 10px; height: 10px; background: var(--go-live);
  border-radius: 50%; animation: pulse 2s ease-in-out infinite;
}

/* ============ RIGHT PANEL ============ */
.right-panel { z-index: 200;
  position: fixed; top: var(--nav-h); right: 0;
  width: 200px; height: calc(100vh - var(--nav-h));
  background: var(--yellow);
  border-left: 2px solid rgba(35,31,32,0.1);
  z-index: 90; overflow-y: auto;
  transform: translateX(100%);
  transition: transform var(--dur-med) var(--ease-smooth);
}
.right-panel.open { transform: translateX(0); }
.right-panel-header { background: var(--pink-dark); color: var(--white); padding: 10px 14px; font-size: 14px; font-weight: bold; }
.switch-account-section { background: rgba(35,31,32,0.12); padding: 6px 14px; font-size: 11px; font-weight: bold; letter-spacing: .06em; text-transform: uppercase; }
.right-panel-account { display: flex; align-items: center; gap: 8px; padding: 8px 14px; cursor: pointer; transition: background var(--dur-fast); }
.right-panel-account:hover { background: rgba(255,255,255,0.3); }
.right-panel-avatar { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: bold; color: var(--white); flex-shrink: 0; }
.right-panel-add { display: flex; align-items: center; gap: 6px; padding: 6px 14px; font-size: 12px; color: var(--black); cursor: pointer; }
.right-panel-add:hover { background: rgba(255,255,255,0.3); }
.right-panel-divider { height: 1px; background: rgba(35,31,32,0.15); margin: 4px 0; }
.right-panel-link { display: flex; align-items: center; gap: 8px; padding: 7px 14px; font-size: 13px; color: var(--black); cursor: pointer; transition: background var(--dur-fast); }
.right-panel-link:hover { background: rgba(255,255,255,0.35); }
.right-panel-link img { width: 16px; height: 16px; flex-shrink: 0; }
.right-panel-link.highlight { font-weight: bold; }
.right-panel-logout { display: flex; align-items: center; gap: 6px; padding: 10px 14px; font-size: 12px; color: var(--black); border-top: 1px solid rgba(35,31,32,0.15); margin-top: auto; cursor: pointer; }
.right-panel-logout:hover { background: rgba(255,255,255,0.3); }
.right-panel-logout img { width: 16px; height: 16px; }

/* ============ PAGE LAYOUT ============ */
.page-with-sidebar { padding-top: var(--nav-h); padding-left: var(--sidebar-w); min-height: 100vh; }
.page-with-sidebar.panel-open { padding-right: 200px; }

/* ============ STORIES ROW ============ */
/* ============ STORIES CAROUSEL ============ */
.stories-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 20px;
  overflow-x: auto;
  overflow-y: visible;
  background: var(--white);
  border-bottom: 1px solid var(--pink-light);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap;
  width: 100%;
  box-sizing: border-box;
}
.stories-row::-webkit-scrollbar { height: 0; width: 0; }
/* storiesContainer must flow inline with parent */
#storiesContainer {
  display: contents;
}
.story-bubble {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  flex-shrink: 0; cursor: pointer; width: 66px;
}
.story-ring {
  width: 60px; height: 60px; border-radius: 50%;
  border: 3px solid var(--pink-dark); padding: 2px;
  transition: border-color var(--dur-fast), transform var(--dur-fast) var(--ease-bounce);
}
.story-ring.unseen { border-color: var(--yellow); }
.story-ring:hover { border-color: var(--blue); transform: scale(1.08); }
.story-avatar {
  width: 100%; height: 100%; border-radius: 50%;
  background: var(--blue-light); object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 15px; font-weight: bold;
  color: var(--white); overflow: hidden;
}
.story-name {
  font-family: var(--font-display); font-size: 10px;
  color: var(--black); max-width: 66px; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ============ LENS FAB ============ */
.lens-fab {
  position: fixed; top: calc(var(--nav-h) + 80px); right: 14px;
  z-index: 94;
  width: 46px; height: 46px;
  background: var(--white); border: 2px solid var(--pink-dark);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-card); cursor: pointer; z-index: 94;
  transition: transform var(--dur-fast) var(--ease-bounce), box-shadow var(--dur-fast);
}
.lens-fab:hover { transform: scale(1.1); box-shadow: var(--shadow-pop); }
.lens-fab img { width: 28px; height: 28px; }

/* ============ MOBILE ============ */
@media (max-width: 768px) {
  .left-sidebar { display: none; }
  .page-with-sidebar { padding-left: 0; }
  .right-panel { width: 100vw; }
}
