/* ==========================================================================
   Snapchat Story Viewer & Downloader - Master Stylesheet
   Modern, Ultra-responsive Vanilla CSS Design System
   ========================================================================== */

:root {
  /* Color Tokens - Dark Mode (Default) */
  --bg-primary: #0a0b0e;
  --bg-secondary: #121318;
  --bg-card: #181920;
  --bg-card-hover: #1f212b;
  --bg-input: #121319;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(255, 252, 0, 0.3);
  --border-accent: rgba(255, 252, 0, 0.5);

  --text-primary: #ffffff;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --accent-yellow: #fffc00;
  --accent-yellow-dark: #e6e300;
  --accent-yellow-glow: rgba(255, 252, 0, 0.35);
  --accent-amber: #f59e0b;
  --accent-gradient: linear-gradient(135deg, #fffc00 0%, #ff8c00 50%, #e11d48 100%);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.8);
  --shadow-yellow: 0 0 25px rgba(255, 252, 0, 0.25);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #ffffff;
  --border-subtle: rgba(0, 0, 0, 0.1);
  --border-highlight: rgba(245, 158, 11, 0.4);
  --border-accent: rgba(245, 158, 11, 0.8);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --accent-yellow: #f59e0b;
  --accent-yellow-dark: #d97706;
  --accent-yellow-glow: rgba(245, 158, 11, 0.25);
  --accent-amber: #d97706;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 35px rgba(0, 0, 0, 0.12);
  --shadow-yellow: 0 0 20px rgba(245, 158, 11, 0.2);
}

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

html, body {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
}

/* ==========================================================================
   Header & Top Navigation
   ========================================================================== */
.site-header {
  width: 100%;
  background: linear-gradient(180deg, #111218 0%, #0d0e13 100%);
  border-bottom: 1px solid var(--border-highlight);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  padding: 1.25rem 0 2rem;
  position: relative;
  z-index: 50;
}

[data-theme="light"] .site-header {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  margin-bottom: 1.5rem;
  gap: 0.85rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   Language Selector Dropdown
   ========================================================================== */
.lang-dropdown {
  position: relative;
  display: inline-flex;
}

.lang-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  user-select: none;
  line-height: 1;
}

.lang-dropdown-trigger:hover,
.lang-dropdown.open .lang-dropdown-trigger {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 252, 0, 0.4);
  box-shadow: 0 0 14px rgba(255, 252, 0, 0.15);
}

[data-theme="light"] .lang-dropdown-trigger {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
}

[data-theme="light"] .lang-dropdown-trigger:hover,
[data-theme="light"] .lang-dropdown.open .lang-dropdown-trigger {
  background: rgba(0, 0, 0, 0.07);
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.15);
}

.lang-current-label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.lang-chevron {
  width: 0.95rem;
  height: 0.95rem;
  color: var(--text-secondary);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.lang-dropdown.open .lang-chevron {
  transform: rotate(180deg);
  color: var(--accent-yellow);
}

[data-theme="light"] .lang-dropdown.open .lang-chevron {
  color: #d97706;
}

/* Dropdown Floating Menu */
.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 175px;
  background: #14161f;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 252, 0, 0.12);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.96);
  transform-origin: top right;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Pointer arrow notch at top */
.lang-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 18px;
  width: 10px;
  height: 10px;
  background: #14161f;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  transform: rotate(45deg);
  z-index: 1;
}

[data-theme="light"] .lang-dropdown-menu {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .lang-dropdown-menu::before {
  background: #ffffff;
  border-left: 1px solid rgba(0, 0, 0, 0.12);
  border-top: 1px solid rgba(0, 0, 0, 0.12);
}

.lang-dropdown.open .lang-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.55rem 0.8rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: left;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  line-height: 1;
  position: relative;
  z-index: 2;
}

.lang-option:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

[data-theme="light"] .lang-option:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

.lang-option.active {
  background: rgba(255, 252, 0, 0.12);
  color: var(--accent-yellow);
  font-weight: 700;
}

[data-theme="light"] .lang-option.active {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.lang-option-text {
  flex: 1;
}

.lang-check-icon {
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.15s ease;
}

.lang-option.active .lang-check-icon {
  opacity: 1;
  transform: scale(1);
  color: var(--accent-yellow);
}

[data-theme="light"] .lang-option.active .lang-check-icon {
  color: #d97706;
}

.lang-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 13px;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
  vertical-align: middle;
}

