/* ── Reset & base ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --purple:      #6B63D8;   /* primary brand purple */
  --terracotta:  #6B63D8;   /* alias kept for backwards compat */
  --terra-dark:  #4F48B8;   /* primary dark */
  --terra-light: #8B84E8;   /* primary light */
  --cream:       #F7F6FF;   /* page background */
  --cream-dark:  #EDEAFA;   /* surface tint */
  --sand:        #C5C2E8;   /* borders & dividers */
  --ink:         #1A1D4E;   /* dark text — navy from logo */
  --ink-light:   #4A4E7A;   /* secondary text */
  --white:       #FFFFFF;
  --shadow:      0 2px 12px rgba(26,29,78,.10);
  --shadow-lg:   0 8px 32px rgba(26,29,78,.16);
  --radius:      14px;
  --radius-sm:   8px;
  --font-serif:  'Fraunces', Georgia, serif;
  --font-sans:   'DM Sans', system-ui, sans-serif;
  --transition:  .2s ease;
  /* avatar sizes */
  --avatar-card:    56px;
  --avatar-profile: 140px;
  --avatar-edit:    88px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-y: scroll;          /* always reserve scrollbar gutter — prevents layout shift between pages */
  overflow-x: hidden;          /* no horizontal bleed */
}

body {
  font-family: var(--font-sans);
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ───────────────────────────────────────────────────────── */
h1,h2,h3 { font-family: var(--font-serif); font-weight: 600; line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
h3 { font-size: 1.1rem; }
p  { line-height: 1.6; color: var(--ink-light); }

a { color: var(--terracotta); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout helpers ───────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .main-content { padding-top: 68px; }
}

.page-center {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}
.page-center--auth {
  justify-content: flex-start;
  padding-top: 1.5rem;
}

/* ── Brand mark ───────────────────────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--terracotta);
  text-decoration: none;
  margin-bottom: 2rem;
}
.brand svg { width: 32px; height: 32px; }

/* ── Logo hero — login & signup pages ────────────────────────────────── */
.brand-hero {
  text-align: center;
  margin-top: -20px;
  margin-bottom: 2rem;
}
.brand-hero-img {
  width: 200px;
  height: auto;
  display: block;
  margin: 0 auto;
  animation: cardFadeIn .5s ease both;
}

/* ── Nav mascot logo ─────────────────────────────────────────────────── */
.nav-mascot-sm {
  width: 80px;
  height: 80px;
  object-fit: contain;
  display: block;
}

/* ── Card ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  width: 100%;
}

/* ── Form elements ────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.1rem; }
label { font-size: .85rem; font-weight: 600; color: var(--ink-light); letter-spacing: .02em; text-transform: uppercase; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="search"],
textarea {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid var(--sand);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--cream);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, textarea:focus {
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(107,99,216,.18);
  background: var(--white);
}
textarea { resize: vertical; min-height: 90px; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .8rem 1.6rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--terracotta);
  color: var(--white);
  width: 100%;
}
.btn-primary:hover:not(:disabled) { background: var(--terra-dark); box-shadow: var(--shadow); }

.btn-secondary {
  background: var(--cream-dark);
  color: var(--ink);
  width: 100%;
}
.btn-secondary:hover:not(:disabled) { background: var(--sand); }

.btn-ghost {
  background: transparent;
  color: var(--terracotta);
  border: 1.5px solid var(--terracotta);
  width: 100%;
}
.btn-ghost:hover:not(:disabled) { background: rgba(107,99,216,.08); }

.btn-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  padding: 0;
  font-size: 1.4rem;
}

/* ── Flash messages ───────────────────────────────────────────────────── */
.flash {
  padding: .7rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  margin-bottom: 1rem;
  display: none;
}
.flash.error   { background: #FDECEA; color: #B71C1C; display: block; }
.flash.success { background: #E8F5E9; color: #1B5E20; display: block; }

/* ── Nav ──────────────────────────────────────────────────────────────── */
/* ─── App header ──────────────────────────────────────────────────────────── */
.ct-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 88px;
  background: var(--white);
  border-bottom: 1px solid #e8e8e8;
  z-index: 100;
}
.ct-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 900px;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
}
.nav { /* legacy no-op */ }

/* ── Global footer ────────────────────────────────────────────────────────── */
#app-footer {
  margin-top: auto;
  padding: 1rem 20px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 900px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: .5rem;
}
.footer-copy {
  font-size: .82rem;
  color: var(--ink-light);
}
.footer-links {
  display: flex;
  gap: 1.25rem;
}
.footer-links a {
  font-size: .82rem;
  color: var(--ink-light);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--purple); }

/* ── Legal pages (terms, privacy, refunds, contact) ──────────────────────── */
.legal-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem 5rem;
}
.legal-back {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink-light);
  text-decoration: none;
  margin-bottom: 1.75rem;
  transition: color var(--transition);
}
.legal-back:hover { color: var(--purple); }
.legal-back svg { width: 16px; height: 16px; flex-shrink: 0; }
.legal-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.legal-logo img { height: 72px; width: auto; object-fit: contain; }
.legal-doc-label {
  text-align: center;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: .6rem;
}
.legal-wrap h1 {
  text-align: center;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  margin-bottom: .5rem;
}
.legal-updated {
  text-align: center;
  font-size: .85rem;
  color: var(--ink-light);
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--cream-dark);
}
.nav-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-links { display: flex; align-items: center; gap: .05rem; }
.nav-link {
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink-light);
  padding: .35rem .5rem;
  border-radius: 99px;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}
