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

body{
  margin:0;
}

*,
*::before,
*::after{
  box-sizing:border-box;
  min-width:0;
}

img,
svg,
video,
canvas{
  display:block;
  max-width:100%;
  height:auto;
}

/* ===== Buttons ===== */

.btn-hero-primary,
.btn-hero-ghost,
.plan-btn-outline,
.upgrade-pill-header,
.header-upgrade-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  cursor:pointer;
  border-radius:999px;
  transition:
    transform .15s ease,
    box-shadow .18s ease,
    background .18s ease,
    border-color .18s ease,
    color .18s ease,
    filter .18s ease;
}

.btn-hero-primary{
  padding:.9rem 1.5rem;
  border:none;
  font-weight:800;
  font-size:.95rem;
  line-height:1;
  letter-spacing:.02em;
  background:linear-gradient(135deg,#ff68a5,#ffb347);
  color:#0b1020;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.07),
    0 12px 35px rgba(0,0,0,.6),
    0 0 24px rgba(255,104,165,.45);
  text-shadow:0 0 8px rgba(255,255,255,.35);
}

.btn-hero-primary:hover{
  transform:translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.09),
    0 18px 45px rgba(0,0,0,.75),
    0 0 32px rgba(255,176,95,.6);
}

.btn-hero-primary.small{
  padding:7px 12px;
  font-size:12px;
  font-weight:800;
}

.btn-hero-ghost{
  padding:.9rem 1.5rem;
  border:1px solid rgba(148,163,184,.5);
  font-weight:700;
  font-size:.95rem;
  background:radial-gradient(circle at top left,rgba(148,163,184,.18),rgba(15,23,42,.95));
  color:#e5e7eb;
  box-shadow:
    0 0 0 1px rgba(15,23,42,.9),
    0 10px 30px rgba(15,23,42,.85);
}

.btn-hero-ghost:hover{
  transform:translateY(-1px);
  border-color:rgba(209,213,219,.8);
  background:radial-gradient(circle at top left,rgba(148,163,184,.32),rgba(15,23,42,.98));
}

.plan-btn-outline{
  padding:7px 12px;
  border:1px solid rgba(148,163,184,.8);
  background:transparent;
  color:#e5e7eb;
  font-size:12px;
}

.plan-btn-outline:hover{
  border-color:rgba(209,213,219,.95);
  background:rgba(148,163,184,.08);
}

