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

/* Suppress transitions on initial page load to prevent sidebar flash */
.preload, .preload * { transition-duration: 0s !important; }
body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #F5F5F5;
  min-height: 100vh;
  display: flex;
  -webkit-font-smoothing: antialiased;
  color: #1A1A1A;
}

/* ── SIDEBAR ── */
.sidebar {
  width: 240px; min-height: 100vh;
  background: #fff;
  border-radius: 0 20px 20px 0;
  display: flex; flex-direction: column;
  padding: 30px 18px 24px;
  position: fixed; left: 0; top: 0; bottom: 0;
  box-shadow: 2px 0 16px rgba(0,0,0,0.04);
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 50;
}

.sidebar-logo-wrap {
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid #EBEBEB;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 800; color: #1A1A1A; letter-spacing: -0.3px;
  line-height: 1.1;
  text-decoration: none;
}
.sidebar-logo img { width: 36px; height: auto; flex-shrink: 0; }
.wordmark { display: inline-flex; align-items: baseline; line-height: 1; }
.tm-mark {
  font-size: 0.43em; font-weight: 700; letter-spacing: 0;
  position: relative; top: -0.42em; margin-left: 2px; opacity: 0.72;
}

/* Nav items */
.nav-links { display: flex; flex-direction: column; gap: 10px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  min-height: 52px;
  padding: 10px 12px; border-radius: 14px;
  border: 1px solid transparent;
  font-size: 15px; font-weight: 500; line-height: 1.2; letter-spacing: -0.01em;
  color: #9A9A9A;
  text-decoration: none;
  transition: color 0.18s ease, background-color 0.18s ease;
  cursor: pointer;
}
.nav-link:hover,
.nav-link:focus-visible {
  color: #1A1A1A;
  background: #FDF0ED;
  outline: none;
}
.nav-link.active {
  color: #1A1A1A; font-weight: 600;
  background: #FDF0ED;
}
.nav-link.upgrade-suggested {
  color: #9A9A9A;
  font-weight: 500;
  background: transparent;
}
.nav-link.upgrade-suggested .nav-icon {
  background: transparent;
}
.nav-link.upgrade-suggested .nav-icon svg {
  stroke: #9A9A9A;
}
.nav-link.upgrade-suggested:hover,
.nav-link.upgrade-suggested:focus-visible {
  background: #FDF0ED;
  color: #1A1A1A;
}
.nav-link.active:hover,
.nav-link.active:focus-visible {
  background: #FDF0ED;
}

#sidebar-upgrade-text {
  display: inline-block;
  min-width: 96px;
  font-size: 0;
}
#sidebar-upgrade-text::after {
  content: var(--datezy-upgrade-label, "Upgrade");
  font-size: 15px;
  font-weight: inherit;
  line-height: inherit;
  font-family: inherit;
  letter-spacing: inherit;
  color: inherit;
}