.nav-link:hover { background: var(--cream-dark); color: var(--ink); text-decoration: none; }
.nav-link.active {
  background: var(--cream-dark);
  color: var(--terracotta);
  text-decoration: none;
}
.nav-logout {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink-light);
  padding: .35rem .5rem;
  border-radius: 99px;
  transition: color var(--transition);
}
.nav-logout:hover { color: var(--terracotta); }

.nav-upgrade {
  background: linear-gradient(135deg, var(--purple), #9b8ef7);
  color: var(--white) !important;
  border-radius: 99px;
  padding: .38rem .85rem;
  font-weight: 700;
  font-size: .84rem;
  letter-spacing: .01em;
  transition: opacity var(--transition), transform var(--transition);
}
.nav-upgrade:hover { background: linear-gradient(135deg,#5a4fd1,#8a7df0) !important; color: var(--white) !important; opacity: .93; transform: translateY(-1px); }
@media (max-width: 480px) { .nav-upgrade-label { display: none; } }

/* ─── Upgrade upsell modal ────────────────────────────────────────────────── */
.upsell-backdrop {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(18,14,36,.55);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 540px) {
  .upsell-backdrop { align-items: center; }
}

.upsell-sheet {
  background: var(--white);
  border-radius: 1.5rem 1.5rem 0 0;
  padding: 1.75rem 1.5rem 2rem;
  width: 100%; max-width: 480px;
  position: relative;
  box-shadow: 0 -8px 48px rgba(0,0,0,.18);
  transform: translateY(60px); opacity: 0;
  transition: transform .28s cubic-bezier(.22,1,.36,1), opacity .22s ease;
}
@media (min-width: 540px) {
  .upsell-sheet {
    border-radius: 1.5rem;
    transform: translateY(0) scale(.95);
  }
}
.upsell-sheet.upsell-enter { transform: translateY(0); opacity: 1; }
@media (min-width: 540px) {
  .upsell-sheet.upsell-enter { transform: scale(1); }
}
.upsell-sheet.upsell-exit { transform: translateY(60px); opacity: 0; }
@media (min-width: 540px) {
  .upsell-sheet.upsell-exit { transform: scale(.95); opacity: 0; }
}

.upsell-x {
  position: absolute; top: 1rem; right: 1.1rem;
  background: var(--cream); border: none; border-radius: 50%;
  width: 30px; height: 30px; cursor: pointer;
  font-size: .9rem; color: var(--ink-light);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.upsell-x:hover { background: var(--cream-dark); }

.upsell-lock { font-size: 2rem; margin-bottom: .5rem; }
.upsell-headline {
  font-family: var(--font-serif); font-size: 1.35rem;
  color: var(--ink); margin: 0 0 .3rem;
}
.upsell-sub { color: var(--ink-light); font-size: .88rem; margin: 0 0 1.25rem; }

/* ── Option cards ── */
.upsell-cards { display: flex; flex-direction: column; gap: .65rem; margin-bottom: 1rem; }

.upsell-card {
  display: flex; align-items: center; gap: .85rem;
  padding: .9rem 1rem;
  border: 1.5px solid var(--cream-dark);
  border-radius: var(--radius);
  cursor: default;
  transition: border-color .15s;
}
.upsell-card-primary {
  border-color: var(--purple);
  background: linear-gradient(135deg,#f6f4ff,#eeeaff);
}

.upsell-card-icon { font-size: 1.5rem; flex-shrink: 0; line-height: 1; }

.upsell-card-body { flex: 1; min-width: 0; }
.upsell-card-name { font-weight: 700; font-size: .9rem; color: var(--ink); }
.upsell-card-desc { font-size: .78rem; color: var(--ink-light); margin-top: .15rem; line-height: 1.4; }

.upsell-card-right { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; flex-shrink: 0; }
.upsell-card-price { font-size: .82rem; font-weight: 700; color: var(--purple); white-space: nowrap; }

.upsell-card-btn {
  background: var(--cream-dark); color: var(--ink);
  border: none; border-radius: 99px;
  padding: .32rem .85rem; font-size: .78rem; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.upsell-card-btn:hover { background: var(--cream); }
.upsell-card-btn:disabled { opacity: .5; cursor: not-allowed; }
.upsell-card-btn-primary {
  background: var(--purple); color: var(--white);
}
.upsell-card-btn-primary:hover { background: #5a4fd1; }

.upsell-allplans {
  display: block; text-align: center;
  font-size: .82rem; color: var(--ink-light);
  text-decoration: none;
  transition: color var(--transition);
}
.upsell-allplans:hover { color: var(--purple); }

.main-content { padding-top: 76px; min-height: 100vh; }

/* ─── Power User badge & card highlight ──────────────────────────────────── */
.power-badge {
  display: inline-flex; align-items: center; gap: .2rem;
  background: linear-gradient(135deg, #6B63D8, #9b94e8);
  color: #fff;
  font-size: .68rem; font-weight: 800; letter-spacing: .04em;
  padding: .18rem .55rem; border-radius: 99px;
  text-transform: uppercase; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(160,160,180,.55);
}
/* wrapper rows so the badge sits on its own line in search cards */
.sc-power-badge { margin: .2rem 0 .1rem; line-height: 1; }
/* gold badge override scoped to search result cards */
.search-result-card .power-badge {
  background: #f5c518;
  color: #000;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  display: inline-block;
  box-shadow: none;
  white-space: nowrap;
}
/* profile page badge sits inline after the name */
#profile-name .power-badge { vertical-align: middle; margin-left: .4rem; }

/* ─── Discover card user-header layout ──────────────────────────────────── */
.user-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.user-header-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
/* Override badge style scoped to discover cards only */
.discover-card .power-badge {
  background: #f5c518;
  color: #000;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: none;
  align-self: center;
  flex-shrink: 0;
  white-space: nowrap;
}
.power-user-card {
  border-color: #6B63D8 !important;
  box-shadow: 0 0 0 2px rgba(107,99,216,.35), 0 4px 12px rgba(180,180,200,.45) !important;
}

/* ─── Auth pages ──────────────────────────────────────────────────────── */
.auth-page-main { min-height: auto; }
.auth-container { padding-top: 2.5rem; padding-bottom: 2rem; }
.auth-header { text-align: center; margin-bottom: 1.75rem; }
.auth-header h1 { margin-bottom: .4rem; }
.auth-footer { text-align: center; margin-top: 1.25rem; font-size: .9rem; color: var(--ink-light); }
.divider { text-align: center; color: var(--sand); margin: 1rem 0; font-size: .85rem; }

/* ─── Onboarding ──────────────────────────────────────────────────────── */
.onboarding-step { display: none; }
.onboarding-step.active { display: block; }
.progress { height: 4px; background: var(--sand); border-radius: 2px; margin-bottom: 1.5rem; overflow: hidden; }
.progress-fill { height: 100%; background: var(--terracotta); border-radius: 2px; transition: width .4s ease; }

.tag-pills { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.pill {
  padding: .35rem .85rem;
  border-radius: 99px;
  background: var(--cream-dark);
  color: var(--ink);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--transition);
  user-select: none;
}
.pill:hover  { border-color: var(--terracotta); }
.pill.active { background: var(--terracotta); color: var(--white); border-color: var(--terracotta); }

/* ─── Discover / Match page ───────────────────────────────────────────── */
/* ── Sticky discover header (search + tabs) ───────────────────────────── */
.discover-sticky-header {
  position: sticky;
  top: 60px; /* height of .nav */
  z-index: 99;
  background: linear-gradient(160deg, #f7f6ff 0%, #edeafa 100%);
  border-bottom: 2px solid var(--sand);
  padding-top: 1rem;
  box-shadow: 0 4px 20px rgba(26,29,78,.10);
}

.discover-sticky-header .search-bar-wrap {
  margin-bottom: .75rem;
}

.page-tabs {
  display: flex;
  border-bottom: none;
  margin-bottom: 0;
}
.tab-btn {
  flex: 1;
  position: relative;
  padding: .75rem;
  background: none;
  border: none;
  border-bottom: none;
  font-family: var(--font-sans);
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink-light);
  cursor: pointer;
  transition: color .18s ease;
  overflow: hidden;
}
.tab-btn::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%; right: 50%;
  height: 2px;
  background: linear-gradient(90deg, var(--terra-light), var(--terracotta));
  border-radius: 99px;
  transition: left .28s cubic-bezier(.34,1.56,.64,1),
              right .28s cubic-bezier(.34,1.56,.64,1);
}
.tab-btn.active { color: var(--terracotta); }
.tab-btn.active::after { left: 12%; right: 12%; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Discover card stack ──────────────────────────────────────────────── */
.card-stack {
  position: relative;
  margin: 0 auto 1.5rem;
  max-width: 400px;
}

.discover-card {
  position: relative;
  width: 100%;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--cream-dark);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform .2s ease, opacity .3s ease, box-shadow .2s ease, border-color .2s ease;
  cursor: pointer;
  box-sizing: border-box;
  animation: cardFadeIn .4s ease both;
}
.discover-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(107,99,216,.22);
  border-color: rgba(107,99,216,.25);
}

/* Shared avatar size for cards */
.discover-card .avatar,
.avatar-photo {
  width: var(--avatar-card);
  height: var(--avatar-card);
  border-radius: 50%;
  background: var(--terracotta);
  color: var(--white);
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  object-fit: cover;
}

/* Discover card header row */
.dc-header { display: flex; align-items: center; gap: .9rem; }
.dc-meta { flex: 1; min-width: 0; }
.discover-card .user-name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
.dc-headline {
  font-size: .85rem;
  color: var(--ink-light);
  margin-top: .15rem;
  font-weight: 500;
}
.dc-location {
  font-size: .78rem;
  color: var(--sand);
  margin-top: .1rem;
  display: flex;
  align-items: center;
  gap: .2rem;
}
.discover-card .user-bio { font-size: .88rem; color: var(--ink-light); line-height: 1.55; }

.skill-tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.skill-tag {
  padding: .2rem .6rem;
  background: var(--cream-dark);
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
  color: var(--ink-light);
}

/* Unified section label — used in discover cards + profile page */
.section-label,
.profile-section-label {
  font-family: var(--font-sans);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--sand);
  margin-bottom: .4rem;
}

.card-view-profile {
  font-size: .76rem;
  font-weight: 600;
  color: var(--terracotta);
  letter-spacing: .02em;
  text-align: right;
  opacity: .8;
}

.card-actions-inline {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding-top: .75rem;
  border-top: 1px solid var(--cream-dark);
}

/* ── Project feed ─────────────────────────────────────────────────────── */
.projects-hero {
  text-align: center;
  padding: 2.5rem 1rem 1.25rem;
}
.projects-hero h1 { margin-bottom: .4rem; }
.projects-hero p  { color: var(--ink-light); max-width: 500px; margin: 0 auto; }

.projects-filters {
  max-width: 860px;
  margin: 0 auto 1.5rem;
  padding: 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
}
.projects-filters input,
.projects-filters select {
  flex: 1;
  min-width: 140px;
  padding: .5rem .85rem;
  border: 1.5px solid var(--sand);
  border-radius: 99px;
  font-family: var(--font-sans);
  font-size: .9rem;
  color: var(--ink);
  background: var(--white);
  outline: none;
  transition: border-color var(--transition);
}
.projects-filters input:focus,
.projects-filters select:focus { border-color: var(--purple); }

.projects-grid {
  max-width: 860px;
  margin: 0 auto 3rem;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.project-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transition: box-shadow var(--transition), transform var(--transition);
}
.project-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.project-card-owner {
  display: flex;
  align-items: center;
  gap: .65rem;
}
.project-card-owner .avatar,
.project-card-owner .avatar-photo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--purple);
  color: var(--white);
  font-size: .95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  object-fit: cover;
}
.project-card-owner-meta { flex: 1; min-width: 0; }
.project-card-owner-name {
  font-weight: 700;
  font-size: .9rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-card-owner-headline {
  font-size: .75rem;
  color: var(--ink-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-stage-badge {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .15rem .55rem;
  border-radius: 99px;
  background: var(--cream-dark);
  color: var(--purple);
  white-space: nowrap;
  flex-shrink: 0;
}
.project-card-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}
.project-card-desc {
  font-size: .86rem;
  color: var(--ink-light);
  line-height: 1.55;
}
.project-card-section { display: flex; flex-direction: column; gap: .3rem; }
.project-card-section .section-label { margin-bottom: .25rem; }
.project-card-tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.project-card-tag {
  padding: .18rem .55rem;
  background: var(--cream-dark);
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--ink-light);
}
.project-card-link {
  font-size: .8rem;
  font-weight: 600;
  color: var(--purple);
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-card-actions {
  display: flex;
  gap: .6rem;
  margin-top: auto;
  padding-top: .75rem;
  border-top: 1px solid var(--cream-dark);
}
.project-card-actions .btn { flex: 1; font-size: .82rem; padding: .5rem .75rem; }
.project-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ink-light);
}
.project-empty p { margin-top: .5rem; font-size: .95rem; }

/* Message modal */
.msg-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(26,29,78,.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 300;
  padding-bottom: env(safe-area-inset-bottom);
}
.msg-modal {
  background: var(--white);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.5rem 1.25rem 2rem;
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  animation: slideUp .22s ease both;
}
@keyframes slideUp { from { transform: translateY(100%); opacity: 0; } }
.msg-modal h3 { font-size: 1.1rem; color: var(--ink); }
/* ── Create project modal form ───────────────────────────────────────── */
.create-project-modal { max-height: 90vh; overflow-y: auto; }
.create-form { display: flex; flex-direction: column; gap: .75rem; }
.create-field { display: flex; flex-direction: column; gap: .3rem; }
.create-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--ink-light);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.create-label .req { color: var(--terracotta); margin-left: .1rem; }
.create-input {
  width: 100%;
  border: 1.5px solid var(--sand);
  border-radius: var(--radius-sm);
  padding: .55rem .85rem;
  font-family: var(--font-sans);
  font-size: .95rem;
  color: var(--ink);
  background: var(--white);
  outline: none;
  transition: border-color var(--transition);
  box-sizing: border-box;
}
.create-input:focus  { border-color: var(--purple); }
textarea.create-input { resize: vertical; min-height: 80px; }
select.create-input  { appearance: none; cursor: pointer; }

/* Clickable card cursor */
.project-card-clickable { cursor: pointer; }
.project-card-clickable:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }

.msg-modal textarea {
  width: 100%;
  border: 1.5px solid var(--sand);
  border-radius: var(--radius-sm);
  padding: .65rem .85rem;
  font-family: var(--font-sans);
  font-size: .95rem;
  resize: vertical;
  min-height: 90px;
  color: var(--ink);
  outline: none;
  transition: border-color var(--transition);
}
.msg-modal textarea:focus { border-color: var(--purple); }
.msg-modal-actions { display: flex; gap: .65rem; }
.msg-modal-actions .btn { flex: 1; }

@media (max-width: 500px) {
  .projects-grid { grid-template-columns: 1fr; }
  .msg-modal { border-radius: var(--radius); margin: 1rem; }
}

.discover-card.dragging      { transition: none !important; }
.discover-card.exiting-right { animation: swipeRight    .32s ease forwards; }
.discover-card.exiting-left  { animation: swipeLeft     .32s ease forwards; }
.discover-card.enter-right   { animation: cardEnterRight .28s cubic-bezier(.25,.46,.45,.94) both; }
.discover-card.enter-left    { animation: cardEnterLeft  .28s cubic-bezier(.25,.46,.45,.94) both; }

.swipe-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  font-size: .72rem;
  color: var(--purple);
  letter-spacing: .04em;
  margin-top: -.25rem;
}
.swipe-nav-label {
  flex: 1;
  text-align: center;
  color: var(--purple);
  opacity: 1;
}
.swipe-nav-arrow {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
  color: var(--purple);
  opacity: 1;
  transition: opacity .15s ease;
  user-select: none;
}
.swipe-nav-arrow.swipe-nav-hidden {
  visibility: hidden;
}