.lang-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.theme-toggle-wrap {
  display: flex;
  align-items: center;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 252, 0, 0.1);
  border: 1px solid rgba(255, 252, 0, 0.3);
  color: var(--accent-yellow);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.theme-toggle-btn:hover {
  background: rgba(255, 252, 0, 0.2);
  border-color: var(--accent-yellow);
}

.sun-icon, .moon-icon {
  width: 1.15rem;
  height: 1.15rem;
}

[data-theme="dark"] .moon-icon { display: none; }
[data-theme="dark"] .sun-icon { display: inline-block; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: inline-block; }

/* Brand Hero */
.brand-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  text-align: left;
}

.brand-logo-container {
  cursor: pointer;
  transition: transform 0.25s ease;
}

.brand-logo-container:hover {
  transform: scale(1.05);
}

.logo-box {
  width: 58px;
  height: 58px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  filter: drop-shadow(0 4px 14px rgba(255, 252, 0, 0.4));
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
}

.brand-logo-container:hover .logo-box {
  filter: drop-shadow(0 6px 20px rgba(255, 252, 0, 0.65));
}

.logo-snap-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ==========================================================================
   Search Hero & Main Search Page
   ========================================================================== */
.main-content {
  flex: 1;
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

.view-section {
  width: 100%;
}

.search-hero {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 3rem;
}

.search-headline {
  font-size: 2.15rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
}

.search-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 2rem;
}

/* Search Input Form */
.search-form {
  width: 100%;
  margin-bottom: 0;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.45rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
}

.search-input-wrapper:focus-within {
  border-color: var(--accent-yellow);
  box-shadow: 0 0 0 3px var(--accent-yellow-glow), var(--shadow-md);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-family: inherit;
  padding: 0.75rem 1.25rem;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-submit-btn {
  background: var(--accent-yellow);
  color: #000000;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  padding: 0.85rem 2.25rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(255, 252, 0, 0.3);
}

.search-submit-btn:hover {
  background: #ffffff;
  color: #000;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 252, 0, 0.5);
}

.search-submit-btn:active {
  transform: translateY(0);
}

.search-helper-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* Quick Try Chips */
.quick-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.quick-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.chip-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.825rem;
  font-weight: 600;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.chip-btn:hover {
  background: rgba(255, 252, 0, 0.15);
  border-color: var(--accent-yellow);
  color: var(--accent-yellow);
  transform: translateY(-1px);
}

/* Promo Banner */
.promo-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

.promo-banner strong {
  color: #38bdf8;
  font-weight: 700;
}

.promo-fire {
  font-size: 1.1rem;
}

/* ==========================================================================
   Saved Profiles Carousel Section
   ========================================================================== */
.saved-profiles-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-md);
  margin-top: 1rem;
}

.saved-profiles-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.saved-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.saved-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.saved-count-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-yellow);
}

.carousel-nav-arrows {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.arrow-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.arrow-btn:hover {
  background: rgba(255, 252, 0, 0.2);
  color: var(--accent-yellow);
  border-color: var(--accent-yellow);
}

.arrow-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Carousel Track */
.carousel-outer {
  overflow: hidden;
  position: relative;
  width: 100%;
}

.saved-profiles-track {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 0.5rem 0.25rem;
}

.saved-profiles-track::-webkit-scrollbar {
  display: none;
}

.saved-profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  cursor: pointer;
  flex-shrink: 0;
  width: 88px;
  transition: var(--transition);
  position: relative;
}

.saved-profile-card:hover {
  transform: translateY(-3px);
}

.saved-avatar-wrap {
  position: relative;
  width: 72px;
  height: 72px;
}

.saved-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.15);
  transition: var(--transition);
}

.saved-profile-card:hover .saved-avatar-img {
  border-color: var(--accent-yellow);
  box-shadow: 0 0 12px var(--accent-yellow-glow);
}

.saved-star-badge {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  background: #111217;
  border: 1.5px solid var(--accent-yellow);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-yellow);
  font-size: 0.75rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.saved-profile-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Active Story Glow Ring */