/* Icon badge */
.nav-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
  background: transparent;
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}
.nav-icon svg { transition: stroke 0.18s ease; }
.nav-link:hover .nav-icon,
.nav-link:focus-visible .nav-icon {
  background: #FAE8E4;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}
.nav-link:hover .nav-icon svg,
.nav-link:focus-visible .nav-icon svg { stroke: #E8735A; }
.nav-link.active .nav-icon {
  background: #E8735A;
  box-shadow: 0 8px 18px rgba(232,115,90,0.22);
}
.nav-link.active .nav-icon svg { stroke: white; }
.nav-link:not(.active) .nav-icon svg { stroke: #9A9A9A; }

.sidebar-cta { margin: 0 0 18px; visibility: hidden; }
html.datezy-has-credits .sidebar-cta { visibility: visible; }
.sidebar.datezy-free-out-of-credits .sidebar-cta,
html.datezy-free-out-of-credits .sidebar-cta {
  display: none;
}
.btn-plan {
  width: 100%; padding: 13px 16px;
  background: #E8735A; color: #fff;
  border: none; border-radius: 100px;
  font-size: 15px; font-weight: 700; line-height: 1.2; font-family: inherit;
  cursor: pointer; text-align: center; text-decoration: none;
  display: block;
  box-shadow: 0 6px 18px rgba(232,115,90,0.18);
  transition: background-color 0.15s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}
.btn-plan .btn-plan-icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: -2px;
  margin-right: 7px;
}
.btn-plan:hover,
.btn-plan:focus-visible {
  background: #D45E45;
  box-shadow: 0 10px 24px rgba(212,94,69,0.24);
  outline: none;
}

.sidebar-credits {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid #F5C4B8;
  background: linear-gradient(135deg, #FFF7F3 0%, #FCEDE6 100%);
  margin: 10px 0 12px;
  display: none;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(232,115,90,0.10);
}
#topbar-subtitle {
  opacity: 0;
  transition: opacity 0.15s;
}
.sidebar-credits::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.54) 0%, rgba(255,255,255,0) 38%),
    radial-gradient(circle at 50% 120%, rgba(255,255,255,0.14), rgba(255,255,255,0));
  pointer-events: none;
  z-index: -1;
}
.credits-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #E8735A;
  line-height: 1;
}
.credits-text {
  font-size: 0;
  line-height: 1;
}
.credits-text::before {
  content: var(--datezy-credits-label, "—");
  font-size: 14px;
  font-weight: 700;
  color: var(--datezy-credits-color, #1A1A1A);
  line-height: 1;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid #EBEBEB;
  display: flex; flex-direction: column; gap: 0;
}
.footer-group { display: flex; flex-direction: column; }
.footer-group + .footer-group {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #EBEBEB;
}
.sidebar-footer a {
  display: flex;
  align-items: center;
  min-height: 32px;
  font-size: 13px; font-weight: 500; line-height: 1.4; color: #AFAFAF; text-decoration: none;
  padding: 6px 8px;
  margin: 0 -8px;
  border-radius: 10px;
  transition: color 0.18s ease, background-color 0.18s ease;
}
.sidebar-footer a:hover,
.sidebar-footer a:focus-visible {
  color: #E8735A;
  background: #FDF0ED;
  outline: none;
}
.sidebar-footer a.active {
  color: #E8735A;
  font-weight: 600;
}

/* ── MAIN ── */
.main { margin-left: 240px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* Topbar */
.topbar {
  background: #F5F5F5;
  padding: 20px 40px;
  display: flex; justify-content: flex-end; align-items: center;
}
.user-chip {
  display: flex; align-items: center; gap: 14px;
  background: #fff;
  padding: 8px 16px 8px 8px;
  border-radius: 100px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: #E8735A; color: #fff;
  font-size: 15px; font-weight: 800; letter-spacing: 0.3px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-avatar svg { display: none; }
.chip-divider { width: 1px; height: 28px; background: #E8E8E8; }
.user-info-col { display: flex; flex-direction: column; justify-content: center; }
.user-info-col strong { font-size: 14px; font-weight: 700; line-height: 1.2; }
.user-info-col span  { display: none; }
.user-info-col span.is-premium { display: block; font-size: 11px; font-weight: 600; line-height: 1.2; color: #E8735A; }
.logout-btn {
  background: none; border: none; cursor: pointer; padding: 4px;
  color: #999; display: flex; align-items: center;
}
.logout-btn:hover { color: #E8735A; }
.logout-btn svg { width: 18px; height: 18px; }

/* Page body */
.page-body { padding: 0 40px 60px; }

/* Hamburger toggle — hidden on desktop */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #fff;
  border: none; border-radius: 12px; cursor: pointer;
  padding: 0; margin-right: 12px; color: #1A1A1A;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}
.hamburger-btn svg { width: 22px; height: 22px; display: block; }
.hamburger-btn:hover,
.hamburger-btn:focus-visible {
  color: #E8735A;
  background: #FDF0ED;
  box-shadow: 0 6px 16px rgba(232,115,90,0.12);
  outline: none;
}

/* Mobile overlay backdrop — hidden by default */
.sidebar-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(26,26,26,0.32); z-index: 49;
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}
.sidebar-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  /* Show hamburger */
  .hamburger-btn { display: flex; }

  /* Sidebar: hidden drawer */
  .sidebar {
    width: min(320px, calc(100vw - 24px));
    transform: translateX(calc(-100% - 24px));
    transition: transform 0.25s ease;
    padding: 24px 16px 20px;
    box-shadow: 10px 0 32px rgba(0,0,0,0.1);
    z-index: 51;
  }
  .sidebar.open { transform: translateX(0); }

  .sidebar-logo-wrap {
    margin-bottom: 18px;
  }

  .nav-link {
    min-height: 52px;
    padding: 10px 12px;
    border-radius: 12px;
  }

  .sidebar-credits {
    margin: 10px 0 10px;
    padding: 14px;
  }

  .sidebar-footer { padding-top: 16px; }

  /* Show backdrop when sidebar is open */
  .sidebar-backdrop { display: block; }

  /* Main: full width */
  .main { margin-left: 0; }

  /* Topbar: space for hamburger */
  .topbar {
    padding: 14px 20px;
    justify-content: flex-start;
  }
  .user-chip { margin-left: auto; }

  /* Page body padding */
  .page-body { padding: 0 20px 40px; }
}

@media (max-width: 480px) {
  .sidebar {
    width: min(320px, calc(100vw - 16px));
    padding: 22px 14px 18px;
  }
  .nav-link { gap: 10px; }
  .sidebar-credits { border-radius: 14px; }
  .page-body { padding: 0 16px 32px; }
  .topbar { padding: 12px 16px; }
  .user-info-col { display: none; }
  .chip-divider { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Show credits widget immediately when cached data is available.
   auth-helpers.js sets this class in a blocking <head> script before body renders,
   so the widget is visible at first paint — prevents the Plan a Date button from jumping. */
html.datezy-cached-credits .sidebar-credits { display: flex; }

/* Smooth same-origin page navigation — sidebar persists, content cross-fades */
@view-transition { navigation: auto; }
.sidebar { view-transition-name: datezy-sidebar; }
.main    { view-transition-name: datezy-main; }
/* Exclude credits widget from sidebar snapshot — its content/layout can change independently */
.sidebar-credits { view-transition-name: none; }