@keyframes swipeRight     { to { transform: translateX(120%) rotate(15deg);  opacity: 0; } }
@keyframes swipeLeft      { to { transform: translateX(-120%) rotate(-15deg); opacity: 0; } }
@keyframes cardEnterRight { from { transform: translateX(60%);  opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes cardEnterLeft  { from { transform: translateX(-60%); opacity: 0; } to { transform: none; opacity: 1; } }


.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ink-light);
}
.empty-state .emoji { font-size: 3rem; margin-bottom: .75rem; }

/* ── Search bar ───────────────────────────────────────────────────────── */
.search-bar-wrap {
  max-width: 400px;
  margin: 0 auto 1.25rem;
}

.search-bar {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #f5f4ff 100%);
  border: 1.5px solid var(--cream-dark);
  border-radius: 99px;
  padding: 0 1rem;
  gap: .4rem;
  height: 40px;
  box-shadow: 0 2px 8px rgba(26,29,78,.07);
  transition: border-color .18s, box-shadow .18s;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.search-bar:focus-within {
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(107,99,216,.18), 0 2px 8px rgba(26,29,78,.07);
  outline: none;
}
.search-icon { font-size: 1rem; color: var(--sand); user-select: none; line-height: 1; }
.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 1rem; /* must be ≥16px to prevent iOS Safari auto-zoom */
  color: var(--ink);
}
.search-bar input:focus {
  outline: none;
  box-shadow: none;
  border: none;
}
.search-bar input::placeholder { color: var(--sand); }
.search-clear {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--sand);
  font-size: .8rem;
  padding: 0 .15rem;
  line-height: 1;
}
.search-clear:hover { color: var(--terracotta); }