.upgrade-pill-header,
.header-upgrade-pill{
  padding:8px 12px;
  border:none;
  font-size:12px;
  font-weight:800;
  background:linear-gradient(135deg,#ff68a5,#a855f7);
  color:#fff;
  box-shadow:0 10px 22px rgba(168,85,247,.26);
}

.upgrade-pill-header:hover,
.header-upgrade-pill:hover{
  transform:translateY(-1px);
  filter:brightness(1.05);
}

.badge-premium-small{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:7px 10px;
  border-radius:999px;
  font-size:11px;
  font-weight:800;
  background:linear-gradient(135deg,#facc15,#f97316);
  color:#111827;
}

.badge-hearts-small{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:7px 10px;
  border-radius:999px;
  font-size:11px;
  font-weight:800;
  background:rgba(244,114,182,.18);
  color:#fb7185;
  border:1px solid rgba(244,114,182,.25);
}

/* ===== Header ===== */

.site-header{
  position:sticky;
  top:0;
  z-index:1000;
  width:100%;
  background:rgba(10,14,22,.72);
  border-bottom:1px solid rgba(148,163,184,.22);
  box-shadow:0 10px 30px rgba(0,0,0,.18);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}

body.theme-light .site-header{
  background:rgba(255,255,255,.88);
  border-bottom:1px solid rgba(15,23,42,.10);
  box-shadow:0 10px 30px rgba(2,6,23,.08);
}

.site-header-inner{
  max-width:1200px;
  margin:0 auto;
  padding:10px 16px;
  min-height:64px;
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
}

.site-logo-link{
  display:inline-flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  line-height:1;
  min-width:0;
  flex:0 0 auto;
}

.site-logo-svg{
  width:auto;
  height:30px;
  max-width:none;
  flex-shrink:0;
}

.site-brand-text{
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-width:0;
  line-height:1.05;
}

.site-brand-top{
  font-size:10px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:rgba(148,163,184,.95);
}

body.theme-light .site-brand-top{
  color:rgba(71,85,105,.9);
}

.site-brand-bottom{
  font-size:14px;
  font-weight:800;
  letter-spacing:.02em;
  background:linear-gradient(135deg,#ff68a5,#a855f7);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}

.site-nav{
  flex:1 1 auto;
  min-width:0;
  min-height:40px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  flex-wrap:nowrap;
}

.site-nav-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-height:36px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid transparent;
  text-decoration:none;
  font-size:12px;
  font-weight:700;
  line-height:1;
  white-space:nowrap;
  color:rgba(226,232,240,.92);
  transition:
    background-color .18s ease,
    color .18s ease,
    border-color .18s ease,
    transform .18s ease;
}

body.theme-light .site-nav-link{
  color:rgba(15,23,42,.82);
}

.site-nav-link:hover{
  background:rgba(148,163,184,.14);
  border-color:rgba(148,163,184,.14);
  color:#ffffff;
}

body.theme-light .site-nav-link:hover{
  color:rgba(15,23,42,1);
}

.site-nav-link.active{
  background:rgba(59,130,246,.22);
  border-color:rgba(59,130,246,.28);
  color:#bfdbfe;
}

body.theme-light .site-nav-link.active{
  background:#dbeafe;
  border-color:#bfdbfe;
  color:#1d4ed8;
}

.site-header-right{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex:0 0 auto;
}

.site-header-auth{
  display:flex;
  align-items:center;
  gap:8px;
}

.theme-toggle-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-width:40px;
  min-height:40px;
  padding:7px 10px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.25);
  background:transparent;
  color:rgba(226,232,240,.92);
  font-size:12px;
  font-weight:700;
  cursor:pointer;
}

body.theme-light .theme-toggle-btn{
  border-color:rgba(15,23,42,.10);
  color:rgba(15,23,42,.82);
}

.theme-toggle-btn:hover{
  background:rgba(148,163,184,.12);
  color:#ffffff;
}

body.theme-light .theme-toggle-btn:hover{
  color:rgba(15,23,42,1);
}

.site-user-pill{
  max-width:220px;
  padding:7px 11px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.25);
  background:rgba(148,163,184,.12);
  color:rgba(226,232,240,.92);
  font-size:12px;
  font-weight:700;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

body.theme-light .site-user-pill{
  background:rgba(15,23,42,.06);
  border-color:rgba(15,23,42,.10);
  color:rgba(15,23,42,.82);
}

.chat-nav-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:18px;
  height:18px;
  margin-left:6px;
  padding:0 6px;
  border-radius:999px;
  background:#ef4444;
  color:#fff;
  font-size:11px;
  line-height:18px;
  font-weight:900;
}

/* ===== Tablet / small desktop ===== */

@media (max-width:900px){
  .site-header-inner{
    flex-wrap:wrap;
    gap:10px;
    padding:10px 12px;
    min-height:auto;
  }

  .site-logo-link{
    order:1;
  }

  .site-header-right{
    order:2;
    margin-left:auto;
  }

  .site-nav{
    order:3;
    width:100%;
    justify-content:flex-start;
    flex-wrap:wrap;
    gap:8px;
  }

  .site-logo-svg{
    height:28px;
  }

  .site-brand-top{
    font-size:10px;
  }

  .site-brand-bottom{
    font-size:13px;
  }

  .site-user-pill{
    max-width:160px;
  }
}

/* ===== Mobile ===== */