.saved-avatar-wrap.has-story-ring {
  box-sizing: border-box;
  padding: 3px;
  background: linear-gradient(135deg, #FFFC00 0%, #FFA800 60%, #FF2A6D 100%);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 252, 0, 0.45);
  animation: storyRingPulse 2.5s infinite ease-in-out;
}

@keyframes storyRingPulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(255, 252, 0, 0.35);
  }
  50% {
    box-shadow: 0 0 15px rgba(255, 252, 0, 0.7);
  }
}

.saved-avatar-wrap.has-story-ring .saved-avatar-img {
  border: 2px solid #111217;
}

.saved-story-time-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: var(--accent-yellow);
  color: #0b0c10;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  letter-spacing: -0.2px;
  border: 1.5px solid #111217;
  z-index: 2;
  white-space: nowrap;
}

.saved-profile-time {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-yellow);
  letter-spacing: -0.2px;
  margin-top: -3px;
}

.saved-profiles-footer-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: left;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Profile View & Stories Feed
   ========================================================================== */
.back-nav {
  margin-bottom: 1.5rem;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  padding: 0.4rem 0;
}

.back-btn:hover {
  color: var(--accent-yellow);
  transform: translateX(-3px);
}

.back-btn svg {
  width: 1.3rem;
  height: 1.3rem;
}

/* Profile Card */
.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 2.25rem;
  gap: 1.25rem;
}

.profile-avatar-wrap {
  position: relative;
  cursor: pointer;
  transition: var(--transition);
}

.profile-avatar-wrap:hover {
  transform: scale(1.04);
}

.avatar-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  padding: 4px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 25px rgba(255, 252, 0, 0.25);
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #000;
  border: 3px solid var(--bg-primary);
}

.avatar-play-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: var(--accent-yellow);
  color: #000;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.avatar-play-badge svg {
  width: 18px;
  height: 18px;
  margin-left: 2px;
}

.profile-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.profile-display-name {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.star-bookmark-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.star-bookmark-btn:hover {
  background: rgba(255, 252, 0, 0.2);
  border-color: var(--accent-yellow);
  color: var(--accent-yellow);
  transform: scale(1.1);
}

.star-bookmark-btn.saved {
  background: rgba(255, 252, 0, 0.2);
  border-color: var(--accent-yellow);
  color: var(--accent-yellow);
}

.star-bookmark-btn.saved .star-icon {
  fill: var(--accent-yellow);
}

.star-icon {
  width: 1.3rem;
  height: 1.3rem;
}

.profile-handle {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.profile-instruction-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.profile-tags {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.tag-pill {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.location-pill {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}

.profile-bio {
  max-width: 500px;
  font-size: 0.925rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  line-height: 1.4;
}

/* ==========================================================================
   Tabs Navigation
   ========================================================================== */
.tabs-container {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.tabs-pill-list {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.3rem;
  gap: 0.3rem;
}

.tab-item {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 700;
  padding: 0.65rem 1.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tab-item:hover {
  color: var(--text-primary);
}

.tab-item.active {
  background: var(--bg-card);
  color: var(--accent-yellow);
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .tab-item.active {
  background: #ffffff;
  color: var(--accent-yellow);
}

.tab-counter {
  font-size: 0.9rem;
  opacity: 0.85;
}

/* ==========================================================================
   Stories Grid & Content
   ========================================================================== */
.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.pane-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}

.play-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 252, 0, 0.15);
  border: 1px solid var(--border-accent);
  color: var(--accent-yellow);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.play-all-btn:hover {
  background: var(--accent-yellow);
  color: #000;
  transform: translateY(-1px);
}

.play-all-btn svg {
  width: 1.1rem;
  height: 1.1rem;
}

/* View Mode Switcher (Load more / Pages) */
.view-mode-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
}

.mode-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.45rem 1.15rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.mode-toggle-btn:hover {
  color: #ffffff;
}

.mode-toggle-btn.active {
  background: #fffc00;
  color: #000000;
  box-shadow: 0 2px 10px rgba(255, 252, 0, 0.4);
}

.stories-grid, .highlights-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 0 auto;
  width: 100%;
  max-width: 1024px;
}

@media (max-width: 900px) {
  .stories-grid, .highlights-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 580px) {
  .stories-grid, .highlights-grid {
    grid-template-columns: 1fr;
  }
}

.story-snap-card {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  background: #000000;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  user-select: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.story-snap-card:hover {
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.9), 0 0 25px rgba(255, 252, 0, 0.2);
}

/* Top pill badge and sound button */
.snap-card-top {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.snap-top-left-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

.snap-time-pill {
  display: inline-block;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.snap-sound-toggle-btn {
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.snap-sound-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.85);
  border-color: var(--accent-yellow);
  color: var(--accent-yellow);
  transform: scale(1.1);
}

.snap-sound-toggle-btn svg {
  width: 17px;
  height: 17px;
}

/* Media box */
.snap-media-box {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
}

.snap-media-content {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Guarantee webkit native media controls never show */
.snap-video-element::-webkit-media-controls,
.snap-video-element::-webkit-media-controls-panel,
.snap-video-element::-webkit-media-controls-play-button,
.snap-video-element::-webkit-media-controls-start-playback-button,
.snap-video-element::-webkit-media-controls-volume-slider,
.snap-video-element::-webkit-media-controls-mute-button,
.snap-video-element::-webkit-media-controls-timeline,
.snap-video-element::-webkit-media-controls-current-time-display,
.snap-video-element::-webkit-media-controls-time-remaining-display,
.snap-video-element::-webkit-media-controls-fullscreen-button,
.snap-video-element::-webkit-media-controls-overflow-button,
.snap-video-element::-webkit-media-controls-enclosure {
  display: none !important;
  -webkit-appearance: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Subtle video progress bar at bottom of card */
.snap-video-progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  z-index: 15;
  pointer-events: none;
}

.snap-video-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-yellow);
  box-shadow: 0 0 6px rgba(255, 252, 0, 0.8);
  transition: width 0.1s linear;
}

/* Centered Video Play Button & Overlay */
.snap-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.25);
  transition: opacity 0.25s ease, background 0.25s ease;
}