/* ── Search results ───────────────────────────────────────────────────── */
#search-results { display: flex; flex-direction: column; gap: .75rem; }

/* Shared avatar for search + discover cards */
.sc-avatar,
.sc-avatar-photo {
  width: var(--avatar-card);
  height: var(--avatar-card);
  border-radius: 50%;
  background: var(--terracotta);
  color: var(--white);
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  object-fit: cover;
}

/* Search result card */
.search-result-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: .85rem;
  padding: .9rem 1rem;
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid var(--cream-dark);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
  position: relative;
  animation: cardFadeIn .35s ease both;
}
.search-result-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: rgba(107,99,216,.22);
}
.search-result-card.search-result-liked { opacity: .55; pointer-events: none; }

/* Text column */
.sc-body { flex: 1; min-width: 0; }
.sc-name {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sc-headline {
  font-size: .82rem;
  color: var(--ink-light);
  margin-top: .1rem;
  font-weight: 500;
}
.sc-location {
  font-size: .76rem;
  color: var(--sand);
  margin-top: .1rem;
}
.sc-looking {
  font-size: .82rem;
  color: var(--ink-light);
  margin-top: .25rem;
}
.sc-about {
  font-size: .82rem;
  color: var(--ink-light);
  margin-top: .3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}
.sc-skills {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .45rem;
}
.sc-skill {
  padding: .2rem .55rem;
  background: var(--cream-dark);
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--ink-light);
}