@media (max-width:640px){
  .site-header-inner{
    gap:8px;
    padding:8px 10px;
  }

  .site-logo-svg{
    height:26px;
  }

  .site-brand-top{
    font-size:9px;
  }

  .site-brand-bottom{
    font-size:12px;
  }

  .site-header-right,
  .site-header-auth{
    gap:6px;
  }

  .site-nav{
    width:100%;
    display:flex;
    flex-wrap:wrap;
    gap:6px;
  }

  .site-nav-link{
    width:calc(50% - 3px);
    min-height:38px;
    padding:8px 8px;
    justify-content:center;
    text-align:center;
    white-space:normal;
    line-height:1.15;
    font-size:11.5px;
  }

  .theme-toggle-btn{
    min-width:36px;
    min-height:36px;
    padding:6px 8px;
  }

  .site-user-pill{
    max-width:130px;
    padding:6px 9px;
    font-size:11px;
  }

  .upgrade-pill-header,
  .header-upgrade-pill,
  .badge-premium-small,
  .badge-hearts-small{
    padding:6px 9px;
    font-size:11px;
  }
}

/* ===== Very small mobile ===== */

@media (max-width:480px){
  .site-header-inner{
    padding:8px;
    gap:8px;
  }

  .site-logo-svg{
    height:24px;
  }

  .site-brand-top{
    font-size:8.5px;
  }

  .site-brand-bottom{
    font-size:11.5px;
  }

  .site-header-right{
    gap:6px;
  }

  .site-header-auth .badge-premium-small,
  .site-header-auth .badge-hearts-small,
  .site-header-auth .upgrade-pill-header,
  .site-header-auth .header-upgrade-pill,
  .site-user-pill{
    display:none;
  }

  .theme-toggle-btn{
    min-width:34px;
    min-height:34px;
  }

  .site-nav{
    width:100%;
    display:flex;
    flex-wrap:wrap;
    gap:5px;
  }

  .site-nav-link{
    width:calc(50% - 2.5px);
    min-height:38px;
    padding:7px 8px;
    justify-content:center;
    text-align:center;
    white-space:normal;
    line-height:1.15;
    font-size:11px;
  }

  .chat-nav-badge{
    min-width:16px;
    height:16px;
    margin-left:4px;
    padding:0 5px;
    font-size:10px;
    line-height:16px;
  }
}
/* =========================================================
   MOBILE HEADER NAV FIX
   Put this at the VERY END of the CSS file
   ========================================================= */

@media (max-width: 640px){

  .site-header-inner{
    display:flex !important;
    flex-wrap:wrap !important;
    align-items:center !important;
    gap:8px !important;
    padding:8px 10px !important;
  }

  .site-logo-link{
    order:1 !important;
    flex:0 0 auto !important;
  }

  .site-header-right{
    order:2 !important;
    margin-left:auto !important;
    display:flex !important;
    align-items:center !important;
    gap:6px !important;
    flex:0 0 auto !important;
  }

  .site-header-auth{
    display:flex !important;
    align-items:center !important;
    gap:6px !important;
    flex-wrap:nowrap !important;
  }

  .site-nav{
    order:3 !important;
    width:100% !important;
    margin-top:6px !important;

    display:grid !important;
    grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
    gap:8px !important;

    align-items:stretch !important;
    justify-content:stretch !important;
  }

  .site-nav-link{
    display:flex !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;

    align-items:center !important;
    justify-content:center !important;
    text-align:center !important;

    min-height:40px !important;
    padding:8px 10px !important;

    white-space:normal !important;
    line-height:1.15 !important;
    font-size:11.5px !important;
  }
}

@media (max-width: 480px){
  .site-nav{
    grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
    gap:6px !important;
  }

  .site-nav-link{
    min-height:38px !important;
    padding:7px 8px !important;
    font-size:11px !important;
  }

  .site-header-auth .badge-premium-small,
  .site-header-auth .badge-hearts-small,
  .site-user-pill{
    display:none !important;
  }
}