.story-snap-card.is-playing .snap-play-overlay {
  opacity: 0;
  pointer-events: none;
}

.snap-play-center-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(17, 18, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid var(--accent-yellow);
  color: var(--accent-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7), 0 0 16px rgba(255, 252, 0, 0.4);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease, background 0.22s ease;
}

.snap-play-center-btn:hover {
  transform: scale(1.14);
  background: #fffc00;
  color: #000000;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.8), 0 0 28px rgba(255, 252, 0, 0.8);
}

.snap-play-center-btn:active {
  transform: scale(0.95);
}

.snap-play-center-icon {
  width: 32px;
  height: 32px;
  margin-left: 4px;
}

/* Video type pill in top header */
.snap-type-pill.video-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 252, 0, 0.2);
  border: 1px solid rgba(255, 252, 0, 0.5);
  color: var(--accent-yellow);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: 9999px;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* Bottom overlay directly over the media */
.snap-bottom-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 60px 16px 16px 16px;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.5) 35%, rgba(0, 0, 0, 0.95) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.snap-info-left,
.snap-download-icon-btn {
  pointer-events: auto;
}

.snap-info-left {
  display: flex;
  flex-direction: column;
  text-align: left;
  min-width: 0;
  flex: 1;
}

.snap-username-yellow {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fffc00;
  line-height: 1.2;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  letter-spacing: -0.01em;
}

.snap-posted-subtext {
  font-size: 0.825rem;
  font-weight: 500;
  color: #ffffff;
  margin-top: 3px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Download icon button */
.snap-download-icon-btn {
  background: transparent;
  border: none;
  color: #fffc00;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s ease;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8));
  margin-bottom: 2px;
}

.snap-download-icon-btn:hover {
  transform: scale(1.18);
  filter: drop-shadow(0 0 12px rgba(255, 252, 0, 0.8));
}

.snap-download-icon-btn:active {
  transform: scale(0.92);
}

.snap-download-svg {
  width: 32px;
  height: 32px;
  stroke: #fffc00;
}

/* ==========================================================================
   Pagination and Load More Controls
   ========================================================================== */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 2rem;
  margin-bottom: 2.5rem;
  width: 100%;
}