.search-liked-badge {
  position: absolute;
  top: .75rem;
  right: .9rem;
  font-size: .75rem;
  font-weight: 700;
  color: var(--terracotta);
  white-space: nowrap;
}

/* ── Profile page ─────────────────────────────────────────────────────── */
.profile-back {
  display: inline-flex;
  align-items: center;
  font-size: .85rem;
  font-weight: 600;
  color: var(--terracotta);
  margin-bottom: 1.25rem;
  cursor: pointer;
  text-decoration: none;
}
.profile-back:hover { text-decoration: underline; }

/* Content card wrapper */
.profile-content-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

/* Hero row — photo left, name/headline/location right */
/* legacy — no longer rendered, kept so old refs don't break */
.profile-hero { margin-bottom: 1.25rem; }

/* ─── Profile page header (column · centered) ────────────────────────────── */
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 20px 0;
  margin-bottom: .5rem;
}
.profile-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  background: var(--terracotta);
  display: none; /* shown by JS */
}
.profile-photo-initials.profile-avatar {
  display: none; /* shown by JS via style.display='flex' */
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
}
.profile-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.profile-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  line-height: 1.2;
}
.profile-title {
  font-size: 14px;
  color: #555;
  margin: 0;
  line-height: 1.3;
}
.profile-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  flex-wrap: wrap;
  font-size: 12px;
  color: #777;
  margin: 0;
}
.profile-location {
  font-size: 12px;
  color: #777;
  margin: 0;
}
/* gold badge scoped to profile page only */
.profile-header .power-badge {
  background: #f5c518;
  color: #000;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  display: inline-block;
  box-shadow: none;
  white-space: nowrap;
}

.profile-divider {
  border: none;
  border-top: 1px solid var(--cream-dark);
  margin: 0 0 1.5rem;
}

/* Photo */
.profile-photo-wrap {
  position: relative;
  width: var(--avatar-profile);
  height: var(--avatar-profile);
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--terracotta);
}
.profile-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.profile-photo-initials {
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--white);
}

/* Hero text — Name → Headline → Location */
.profile-hero-text { width: 100%; text-align: center; }
#profile-name {
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 4vw, 1.75rem);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 .25rem;
  line-height: 1.15;
}
.profile-headline {
  font-size: .95rem;
  font-weight: 500;
  color: var(--ink-light);
  margin-top: 0;
  line-height: 1.3;
}
.profile-location {
  display: none;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  font-size: .82rem;
  color: var(--sand);
  font-weight: 500;
  margin-top: .3rem;
}
.profile-location-icon { font-size: .85rem; }

/* Sections — 24px top, 16px bottom */
.profile-section {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
  border-top: 1px solid var(--sand);
}
.profile-section:last-of-type { padding-bottom: 0; }

/* .profile-section-label merged with .section-label above */

.profile-body-text {
  font-size: .92rem;
  line-height: 1.65;
  color: var(--ink-light);
  margin: 0;
}

/* Project / accolade cards */
.profile-card-list { display: flex; flex-direction: column; gap: .65rem; }
.profile-item-card {
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: .85rem 1rem;
  border: 1px solid var(--cream-dark);
}
.profile-item-title {
  font-weight: 700;
  font-size: .9rem;
  color: var(--ink);
}
.profile-item-desc {
  font-size: .83rem;
  color: var(--ink-light);
  margin-top: .25rem;
  line-height: 1.5;
}
.profile-item-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  margin-top: .4rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--terracotta);
}
.profile-item-link:hover { text-decoration: underline; }

/* Links list */
.profile-links-list { display: flex; flex-direction: column; gap: .4rem; }
.profile-link-item {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .88rem;
  font-weight: 500;
  color: var(--terracotta);
  text-decoration: none;
}
.profile-link-item::before { content: '🔗'; font-size: .78rem; }
.profile-link-item:hover { text-decoration: underline; }

/* Connect / Edit buttons */
.profile-connect-btn {
  padding: .65rem 1.6rem;
  background: linear-gradient(135deg, var(--terracotta) 0%, #7B74E0 100%);
  color: var(--white);
  border-radius: 99px;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .02em;
  border: none;
  cursor: pointer;
  transition: background .18s, box-shadow .18s, transform .12s cubic-bezier(.34,1.56,.64,1);
}
.profile-connect-btn:hover {
  background: linear-gradient(135deg, var(--terra-dark) 0%, var(--terracotta) 100%);
  box-shadow: 0 4px 14px rgba(107,99,216,.35);
  transform: scale(1.05);
}
.profile-connect-btn:active { transform: scale(0.95); }
.profile-connect-btn:disabled { opacity: .55; cursor: default; transform: none; }

/* Edit profile button matches pill style */
#edit-profile-btn.btn-secondary {
  border-radius: 99px;
  padding: .65rem 1.6rem;
  font-size: .9rem;
  font-weight: 700;
  width: auto;
}

.profile-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--cream-dark);
}

/* ── Edit profile page ────────────────────────────────────────────────── */
.edit-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

/* Photo upload row */
.photo-upload-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: .6rem;
}
.photo-preview {
  width: var(--avatar-edit);
  height: var(--avatar-edit);
  border-radius: 50%;
  background: var(--terracotta);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--white);
}
.photo-upload-label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.photo-upload-actions { display: flex; flex-direction: column; gap: .4rem; }
.photo-hint { font-size: .78rem; color: var(--ink-light); }

.add-item-btn { margin-top: .25rem; font-size: .85rem; padding: .45rem 1rem; }

/* Dynamic list items */
.dynamic-item {
  position: relative;
  background: var(--cream);
  border: 1.5px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  padding: .9rem 2.5rem .9rem .9rem;
  margin-bottom: .6rem;
}
.dynamic-item--inline {
  display: flex;
  gap: .5rem;
  align-items: center;
  padding-right: 2.5rem;
}
.dynamic-item--inline input { flex: 1; }
.remove-item-btn {
  position: absolute;
  top: .6rem;
  right: .65rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-light);
  font-size: .85rem;
  line-height: 1;
  padding: .2rem .35rem;
  border-radius: 4px;
}
.remove-item-btn:hover { background: var(--cream-dark); color: var(--terracotta); }

/* ── Matches list ─────────────────────────────────────────────────────── */
.match-list { display: flex; flex-direction: column; gap: .75rem; }
.match-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  color: inherit;
}
.match-item:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }

.match-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--terra-light);
  color: var(--white);
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.match-avatar-photo {
  width: 46px; height: 46px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: none;
}

/* Wrapper so the unread heart can sit in the corner */
.match-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 46px;
  height: 46px;
}
.match-avatar-wrap .match-avatar,
.match-avatar-wrap .match-avatar-photo {
  width: 100%;
  height: 100%;
}

/* Unread heart badge — bottom-right of avatar */
.unread-heart {
  position: absolute;
  bottom: -3px;
  right: -5px;
  font-size: .85rem;
  color: #e0457b;
  -webkit-text-stroke: 1.5px #6b63d8;
  line-height: 1;
  pointer-events: none;
  animation: pulse-heart 1s ease-in-out infinite alternate;
}
@keyframes pulse-heart {
  from {
    transform: scale(1);
    text-shadow: 0 0 0px #6b63d8;
  }
  to {
    transform: scale(1.3);
    text-shadow: 0 0 6px #6b63d8, 0 0 14px rgba(107, 99, 216, .55);
  }
}

/* Unread count pill next to name */
.unread-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #6b63d8;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
  margin-left: .35rem;
}

/* Tab heart pulses pink with purple glow when there are unread messages */
#tab-matches.has-unread #tab-matches-heart {
  color: #e0457b;
  display: inline-block; /* required for transform on inline elements */
  animation: pulse-heart 1s ease-in-out infinite alternate;
}