.page-btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-nav-btn {
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.page-nav-btn:disabled {
  background: #475569;
  color: #94a3b8;
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.page-nav-btn:not(:disabled):hover {
  background: #f1f5f9;
  transform: translateY(-1px);
}

.page-numbers-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-num-btn {
  min-width: 40px;
  height: 40px;
  border-radius: 6px;
  background: #ffffff;
  color: #1e293b;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.page-num-btn:hover {
  background: #f8fafc;
  transform: translateY(-1px);
}

.page-num-btn.active {
  background: #ffffff;
  color: #000000;
  border: 2.5px solid #fffc00;
  box-shadow: 0 0 14px rgba(255, 252, 0, 0.5);
}

.load-more-bar {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
  margin-bottom: 2.5rem;
  width: 100%;
}

.load-more-action-btn {
  background: #fffc00;
  color: #000000;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  padding: 10px 28px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(255, 252, 0, 0.35);
}

.load-more-action-btn:hover {
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 252, 0, 0.5);
}

/* Highlights & Spotlight Album Cards (Screenshot 2 exact match) */
.highlight-album-card {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  background: #000000;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.highlight-album-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 252, 0, 0.6);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.85), 0 0 20px rgba(255, 252, 0, 0.25);
}

.album-badge-count {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  background: #fffc00;
  color: #000000;
  font-size: 0.85rem;
  font-weight: 800;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.album-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.album-bottom-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 50px 14px 14px 14px;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.4) 40%, rgba(0, 0, 0, 0.95) 100%);
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.album-title-text {
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.album-snaps-subtext {
  color: #94a3b8;
  font-size: 0.825rem;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.back-to-albums-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.back-to-albums-btn:hover {
  background: #fffc00;
  color: #000000;
  border-color: #fffc00;
}

.page-ellipsis {
  color: var(--text-muted);
  font-weight: 800;
  padding: 0 4px;
  user-select: none;
}

/* Empty State */
.empty-state-card {
  background: var(--bg-card);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 3.5rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.empty-icon {
  font-size: 2.75rem;
}

.empty-state-card h4 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
}

.empty-state-card p {
  color: var(--text-secondary);
  max-width: 420px;
}

.switch-tab-btn {
  margin-top: 0.75rem;
  background: var(--accent-yellow);
  color: #000;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.switch-tab-btn:hover {
  background: #fff;
  transform: translateY(-2px);
}

/* ==========================================================================
   Fullscreen Story Viewer Modal
   ========================================================================== */
.story-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
}

.story-player-frame {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  height: 90vh;
  max-height: 860px;
  background: #000000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.9), 0 0 40px rgba(255, 252, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  user-select: none;
}

/* Segmented Progress Bars */
.story-progress-container {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
  z-index: 20;
}

.progress-bar-segment {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: #ffffff;
  border-radius: 2px;
  transition: width linear;
}

.progress-bar-segment.completed .progress-bar-fill {
  width: 100%;
}

/* Story Header */
.story-player-header {
  position: absolute;
  top: 24px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
  pointer-events: auto;
}

.story-user-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.player-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--accent-yellow);
  object-fit: cover;
}

.player-user-meta {
  display: flex;
  flex-direction: column;
}