.match-info { flex: 1; min-width: 0; }
.match-name { font-weight: 600; font-size: .95rem; }
.match-skills { font-size: .8rem; color: var(--ink-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-arrow { color: var(--sand); font-size: 1.2rem; }

/* ─── Chat page ───────────────────────────────────────────────────────── */
.chat-layout {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  max-width: 640px;
  /* centre the column on wide screens */
  margin-left: auto;
  margin-right: auto;
}

.chat-header {
  background: var(--white);
  border-bottom: 1px solid var(--sand);
  padding: .85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .85rem;
  flex-shrink: 0;
}
.chat-header .back-btn {
  background: none; border: none; cursor: pointer;
  color: var(--terracotta); font-size: 1.4rem; line-height: 1;
  padding: 0; display: flex; align-items: center;
}
.chat-header .avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--terra-light); color: var(--white); font-family: var(--font-serif); font-size: .95rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.chat-header .info .name { font-weight: 700; font-size: 1rem; }
.chat-header .info .skills { font-size: .78rem; color: var(--ink-light); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.msg-bubble {
  max-width: 72%;
  padding: .65rem 1rem;
  border-radius: 18px;
  font-size: .9rem;
  line-height: 1.45;
  word-break: break-word;
}
.msg-bubble.me {
  align-self: flex-end;
  background: var(--terracotta);
  color: var(--white);
  border-bottom-right-radius: 4px;
}
.msg-bubble.them {
  align-self: flex-start;
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow);
  border-bottom-left-radius: 4px;
}
.msg-time {
  font-size: .68rem;
  color: var(--ink-light);
  text-align: center;
  margin: .25rem 0;
  opacity: .7;
}

.chat-input-bar {
  background: var(--white);
  border-top: 1px solid var(--sand);
  padding: .85rem 1.25rem;
  padding-bottom: calc(.85rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  gap: .75rem;
  align-items: flex-end;
  flex-shrink: 0;
}
.chat-input-bar textarea {
  flex: 1;
  border-radius: 22px;
  padding: .6rem 1rem;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  overflow-y: auto;
  font-size: 1rem; /* ≥16px prevents iOS Safari auto-zoom on focus */
  line-height: 1.4;
  box-sizing: border-box;
  width: 0; /* let flex: 1 control width, prevents textarea from blowing out */
}
.chat-send-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--terracotta);
  border: none;
  color: white;
  font-size: 1.15rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition);
}
.chat-send-btn:hover { background: var(--terra-dark); }

/* ─── Loading spinner ─────────────────────────────────────────────────── */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--sand);
  border-top-color: var(--terracotta);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════════════════════
   MASCOT SYSTEM — Cotrybe brand mascot components
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  --mascot-purple: #6B63D8;
  --mascot-navy:   #1A1D4E;
}

/* ── Keyframes ────────────────────────────────────────────────────────────── */
@keyframes mascotFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes mascotBob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-7px); }
}
@keyframes mascotPulse {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%       { transform: scale(1.07); opacity: .85; }
}
@keyframes mascotBounce {
  0%   { transform: translateY(0)   scale(1); }
  40%  { transform: translateY(-14px) scale(1.06); }
  65%  { transform: translateY(-5px)  scale(1.02); }
  80%  { transform: translateY(-9px)  scale(1.04); }
  100% { transform: translateY(0)   scale(1); }
}
@keyframes mascotTilt {
  0%, 100% { transform: rotate(-8deg); }
  50%       { transform: rotate(-6deg); }
}
@keyframes sparkleOrbit {
  0%, 100% { transform: translate(0,0) rotate(0deg);   opacity: 1; }
  50%       { transform: translate(3px,-7px) rotate(25deg); opacity: .7; }
}
@keyframes completionGrow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ── Base wrap ───────────────────────────────────────────────────────────── */
.mascot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  animation: mascotFadeUp .45s ease both;
}
.mascot-img-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mascot-img {
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(107,99,216,.18));
  border-radius: 50%;
}
.mascot-overlay {
  position: absolute;
  pointer-events: none;
  line-height: 1;
}
.mascot-hands  { bottom: 0; left: 50%; transform: translateX(-50%); font-size: 1.5em; }
.mascot-sparkle {
  top: -6px; right: -8px;
  font-size: 1em;
  animation: sparkleOrbit 1.6s ease-in-out infinite;
}
.mascot-msg {
  font-family: var(--font-sans);
  font-size: .85rem;
  color: var(--ink-light);
  text-align: center;
  max-width: 220px;
  line-height: 1.5;
  margin: 0;
}

/* ── Sizes ───────────────────────────────────────────────────────────────── */
.mascot--sm .mascot-img { width: 60px;  height: 60px;  }
.mascot--md .mascot-img { width: 100px; height: 100px; }
.mascot--lg .mascot-img { width: 140px; height: 140px; }

/* ── Type variants ───────────────────────────────────────────────────────── */
.mascot--onboarding .mascot-img { animation: mascotBob 3.2s ease-in-out infinite; }
.mascot--empty .mascot-img      { animation: mascotBob 3.8s ease-in-out infinite; }
.mascot--loading .mascot-img    { animation: mascotPulse 1.3s ease-in-out infinite; }
.mascot--error .mascot-img {
  animation: mascotTilt 4s ease-in-out infinite;
  filter: drop-shadow(0 4px 10px rgba(107,99,216,.12)) grayscale(.15);
}
.mascot--complete .mascot-img   { animation: mascotBounce .9s cubic-bezier(.34,1.56,.64,1) both; }

/* ── Onboarding header placement ─────────────────────────────────────────── */
.mascot-onboarding-header {
  margin: 0 auto 1.25rem;
  padding-top: .5rem;
}

/* ── Profile completion meter ────────────────────────────────────────────── */
.completion-meter-wrap {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: 1.5rem;
  padding: .75rem 1rem;
  background: linear-gradient(135deg, #f7f6ff, #edeafa);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius);
  animation: mascotFadeUp .4s ease both;
}
.completion-meter-bar {
  flex: 1;
  height: 7px;
  background: var(--cream-dark);
  border-radius: 99px;
  overflow: hidden;
}
.completion-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--mascot-purple), var(--terracotta));
  border-radius: 99px;
  transition: width .4s cubic-bezier(.34,1.56,.64,1);
  transform-origin: left;
}
.completion-label {
  font-size: .75rem;
  font-weight: 700;
  color: var(--ink-light);
  min-width: 3.5rem;
  text-align: right;
  font-family: var(--font-sans);
}
#completion-mascot {
  flex-shrink: 0;
  transition: transform .3s ease;
}
#completion-mascot.is-complete .mascot-img {
  animation: mascotBounce .9s cubic-bezier(.34,1.56,.64,1) both;
  filter: drop-shadow(0 4px 12px rgba(107,99,216,.3));
}
#completion-mascot.is-complete .mascot-sparkle {
  display: inline;
}
#completion-mascot:not(.is-complete) .mascot-sparkle {
  display: none;
}

/* ══════════════════════════════════════════════════════════════════════════
   SPICE PASS — micro-interactions, gradients, depth, texture
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Background grain texture ─────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: .018;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='250' height='250'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='250' height='250' filter='url(%23g)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ── Card fade-in on load ─────────────────────────────────────────────── */
@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Stagger search results */
#search-results .search-result-card:nth-child(1)  { animation-delay: .04s; }
#search-results .search-result-card:nth-child(2)  { animation-delay: .08s; }
#search-results .search-result-card:nth-child(3)  { animation-delay: .12s; }
#search-results .search-result-card:nth-child(4)  { animation-delay: .16s; }
#search-results .search-result-card:nth-child(5)  { animation-delay: .20s; }
#search-results .search-result-card:nth-child(n+6){ animation-delay: .24s; }

/* ── Search bar focus pulse ───────────────────────────────────────────── */
@keyframes searchPulse {
  0%   { box-shadow: 0 0 0 0   rgba(107,99,216,.22), 0 2px 8px rgba(26,29,78,.07); }
  60%  { box-shadow: 0 0 0 5px rgba(107,99,216,.08), 0 2px 8px rgba(26,29,78,.07); }
  100% { box-shadow: 0 0 0 3px rgba(107,99,216,.14), 0 2px 8px rgba(26,29,78,.07); }
}

/* ── Profile photo gradient ring ─────────────────────────────────────── */
#profile-photo-img,
.profile-avatar-initials {
  outline: 3px solid transparent;
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--cream-dark), 0 0 0 5px rgba(107,99,216,.25);
  transition: box-shadow .2s ease;
}
#profile-photo-img:hover,
.profile-avatar-initials:hover {
  box-shadow: 0 0 0 3px var(--cream-dark), 0 0 0 5px rgba(107,99,216,.5);
}

/* ── Online presence & last login ────────────────────────────────────────── */
.profile-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-top: .4rem;
  flex-wrap: wrap;
}
.profile-online-badge {
  font-size: .72rem;
  font-weight: 600;
  padding: .18rem .55rem;
  border-radius: 999px;
  line-height: 1.4;
}
.profile-online-badge.online  { background: rgba(34,197,94,.13); color: #15803d; }
.profile-online-badge.offline { background: var(--cream-dark);   color: var(--ink-light); }
.profile-last-login {
  font-size: .76rem;
  color: var(--ink-light);
}

/* ─── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .card { padding: 1.5rem 1rem; }
  .nav { padding: 0 1rem; }
  .nav-brand { font-size: 1.15rem; }
  .discover-card { padding: 1.25rem; }
  .profile-content-card { padding: 1.25rem; border-radius: var(--radius-sm); }
  .edit-section { padding: 1rem; }
  :root { --avatar-profile: 110px; }
  .profile-hero { gap: .6rem; }
  #profile-name { font-size: 1.3rem; }
  .search-bar-wrap { margin-bottom: 1rem; }
  .card-stack { max-width: 100%; }
}

/* ── Danger zone (edit-profile) ──────────────────────────────────────────── */
.danger-zone {
  margin-top: 2.5rem;
  padding: 1.25rem 1.5rem;
  border: 1.5px solid #f8b4b4;
  border-radius: var(--radius);
  background: #fff8f8;
}
.danger-zone-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #c0392b;
  margin-bottom: .4rem;
}
.danger-zone-desc {
  font-size: .875rem;
  color: var(--ink-light);
  margin-bottom: 1rem;
  line-height: 1.5;
}
.btn-danger {
  background: #e74c3c;
  color: #fff;
  border: none;
}
.btn-danger:hover:not(:disabled) { background: #c0392b; }
.btn-danger:disabled { background: #e8a09a; cursor: not-allowed; opacity: .8; }

/* ── Delete-account confirmation modal ───────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26,29,78,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  backdrop-filter: blur(2px);
}
.modal-backdrop[hidden] { display: none; }
.modal-dialog {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.modal-dialog h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--ink);
  margin-bottom: .75rem;
}
.modal-dialog p {
  font-size: .9rem;
  color: var(--ink-light);
  margin-bottom: .6rem;
  line-height: 1.5;
}
.delete-list {
  margin: .1rem 0 .8rem 1.3rem;
  font-size: .875rem;
  color: var(--ink-light);
  line-height: 1.8;
}
.delete-warn {
  color: #c0392b !important;
  margin-bottom: 1.5rem !important;
}
.modal-actions {
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}