.player-username {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.player-time {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.player-icon-btn {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.player-icon-btn:hover {
  background: rgba(255, 252, 0, 0.3);
  color: var(--accent-yellow);
  transform: scale(1.1);
}

.player-icon-btn.download-highlight {
  color: var(--accent-yellow);
}

.player-icon-btn svg {
  width: 1.15rem;
  height: 1.15rem;
}

/* Media Viewport */
.story-media-wrapper {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.story-media-img,
.story-media-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Tap Zones */
.tap-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 15;
  cursor: pointer;
}

.tap-left {
  left: 0;
  width: 35%;
}

.tap-right {
  right: 0;
  width: 65%;
}

/* Desktop Nav Arrows */
.desktop-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  z-index: 25;
}

.desktop-nav-btn:hover {
  background: var(--accent-yellow);
  color: #000000;
  transform: translateY(-50%) scale(1.1);
}

.desktop-nav-btn svg {
  width: 1.5rem;
  height: 1.5rem;
}

.prev-btn {
  left: -60px;
}

.next-btn {
  right: -60px;
}

@media (max-width: 640px) {
  .desktop-nav-btn {
    display: none;
  }
}

/* Player Bottom Bar */
.story-player-bottom {
  position: absolute;
  bottom: 14px;
  left: 14px;
  right: 14px;
  z-index: 20;
}

.bottom-download-btn {
  width: 100%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 252, 0, 0.4);
  color: var(--accent-yellow);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.8rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.bottom-download-btn:hover {
  background: var(--accent-yellow);
  color: #000;
}

.bottom-download-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* ==========================================================================
   Loading Overlay & Toasts
   ========================================================================== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-box {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  padding: 2rem 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), var(--shadow-yellow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
}

.spinner-ring {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 252, 0, 0.2);
  border-top-color: var(--accent-yellow);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

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

/* Error Banner */
.error-banner {
  margin: 1.5rem auto 0;
  max-width: 600px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: fadeIn 0.3s ease;
}

.error-text {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
}

.error-close-btn {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

/* Toast Notification */
.toast-popup {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  box-shadow: var(--shadow-lg), var(--shadow-yellow);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.9rem;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-icon {
  font-size: 1.1rem;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  padding: 2.5rem 0 3rem;
  background: var(--bg-secondary);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.footer-link {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.footer-link:hover {
  color: var(--accent-yellow);
}

.footer-disclaimer {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 600px;
  line-height: 1.4;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .top-nav {
    justify-content: flex-end;
    margin-bottom: 1rem;
  }
  .brand-hero {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
  .brand-title {
    font-size: 1.45rem;
  }
  .search-headline {
    font-size: 1.65rem;
  }
  .search-input-wrapper {
    flex-direction: column;
    padding: 0.5rem;
    gap: 0.5rem;
  }
  .search-submit-btn {
    width: 100%;
    padding: 0.85rem;
  }
  .saved-profiles-section {
    padding: 1.25rem;
  }
  .story-player-frame {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  /* Mobile Profile Header */
  .profile-card {
    margin-bottom: 1.5rem;
    gap: 0.85rem;
    padding: 0 0.5rem;
  }
  .avatar-ring {
    width: 95px;
    height: 95px;
    padding: 3px;
  }
  .profile-display-name {
    font-size: 1.5rem;
  }
  .profile-instruction-hint {
    font-size: 0.82rem;
    padding: 0 0.5rem;
    line-height: 1.4;
  }
  .profile-tags {
    gap: 0.4rem;
  }
  .tag-pill {
    font-size: 0.8rem;
    padding: 0.3rem 0.75rem;
  }

  /* Mobile Tabs - Fixes the left-cut off issue completely */
  .tabs-container {
    width: 100%;
    max-width: 100%;
    margin-bottom: 1.5rem;
    padding: 0 0.25rem;
    display: flex;
    justify-content: center;
    box-sizing: border-box;
  }
  .tabs-pill-list {
    display: flex;
    width: 100%;
    max-width: 480px;
    padding: 0.25rem;
    gap: 0.25rem;
    box-sizing: border-box;
  }
  .tab-item {
    flex: 1 1 0;
    justify-content: center;
    padding: 0.55rem 0.4rem;
    font-size: 0.82rem;
    white-space: nowrap;
    gap: 0.25rem;
  }
  .tab-counter {
    font-size: 0.78rem;
  }

  /* Mobile Section Header & Mode Buttons */
  .pane-header {
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
    padding: 0 0.25rem;
  }
  .pane-title {
    font-size: 1.25rem;
  }
  .view-mode-bar {
    gap: 0.25rem;
  }
  .mode-toggle-btn {
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
  }

  /* Mobile Grid - Center card and give comfortable phone margins */
  .stories-grid, .highlights-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    max-width: 420px;
    margin: 0 auto;
    padding: 0 0.25rem;
    box-sizing: border-box;
  }
  .story-snap-card {
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  }
}

@media (max-width: 420px) {
  .container {
    padding: 0 0.75rem;
  }
  .tab-item {
    padding: 0.5rem 0.2rem;
    font-size: 0.75rem;
  }
  .tab-counter {
    font-size: 0.7rem;
  }
  .pane-title {
    font-size: 1.15rem;
  }
}
