@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;1,6..72,400;1,6..72,500&display=swap');

/* ════════════════════════════════════════════════════════════
   Campus Bond — Design System v2 (minimal)
   Responsive web app · light + dark theme
   Principles: flat surfaces, hairline borders, soft filled
   inputs, one accent, generous whitespace, calm type.
   ════════════════════════════════════════════════════════════ */

:root {
  /* Brand */
  --indigo:      #4F46E5;
  --indigo-600:  #4338CA;
  --indigo-soft: #EEF0FE;
  --coral:       #FF6A3D;
  --coral-soft:  #FFF1EC;
  --green:       #12A150;
  --green-soft:  #E8F7EE;
  --amber:       #B45309;
  --amber-soft:  #FEF3E2;
  --red:         #E5484D;
  --red-soft:    #FDECEC;

  /* Light theme surfaces */
  --bg:          #F7F7FB;
  --surface:     #FFFFFF;
  --surface-2:   #F2F3F8;
  --elevated:    #FFFFFF;
  --border:      #EAEBF2;
  --border-2:    #DCDEE9;

  /* Text */
  --text:        #17162E;
  --text-2:      #5F5E78;
  --text-3:      #9493A9;

  /* Effects */
  --shadow-sm:   0 1px 2px rgba(23,22,46,.05);
  --shadow:      0 8px 24px rgba(23,22,46,.08);
  --shadow-lg:   0 24px 60px rgba(23,22,46,.18);
  --ring:        0 0 0 3px rgba(79,70,229,.14);
  --radius:      16px;
  --radius-sm:   12px;
  --radius-lg:   22px;
  --maxw:        1200px;
  --page-pad:    24px;   /* horizontal page padding; hscroll bleeds by exactly this */
}

[data-theme="dark"] {
  --indigo:      #7C74FF;
  --indigo-600:  #6F66F5;
  --indigo-soft: #222239;
  --coral:       #FF7E57;
  --coral-soft:  #2E2018;
  --green:       #34D17F;
  --green-soft:  #16271E;
  --amber:       #F2B45A;
  --amber-soft:  #2C2310;
  --red:         #FF6166;
  --red-soft:    #2E1718;

  --bg:          #0C0C13;
  --surface:     #14141D;
  --surface-2:   #1B1B26;
  --elevated:    #1D1D2A;
  --border:      #24242F;
  --border-2:    #30303E;

  --text:        #EDEDF6;
  --text-2:      #A5A4BB;
  --text-3:      #74738A;

  --shadow-sm:   0 1px 2px rgba(0,0,0,.35);
  --shadow:      0 8px 26px rgba(0,0,0,.4);
  --shadow-lg:   0 24px 60px rgba(0,0,0,.55);
  --ring:        0 0 0 3px rgba(124,116,255,.22);
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  line-height: 1.5;
  transition: background .25s, color .25s;
}
button, input, textarea, select { font-family: inherit; color: inherit; }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
ul { list-style: none; }
::selection { background: var(--indigo); color: #fff; }
#scroller::-webkit-scrollbar, .scroll-y::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 20px; }
::-webkit-scrollbar-track { background: transparent; }

.serif { font-weight: bold; }

/* ════════════════════════════════════════════════════════════
   APP SHELL  (responsive: sidebar desktop / bottom-nav mobile)
   ════════════════════════════════════════════════════════════ */
#app { min-height: 100vh; }

.shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr) 312px;
  gap: 0;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  align-items: start;
}

/* Left sidebar */
.sidebar {
  position: sticky; top: 0;
  height: 100vh;
  overflow-y: auto;   /* scroll when the nav is taller than the screen (e.g. super admin) so the footer links stay reachable */
  display: flex; flex-direction: column;
  padding: 24px 18px 22px 4px;
}
/* Auto-hide scrollbar: invisible at rest, thumb appears only while scrolling */
.sidebar { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.sidebar.scrolling { scrollbar-color: var(--border-2) transparent; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: transparent; border-radius: 20px; transition: background .3s; }
.sidebar.scrolling::-webkit-scrollbar-thumb { background: var(--border-2); }
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 6px 12px 26px;
  font-weight: 800; font-size: 20px; letter-spacing: -.4px;
}
.brand .logo {
  width: 38px; height: 38px; border-radius: 12px; flex: 0 0 38px;
  background: var(--indigo);
  display: grid; place-items: center; color: #fff;
}

/* Brand wordmark logo — theme-aware (light = navy, dark = white) */
.brand-logo { width: auto; }
.brand-logo--light { display: block; }
.brand-logo--dark  { display: none; }
[data-theme="dark"] .brand-logo--light { display: none; }
[data-theme="dark"] .brand-logo--dark  { display: block; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 13px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; color: var(--text-2);
  cursor: pointer; transition: background .15s, color .15s;
  position: relative; width: 100%; border: none; background: none; text-align: left;
}
.nav-item svg { width: 21px; height: 21px; flex: 0 0 21px; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--indigo-soft); color: var(--indigo); font-weight: 700; }
.nav-item.active svg { stroke: var(--indigo); }
.nav-item .badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  background: var(--coral); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 20px; display: grid; place-items: center;
}
.nav-cta { margin-top: 16px; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.user-chip {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--radius-sm); cursor: pointer;
  transition: background .15s; border: none; background: none; width: 100%; text-align: left;
}
.user-chip:hover { background: var(--surface-2); }
.user-chip .meta { min-width: 0; }
.user-chip .nm { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .sub { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Main column — clean white canvas between hairlines */
.main {
  min-height: 100vh; min-width: 0; padding: 0 0 90px;
  background: var(--surface);
  border-left: 1px solid var(--border); border-right: 1px solid var(--border);
}
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 14px var(--page-pad); min-height: 60px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar .col {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 60%;
}
.topbar h1 { font-size: 25px; font-weight: 700; letter-spacing: -.2px; text-align: center; margin: 0; }
.topbar .sub { font-size: 12.5px; color: var(--text-3); font-weight: 500; text-align: center; }

/* Pages WITH actions left-align the title, on every screen size.
   Centring is absolute positioning, so it takes the title out of flow and
   lets it sit on top of the buttons the moment they reach the middle —
   which they do on a phone, and on desktop once there are three of them.
   Pages with no actions keep the centred title (the rule above). */
.topbar.has-actions .col {
  position: static;
  transform: none;
  align-items: flex-start;
  text-align: left;
  max-width: none;
  flex: 1 1 auto;
  min-width: 0;              /* without this the title refuses to shrink */
}
.topbar.has-actions h1 {
  text-align: left;
  max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar.has-actions .sub { text-align: left; }
.tb-actions {
  display: flex; align-items: center; gap: 8px;
  flex: 0 0 auto; margin-left: auto;
}
.topbar-back {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; transition: background .15s, border-color .15s;
}
.topbar-back:hover { background: var(--surface-2); border-color: var(--border-2); }
.page { padding: 22px var(--page-pad); }
.page-wide { padding: 22px var(--page-pad); }

/* Right rail */
.rail { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 24px 4px 24px 22px; display: flex; flex-direction: column; gap: 16px; }
.rail::-webkit-scrollbar { width: 0; }

/* Mobile nav (hidden on desktop) */
.mobile-tabbar, .mobile-topbar { display: none; }

/* Content that lives in the right rail on desktop, shown inline once the rail is hidden */
.rail-inline { display: none; }
@media (max-width: 1080px) { .rail-inline { display: block; } }

/* Floating create button — mobile only */
.fab { display: none; }

/* ─── Responsive breakpoints ─────────────────────────────── */
@media (max-width: 1080px) {
  .shell { grid-template-columns: 240px minmax(0,1fr); }
  .rail { display: none; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding: 0; gap: 0; --page-pad: 16px; }
  .sidebar { display: none; }
  .main { border: none; padding-bottom: 84px; max-width: 100%; overflow-x: clip; }
  .mobile-topbar {
    display: flex; align-items: center; gap: 10px;
    position: sticky; top: 0; z-index: 25; padding: 12px 16px; min-height: 56px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--border);
  }
  .mobile-topbar .logo { width: 30px; height: 30px; border-radius: 9px; flex:0 0 30px;
    background: var(--indigo); display:grid; place-items:center; color:#fff; }
  .mobile-topbar .ttl { font-weight: 800; font-size: 17px; }
  .mobile-tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: saturate(160%) blur(14px);
    border-top: 1px solid var(--border);
    padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .mobile-tabbar .tab {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 4px 2px; border-radius: var(--radius-sm); cursor: pointer; border: none; background: none;
    color: var(--text-3); position: relative; flex: 1; min-width: 0;
  }
  .mobile-tabbar .tab svg {
    box-sizing: content-box; padding: 4px 15px; border-radius: 999px;
    transition: background .18s;
  }
  .mobile-tabbar .tab.active { color: var(--indigo); }
  .mobile-tabbar .tab.active svg { background: var(--indigo-soft); }
  .mobile-tabbar .tab .lbl { font-size: 11px; font-weight: 600; letter-spacing: .1px; }
  .mobile-tabbar .tab.active .lbl { font-weight: 700; }
  .mobile-tabbar .tab .dot {
    position: absolute; top: 3px; right: 50%; transform: translateX(21px);
    width: 8px; height: 8px; border-radius: 50%; background: var(--coral); border: 2px solid var(--surface);
  }
  .fab {
    display: grid; place-items: center;
    position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom));
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--indigo); color: #fff; border: none; cursor: pointer;
    box-shadow: var(--shadow-lg); z-index: 45;
    transition: transform .12s, background .15s;
  }
  .fab:active { transform: scale(.9); }
  .fab:hover { background: var(--indigo-600); }
  .topbar { padding: 12px 16px; min-height: 56px; }
  .page, .page-wide { padding: 18px 16px; }

  /* Titles get less room on a phone, and a long action set may still need
     a second row — the left-alignment itself is handled globally above. */
  .topbar { flex-wrap: wrap; row-gap: 8px; column-gap: 8px; }
  .topbar.has-actions h1 { font-size: 20px; }
  .topbar .btn-sm { padding-left: 10px; padding-right: 10px; }
  .tb-actions { flex-wrap: wrap; }
}

/* ════════════════════════════════════════════════════════════
   TYPOGRAPHY HELPERS
   ════════════════════════════════════════════════════════════ */
.h1 { font-size: 25px; font-weight: 700; letter-spacing: -.4px; }
.h2 { font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.h3 { font-size: 16.5px; font-weight: 700; letter-spacing: -.2px; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--text-3); }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.col { display: flex; flex-direction: column; }
.gap6{gap:6px}.gap8{gap:8px}.gap10{gap:10px}.gap12{gap:12px}.gap16{gap:16px}.gap20{gap:20px}.gap24{gap:24px}
.wrap { flex-wrap: wrap; }
.flex1 { flex: 1; min-width: 0; }
.mt4{margin-top:4px}.mt8{margin-top:8px}.mt12{margin-top:12px}.mt16{margin-top:16px}.mt20{margin-top:20px}.mt24{margin-top:24px}.mt32{margin-top:32px}
.mb4{margin-bottom:4px}.mb8{margin-bottom:8px}.mb12{margin-bottom:12px}.mb16{margin-bottom:16px}.mb20{margin-bottom:20px}.mb24{margin-bottom:24px}
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ════════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 14.5px; cursor: pointer; white-space: nowrap;
  border: 1px solid transparent; border-radius: var(--radius-sm); padding: 11px 18px;
  transition: transform .08s, background .15s, border-color .15s, opacity .15s;
  user-select: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 22px; font-size: 15.5px; border-radius: 14px; }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 10px; }
.btn-primary { background: var(--indigo); color: #fff; }
.btn-primary:hover { background: var(--indigo-600); }
.btn-coral { background: var(--coral); color: #fff; }
.btn-coral:hover { filter: brightness(.95); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: var(--indigo-soft); color: var(--indigo); }
.btn-soft:hover { filter: brightness(.97); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { filter: brightness(.97); }
.btn-success { background: var(--green); color: #fff; }
.icon-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); display: grid; place-items: center; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-2); }

/* ════════════════════════════════════════════════════════════
   CARDS & SURFACES — flat, hairline-bordered
   ════════════════════════════════════════════════════════════ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card-pad { padding: 20px; }
.card-hover { cursor: pointer; transition: transform .12s, box-shadow .15s, border-color .15s; }
.card-hover:hover { box-shadow: var(--shadow); border-color: var(--border-2); transform: translateY(-1px); }
.list-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: none; }

/* ════════════════════════════════════════════════════════════
   AVATARS, CHIPS, BADGES
   ════════════════════════════════════════════════════════════ */
.avatar {
  flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 700; letter-spacing: -.3px; overflow: hidden;
  width: 46px; height: 46px; font-size: 16px;
}
.avatar.xl { width: 84px; height: 84px; font-size: 30px; border-radius: 28px; }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.avatar.sm { width: 38px; height: 38px; font-size: 14px; }
.avatar.xs { width: 28px; height: 28px; font-size: 11px; }
/* .center only sets text-align, which cannot centre a block-level box, and
   .avatar is display:grid with a fixed width — so it needs auto margins.
   Scoped to direct children so stacked avatars keep their flex layout. */
.center > .avatar { margin-left: auto; margin-right: auto; }

.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid var(--surface); margin-left: -10px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-stack .avatar-more { background: var(--indigo-soft); color: var(--indigo); font-size: 12px; font-weight: 800; }

/* Connections card count badge */
.conn-count {
  min-width: 32px; height: 32px; padding: 0 9px; border-radius: 999px;
  background: var(--indigo-soft); color: var(--indigo);
  font-weight: 800; font-size: 15px; display: grid; place-items: center; flex: 0 0 auto;
}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 20px; font-size: 12.5px; font-weight: 600;
  background: var(--surface-2); color: var(--text-2); border: 1px solid transparent;
  cursor: default;
}
.chip.click { cursor: pointer; transition: background .15s, color .15s; }
.chip.click:hover { background: var(--indigo-soft); color: var(--indigo); }
.chip.shared { background: var(--indigo-soft); color: var(--indigo); }
.chip.selected { background: var(--indigo); color: #fff; }
.chip-coral { background: var(--coral-soft); color: var(--coral); }

button.chip.click.selected {
    background: var(--indigo);
    color: #fff;
}
.badge-verified {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 700;
  background: var(--green-soft); color: var(--green);
}
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 8px; font-size: 11.5px; font-weight: 700;
}
.pill-indigo { background: var(--indigo-soft); color: var(--indigo); }
.pill-coral  { background: var(--coral-soft);  color: var(--coral); }
.pill-amber  { background: var(--amber-soft);  color: var(--amber); }
.pill-green  { background: var(--green-soft);  color: var(--green); }
.pill-red    { background: var(--red-soft);    color: var(--red); }
.pill-gray   { background: var(--surface-2);   color: var(--text-2); }
.dot-sep { color: var(--text-3); }

/* ════════════════════════════════════════════════════════════
   FORMS — soft filled fields
   ════════════════════════════════════════════════════════════ */
.field { margin-bottom: 16px; }
.label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--text); }
.input, .textarea, .select {
  width: 100%; padding: 12px 15px; font-size: 15px;
  background: var(--surface-2); color: var(--text);
  border: 1.5px solid transparent; border-radius: var(--radius-sm);
  transition: border-color .15s, background .15s, box-shadow .15s; outline: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--indigo); background: var(--surface); box-shadow: var(--ring);
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.input-group { position: relative; }
.input-group .input { padding-left: 44px; }
.input-group .ig-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.help { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.help.err { color: var(--red); }

.segmented {
  display: inline-flex; padding: 4px; gap: 4px; background: var(--surface-2);
  border: none; border-radius: var(--radius-sm);
}
.segmented .seg {
  padding: 7px 15px; border-radius: 9px; font-size: 13.5px; font-weight: 600;
  color: var(--text-2); cursor: pointer; border: none; background: none; transition: all .15s; white-space: nowrap;
}
.segmented .seg.active { background: var(--surface); color: var(--indigo); font-weight: 700; box-shadow: var(--shadow-sm); }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice {
  padding: 16px; border: 1.5px solid var(--border); border-radius: 14px;
  cursor: pointer; transition: all .15s; text-align: center; background: var(--surface);
}
.choice:hover { border-color: var(--border-2); background: var(--surface-2); }
.choice.selected { border-color: var(--indigo); background: var(--indigo-soft); }
.choice .emoji { font-size: 24px; margin-bottom: 6px; }
.choice .ttl { font-weight: 700; font-size: 14.5px; }
.choice .desc { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* OTP inputs */
.otp-row { display: flex; gap: 10px; justify-content: center; }
.otp-input {
  width: 50px; height: 60px; text-align: center; font-size: 24px; font-weight: 700;
  border: 1.5px solid transparent; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text);
  outline: none; transition: border-color .15s, background .15s, box-shadow .15s;
}
.otp-input:focus { border-color: var(--indigo); background: var(--surface); box-shadow: var(--ring); }

/* Toggle switch */
.switch { position: relative; width: 46px; height: 28px; flex: 0 0 46px; cursor: pointer; }
.switch input { display: none; }
.switch .track { position: absolute; inset: 0; background: var(--border-2); border-radius: 20px; transition: background .2s; }
.switch .thumb { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: var(--shadow-sm); }
.switch input:checked + .track { background: var(--indigo); }
.switch input:checked + .track + .thumb { transform: translateX(18px); }

/* ════════════════════════════════════════════════════════════
   AUTH / ONBOARDING (centered)
   ════════════════════════════════════════════════════════════ */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-hero {
  border-radius: var(--radius-lg); padding: 30px; color: #fff; margin-bottom: 22px;
  background: linear-gradient(135deg, #5B54F0 0%, var(--indigo) 55%, #4038C7 100%);
  position: relative; overflow: hidden;
}
.auth-hero::after { content:""; position:absolute; right:-40px; top:-40px; width:160px; height:160px; border-radius:50%; background: rgba(255,255,255,.1); }
.auth-hero .serif { font-size: 30px; line-height: 1.2; display: block; }
.progress { display: flex; gap: 6px; margin-bottom: 22px; }
.progress .seg { height: 4px; flex: 1; border-radius: 6px; background: var(--border-2); transition: background .3s; }
.progress .seg.done { background: var(--indigo); }

/* ════════════════════════════════════════════════════════════
   FEED / HOME composite pieces
   ════════════════════════════════════════════════════════════ */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; margin-top: 4px; }
.section-head .link { font-size: 13.5px; font-weight: 700; color: var(--indigo); cursor: pointer; }
.hscroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; padding-top: 6px; margin: 0 calc(-1 * var(--page-pad)); padding-left: var(--page-pad); padding-right: var(--page-pad); scroll-snap-type: x proximity; scroll-padding-left: var(--page-pad); }
.hscroll::-webkit-scrollbar { height: 0; }
.hscroll > * { scroll-snap-align: start; }

.person-card {
  flex: 0 0 190px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 16px; text-align: center; cursor: pointer;
  transition: transform .12s, box-shadow .15s, border-color .15s;
}
/* the avatar is a block-level grid, so text-align:center won't centre it — do it explicitly */
.person-card .avatar { margin-left: auto; margin-right: auto; }
.person-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--border-2); }

/* Expired happenings — dimmed while in the grace window before they drop off */
.hap-expired { opacity: .6; }
.hap-expired:hover { opacity: .8; }

.stat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.stat { background: var(--surface-2); border: none; border-radius: 14px; padding: 16px 12px; text-align: center; }
.stat .num { font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.stat .lbl { font-size: 11.5px; color: var(--text-3); font-weight: 600; margin-top: 2px; }

/* Empty + loading states */
.empty { text-align: center; padding: 52px 24px; color: var(--text-3); }
.empty .ico { width: 60px; height: 60px; border-radius: 18px; background: var(--surface-2); display: grid; place-items: center; margin: 0 auto 16px; }
.empty .ttl { font-weight: 700; font-size: 16.5px; color: var(--text-2); margin-bottom: 5px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: sk 1.3s infinite; border-radius: var(--radius-sm); }
@keyframes sk { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .6s linear infinite; }
.spinner.dark { border-color: var(--border-2); border-top-color: var(--indigo); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ════════════════════════════════════════════════════════════
   MODAL / SHEET
   ════════════════════════════════════════════════════════════ */
.overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(12,12,24,.45);
  display: grid; place-items: center; padding: 20px; animation: fade .15s;
  backdrop-filter: blur(3px);
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 24px;
  animation: pop .18s cubic-bezier(.2,.9,.3,1.2); max-height: 90vh; overflow-y: auto;
}
@keyframes pop { from { transform: scale(.96) translateY(8px); opacity: 0; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
@media (max-width: 560px) {
  .overlay { align-items: flex-end; padding: 0; }
  .modal { max-width: 100%; border-radius: 22px 22px 0 0; animation: sheet .2s ease; }
  @keyframes sheet { from { transform: translateY(100%); } }
}

/* ════════════════════════════════════════════════════════════
   FIRST-RUN WELCOME GUIDE
   ════════════════════════════════════════════════════════════ */
.guide-overlay { align-items: center; z-index: 150; }
.guide-card {
  width: 100%; max-width: 400px; position: relative; text-align: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 32px 26px 24px;
}
.guide-skip {
  position: absolute; top: 14px; right: 14px; border: none; background: none;
  color: var(--text-3); font-weight: 700; font-size: 13.5px; cursor: pointer;
  padding: 6px 10px; border-radius: 9px; transition: background .15s, color .15s;
}
.guide-skip:hover { color: var(--text); background: var(--surface-2); }
.guide-ico {
  width: 68px; height: 68px; border-radius: 20px; margin: 4px auto 18px;
  background: var(--indigo-soft); color: var(--indigo); display: grid; place-items: center;
}
.g-dots { display: flex; gap: 6px; justify-content: center; margin-top: 22px; }
.g-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border-2); transition: all .25s; }
.g-dot.on { background: var(--indigo); width: 20px; border-radius: 6px; }
@media (max-width: 560px) {
  .guide-overlay { align-items: flex-end; padding: 0; }
  .guide-card { max-width: 100%; border-radius: 22px 22px 0 0; padding-bottom: calc(24px + env(safe-area-inset-bottom)); animation: sheet .22s ease; }
}

/* ════════════════════════════════════════════════════════════
   TOASTS
   ════════════════════════════════════════════════════════════ */
#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: center; width: max-content; max-width: 92vw; }
@media (max-width: 820px) { #toasts { bottom: 96px; } }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  background: #17162E; color: #fff; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-lg); animation: toastin .2s ease;
}
[data-theme="dark"] .toast { background: #2A2A3D; border: 1px solid var(--border-2); }
.toast.err { background: var(--red); }
.toast.ok  { background: var(--green); }
@keyframes toastin { from { transform: translateY(14px); opacity: 0; } }

/* Divider */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.divider-text { display: flex; align-items: center; gap: 14px; color: var(--text-3); font-size: 12.5px; font-weight: 600; margin: 18px 0; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Link list (socials etc) */
.link-tile {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.link-tile:hover { border-color: var(--border-2); background: var(--surface-2); }
.link-tile .li { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 38px; }

/* Feedback — upload dropzone + screenshot */
.fb-drop { border: 1.5px dashed var(--border-2); border-radius: 14px; padding: 22px 16px; cursor: pointer; transition: border-color .15s, background .15s; }
.fb-drop:hover { border-color: var(--indigo); background: var(--surface-2); }
.fb-shot { display: block; max-height: 240px; max-width: 100%; border-radius: 12px; border: 1px solid var(--border); cursor: pointer; }

/* Notification row accent */
.notif-unread { background: var(--indigo-soft); }
.fade-in { animation: scin .22s ease; }
@keyframes scin { from { transform: translateY(6px); opacity: 0; } }

/* ════════════════════════════════════════════════════════════
   LEGAL / POLICY PAGES + agreement
   ════════════════════════════════════════════════════════════ */
.legal-wrap { max-width: 760px; margin: 0 auto; min-height: 100vh; background: var(--bg); padding-bottom: 60px; }
.legal-topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 16px 22px; min-height: 64px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--border);
}
.legal-topbar .col {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 60%;
}
.legal-topbar h1 { font-size: 19px; font-weight: 700; letter-spacing: -.2px; text-align: center; margin: 0; }
.legal-topbar .sub { font-size: 12.5px; color: var(--text-3); font-weight: 500; text-align: center; }
.legal-body { padding: 22px; }
.legal-sec { margin-bottom: 26px; }
.legal-sec h3 { font-size: 16.5px; font-weight: 700; color: var(--text); margin-bottom: 10px; letter-spacing: -.2px; }
.legal-sec p { color: var(--text-2); line-height: 1.65; margin-bottom: 10px; font-size: 14.5px; }
.legal-sub { font-weight: 700; color: var(--text); margin: 8px 0 6px; font-size: 14px; }
.legal-list { margin: 0 0 12px; padding-left: 4px; list-style: none; }
.legal-list li { color: var(--text-2); line-height: 1.6; font-size: 14.5px; padding: 2px 0 2px 20px; position: relative; }
.legal-list li::before { content: ""; position: absolute; left: 4px; top: 12px; width: 6px; height: 6px; border-radius: 50%; background: var(--indigo); }
.legal-foot { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.legal-foot a, .auth-legal-foot a { color: var(--indigo); font-weight: 600; cursor: pointer; font-size: 13.5px; }
.legal-foot a:hover, .auth-legal-foot a:hover { text-decoration: underline; }

/* Auth screen footer links (login) */
.auth-legal-foot { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 9px; margin-top: 18px; }

/* Signup agreement checkbox */
.agree-row { display: flex; align-items: flex-start; gap: 11px; margin-top: 6px; cursor: pointer; }
.agree-row input[type="checkbox"] { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 1px; accent-color: var(--indigo); cursor: pointer; }
.agree-text { font-size: 13px; line-height: 1.5; color: var(--text-2); }
.agree-text a { color: var(--indigo); font-weight: 700; cursor: pointer; }
.agree-text a:hover { text-decoration: underline; }

/* Small policy-links footer (sidebar + account sheet) */
.legal-links-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 12px 14px 4px; }
.legal-links-foot a { color: var(--text-3); font-size: 12px; font-weight: 600; cursor: pointer; }
.legal-links-foot a:hover { color: var(--indigo); text-decoration: underline; }

/* ════════════════════════════════════════════════════════════
   WHISPERS (anonymous feed)
   ════════════════════════════════════════════════════════════ */
.anon-av { width: 40px; height: 40px; border-radius: 50%; flex: 0 0 40px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-3); }
.anon-av.sm { width: 30px; height: 30px; flex: 0 0 30px; }
.wvote { display: inline-flex; align-items: center; gap: 8px; }
.wvbtn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2);
  cursor: pointer; color: var(--text-2); font-weight: 700; font-size: 13px;
  transition: background .12s, color .12s, border-color .12s;
}
.wvbtn svg { width: 16px; height: 16px; }
.wvbtn:hover { background: var(--surface); border-color: var(--border-2); }
.wvbtn.up { color: var(--green); background: var(--green-soft); border-color: transparent; }
.wvbtn.down { color: var(--red); background: var(--red-soft); border-color: transparent; }
.wvc { font-variant-numeric: tabular-nums; min-width: 7px; text-align: center; }
.w-links { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.w-media { width: 100%; max-height: 460px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); display: block; }
.w-embed { position: relative; width: 100%; aspect-ratio: 16/9; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); background: #000; }
.w-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.w-pdf { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.w-pdf iframe { width: 100%; height: 300px; border: 0; background: var(--surface-2); display: block; }
.w-pdf-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); font-size: 13px; font-weight: 700; color: var(--indigo); }
.w-pdfcard { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); transition: border-color .15s, background .15s; }
.w-pdfcard:hover { border-color: var(--border-2); background: var(--surface-2); }
.w-pdfic { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 11px; display: grid; place-items: center; background: var(--red-soft); color: var(--red); }

/* Media carousel (2+ images/videos) */
.w-carousel-wrap { position: relative; margin-top: 10px; }
.w-carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--radius-sm); -webkit-overflow-scrolling: touch; border: 1px solid var(--border); background: var(--surface-2); }
.w-carousel::-webkit-scrollbar { display: none; }
.w-slide { flex: 0 0 100%; scroll-snap-align: center; }
.w-mtile { position: relative; width: 100%; aspect-ratio: 16/10; overflow: hidden; cursor: pointer; display: block; background: var(--surface-2); }
.w-mtile img, .w-mtile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.w-mtile-err { display: none; }
.w-play { position: absolute; inset: 0; margin: auto; width: 54px; height: 54px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; pointer-events: none; }
.w-play svg { fill: currentColor; stroke: none; margin-left: 2px; }
.w-carr { position: absolute; top: calc(50% - 14px); transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; border: none; display: grid; place-items: center; cursor: pointer; }
.w-carr:hover { background: rgba(0,0,0,.7); }
.w-carr-prev { left: 8px; } .w-carr-next { right: 8px; } .w-carr-next svg { transform: rotate(180deg); }
.w-ccount { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.w-cdots { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.w-cdot { width: 6px; height: 6px; border-radius: 50%; background: var(--border-2); transition: all .2s; }
.w-cdot.on { background: var(--indigo); width: 18px; border-radius: 6px; }

/* Fullscreen media lightbox */
.lb-overlay { position: fixed; inset: 0; z-index: 300; background: rgba(8,8,16,.94); display: grid; place-items: center; padding: 24px; animation: fade .15s; }
.lb-stage { max-width: 96vw; max-height: 88vh; display: grid; place-items: center; }
.lb-media { max-width: 96vw; max-height: 88vh; border-radius: 8px; display: block; }
.lb-embed { width: min(96vw, 1100px); aspect-ratio: 16/9; }
.lb-embed iframe { width: 100%; height: 100%; border: 0; border-radius: 8px; }
.lb-btn { position: fixed; width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; border: none; display: grid; place-items: center; cursor: pointer; }
.lb-btn:hover { background: rgba(255,255,255,.22); }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); } .lb-next svg { transform: rotate(180deg); }
.lb-count { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 13px; font-weight: 700; background: rgba(255,255,255,.12); padding: 5px 14px; border-radius: 20px; }
@media (max-width: 560px) { .lb-prev { left: 8px; } .lb-next { right: 8px; } }
.w-link-row { position: relative; }
.w-link-row .input { padding-right: 40px; }
.w-link-rm { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; border: none; background: none; color: var(--text-3); cursor: pointer; display: grid; place-items: center; }
.w-link-rm:hover { background: var(--surface-2); color: var(--red); }

/* ── Coach marks ─────────────────────────────────────────────
   A spotlight is just a small box with an enormous spread shadow: the
   shadow paints everything except the box, so the target stays lit
   without needing an SVG mask or a second stacking context. */
.coach-hole {
  position: fixed; border-radius: 14px; pointer-events: none; z-index: 200;
  box-shadow: 0 0 0 9999px rgba(8, 8, 20, .72);
  transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease;
}
.coach-ring {
  position: fixed; border-radius: 14px; pointer-events: none; z-index: 201;
  border: 2px solid var(--indigo); box-shadow: 0 0 0 4px var(--indigo-soft);
  transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease;
}
.coach-tip {
  position: fixed; z-index: 202; width: min(300px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 16px 18px 14px;
  box-shadow: 0 18px 48px rgba(10, 10, 30, .3);
}
.coach-tip .h3 { font-size: 16px; }
.coach-tip p { font-size: 13.5px; line-height: 1.55; color: var(--text-3); margin: 6px 0 0; }
.coach-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.coach-step { font-size: 12px; color: var(--text-3); font-weight: 600; }
.coach-blocker { position: fixed; inset: 0; z-index: 199; }

/* ── Whisper comments / thread ───────────────────────────────
   The comment count button on a feed card, and the thread modal. */
.wcbtn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 20px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
  cursor: pointer; transition: background .15s, border-color .15s;
}
.wcbtn svg { width: 16px; height: 16px; }
.wcbtn:hover { background: var(--surface); border-color: var(--border-2); }

.wt-post {
  font-size: 14px; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
  padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2);
  margin-bottom: 12px; max-height: 180px; overflow-y: auto;
}
.wt-replyto {
  display: flex; align-items: center; gap: 8px; color: var(--indigo);
  padding: 6px 10px; background: var(--indigo-soft); border-radius: 10px; margin-bottom: 8px;
}
.wt-replyto-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.wt-replyto-label svg { width: 14px; height: 14px; }
/* Small round icon-only cancel — matches the app's .icon-btn look, tinted to
   sit inside the indigo reply bar rather than the browser's default button box. */
.wt-cancel {
  margin-left: auto; flex: 0 0 auto;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  border: none; background: color-mix(in srgb, var(--indigo) 14%, transparent);
  color: var(--indigo); transition: background .15s;
}
.wt-cancel svg { width: 14px; height: 14px; }
.wt-cancel:hover { background: color-mix(in srgb, var(--indigo) 26%, transparent); }
.wt-compose { display: flex; gap: 8px; align-items: flex-end; }
.wt-compose .btn { height: 42px; }
.wt-list { max-height: 46vh; overflow-y: auto; margin-top: 4px; }
.wt-c { padding: 12px 0; border-bottom: 1px solid var(--border); }
.wt-c:last-child { border-bottom: none; }
.wt-reply {
  margin-left: 22px; padding-left: 12px; border-left: 2px solid var(--border);
  border-bottom: none; padding-bottom: 4px;
}
.wt-removed { color: var(--text-3); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.wt-replybtn {
  margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--text-3);
  background: none; border: none; cursor: pointer; padding: 2px 0;
}
.wt-replybtn:hover { color: var(--indigo); }

/* ── Chat ─────────────────────────────────────────────────── */
.online-dot { position:absolute; right:-1px; bottom:-1px; width:11px; height:11px; border-radius:50%; background:var(--green); border:2px solid var(--surface); }
.chat-av-wrap { position:relative; display:inline-flex; }
.chat-row .chat-unread { min-width:20px; height:20px; padding:0 6px; border-radius:10px; background:var(--indigo); color:#fff; font-size:12px; font-weight:700; display:grid; place-items:center; }

/* thread layout: header + scrolling messages + composer, fills the viewport */
.chat-page { display:flex; flex-direction:column; height:calc(100dvh - 76px); padding:0; max-width:620px; }
/* Chat manages its own scroll + reserves tabbar space, so the shell mustn't add its own. */
.main:has(.chat-page) { padding-bottom:0 !important; overflow:hidden; }
.chat-hdr { padding:10px 16px; border-bottom:1px solid var(--border); background:var(--surface); position:sticky; top:0; z-index:2; }
.chat-msgs { flex:1; overflow-y:auto; padding:14px 14px 12px; display:flex; flex-direction:column; gap:2px; }
.chat-replybar:empty { display:none; }
.chat-replyto { display:flex; align-items:center; gap:8px; padding:8px 14px; background:var(--surface-2); border-top:1px solid var(--border); font-size:13px; color:var(--text-2, var(--text-3)); }
.chat-compose { display:flex; align-items:flex-end; gap:8px; padding:10px 12px; border-top:1px solid var(--border); background:var(--surface); }
.chat-compose .textarea { resize:none; max-height:120px; border-radius:20px; padding:9px 14px; }
.chat-compose .btn-primary { border-radius:50%; width:42px; height:42px; padding:0; flex:0 0 auto; }

.chat-note { display:flex; align-items:center; justify-content:center; gap:6px; margin:4px auto 12px; padding:5px 12px; border-radius:20px; background:var(--surface-2); color:var(--text-3); font-size:11.5px; font-weight:500; width:max-content; max-width:90%; }
.chat-note svg { opacity:.8; }
.cmsg { display:flex; margin:3px 0; }
/* Typing indicator bubble (them side) with bouncing dots. */
.ctype-bubble { display:flex; gap:5px; align-items:center; padding:13px 15px; }
.ctype-dot { width:7px; height:7px; border-radius:50%; background:var(--text-3); animation:ctype-bounce 1.25s infinite ease-in-out; }
.ctype-dot:nth-child(2) { animation-delay:.16s; }
.ctype-dot:nth-child(3) { animation-delay:.32s; }
@keyframes ctype-bounce { 0%,60%,100% { transform:translateY(0); opacity:.45; } 30% { transform:translateY(-5px); opacity:1; } }
@media (prefers-reduced-motion: reduce) { .ctype-dot { animation:none; } }
/* New bubbles ease in (only ones not yet shown — not on every poll re-render). */
@keyframes cbubble-in-me   { from { opacity:0; transform:translate(10px,6px) scale(.96); } to { opacity:1; transform:none; } }
@keyframes cbubble-in-them { from { opacity:0; transform:translate(-10px,6px) scale(.96); } to { opacity:1; transform:none; } }
.cmsg-in.me   .cbubble { animation:cbubble-in-me   .24s cubic-bezier(.2,.9,.3,1.2); }
.cmsg-in.them .cbubble { animation:cbubble-in-them .24s cubic-bezier(.2,.9,.3,1.2); }
@media (prefers-reduced-motion: reduce) { .cmsg-in .cbubble { animation:none; } }
.cmsg.me { justify-content:flex-end; }
.cmsg.them { justify-content:flex-start; }
.cwrap { display:flex; flex-direction:column; max-width:78%; min-width:0; }
.cmsg.me .cwrap { align-items:flex-end; }
.cmsg.them .cwrap { align-items:flex-start; }
.cbubble { max-width:100%; padding:8px 11px 5px; border-radius:16px; font-size:14.5px; line-height:1.42; position:relative; cursor:default; word-wrap:break-word; overflow-wrap:anywhere; -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; }
.creply { cursor:pointer; }
/* Flash the target when you jump to a replied-to message. */
@keyframes cflash-ring { 0%,100% { box-shadow:0 0 0 0 rgba(99,102,241,0); } 25% { box-shadow:0 0 0 3px var(--indigo); } }
.cbubble.cflash { animation:cflash-ring 1.5s ease; }
.cmsg.me .cbubble { background:var(--indigo); color:#fff; border-bottom-right-radius:5px; }
.cmsg.them .cbubble { background:var(--surface-2); color:var(--text); border-bottom-left-radius:5px; }
.cbubble.cdeleted { background:transparent; border:1px dashed var(--border); color:var(--text-3); font-style:italic; font-size:13px; display:inline-flex; gap:5px; align-items:center; cursor:default; }
.ctext a { color:inherit; text-decoration:underline; }
/* Link preview card (Open Graph) inside a bubble. */
.clink { display:block; margin:2px 0 6px; border-radius:12px; overflow:hidden; text-decoration:none; color:inherit; background:rgba(0,0,0,.10); max-width:270px; }
.cmsg.me .clink { background:rgba(255,255,255,.15); }
.clink-img { width:100%; aspect-ratio:1.9/1; object-fit:cover; display:block; background:rgba(0,0,0,.18); }
.clink-body { padding:8px 11px; }
.clink-site { font-size:11px; opacity:.75; font-weight:600; margin-bottom:3px; display:flex; align-items:center; gap:4px; }
.clink-site svg { opacity:.7; flex:0 0 auto; }
/* External-link confirmation ("leaving Campus Bond") */
.ext-link { min-width:min(360px, 84vw); }
.ext-head { display:flex; align-items:center; gap:8px; font-size:16px; font-weight:800; }
.ext-host { font-size:16px; font-weight:800; color:var(--indigo); word-break:break-all; }
.ext-full { font-size:12px; color:var(--text-3); word-break:break-all; margin-top:2px; }
.ext-warn { display:flex; align-items:flex-start; gap:7px; margin-top:12px; padding:10px 12px; border-radius:10px; background:var(--coral-soft, rgba(229,72,77,.12)); color:var(--coral, #e5484d); font-size:12.5px; font-weight:600; line-height:1.4; }
.ext-warn svg { flex:0 0 auto; margin-top:1px; }
.clink-title { font-size:13.5px; font-weight:700; line-height:1.3; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.clink-desc { font-size:12px; opacity:.85; line-height:1.35; margin-top:3px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.cimg { max-width:230px; max-height:280px; border-radius:10px; display:block; margin:2px 0 4px; cursor:pointer; }
.creply { border-left:3px solid currentColor; opacity:.9; padding:4px 9px; margin-bottom:6px; font-size:12.5px; line-height:1.35; border-radius:6px; background:rgba(0,0,0,.10); }
.cmsg.me .creply { background:rgba(255,255,255,.16); }
.creply-name { font-weight:700; display:block; margin-bottom:1px; }
.cmeta { display:block; text-align:right; font-size:10.5px; opacity:.7; margin-top:2px; }
.chat-tick { margin-left:4px; letter-spacing:-2px; }
.chat-tick.read { color:#7fd0ff; }
/* Reaction chips sit just under the bubble on the same side (chat-app style). */
.crx { display:flex; gap:5px; flex-wrap:wrap; margin:4px 2px 1px; cursor:pointer; }
.crx-pill { display:inline-flex; align-items:center; gap:4px; background:var(--surface); border:1px solid var(--border); border-radius:16px; padding:2px 8px; box-shadow:0 2px 6px rgba(0,0,0,.16); transition:transform .1s; }
.crx-pill:active { transform:scale(.92); }
.crx-emoji { font-size:16px; line-height:1.1; }
.crx-pill b { font-size:11.5px; font-weight:700; color:var(--text-3); }
.crx-pill.mine { background:var(--indigo-soft); border-color:var(--indigo); }
.crx-pill.mine b { color:var(--indigo); }

/* message action sheet */
.cmenu { display:flex; flex-direction:column; gap:2px; min-width:220px; }
.cmenu-emojis { display:flex; justify-content:space-between; gap:2px; padding:4px 4px 10px; border-bottom:1px solid var(--border); margin-bottom:6px; }
.cmenu-emoji { font-size:24px; background:none; border:none; cursor:pointer; padding:4px; border-radius:8px; line-height:1; }
.cmenu-emoji:hover { background:var(--surface-2); transform:scale(1.15); }
.cmenu-item { display:flex; align-items:center; gap:10px; padding:11px 10px; background:none; border:none; border-radius:10px; cursor:pointer; font-size:14.5px; font-weight:600; color:var(--text); text-align:left; }
.cmenu-item:hover { background:var(--surface-2); }
.cmenu-item.danger { color:var(--coral, #e5484d); }
.toast.chat-banner { align-items:center; gap:8px; max-width:340px; }
/* list-row used as a <button> (chat rows, new-message picker) must not inherit
   the UA button background, or light-on-light hides the name. */
button.list-row { background:transparent; color:inherit; font:inherit; width:100%; text-align:left; border:none; cursor:pointer; }
.chat-new { width:100%; max-width:100%; overflow:hidden; }
.chat-new #cn-list.list-card { max-height:60vh; overflow-y:auto; overflow-x:hidden; }
.chat-new .cn-row { max-width:100%; }
.cn-row .cn-send { color:var(--indigo); flex:0 0 auto; }
.conn-chat { color:var(--indigo); flex:0 0 auto; }
.conn-chat:hover { background:var(--indigo-soft); }

/* ── Group post images ────────────────────────────────────── */
.gp-img { max-width:100%; max-height:360px; border-radius:12px; margin-top:10px; display:block; cursor:pointer; object-fit:cover; }
.gp-preview { position:relative; display:inline-block; margin-top:10px; }
.gp-preview img { max-width:160px; max-height:160px; border-radius:10px; display:block; }
.gp-preview-x { position:absolute; top:6px; right:6px; width:26px; height:26px; border-radius:50%; background:rgba(0,0,0,.6); color:#fff; border:none; cursor:pointer; display:grid; place-items:center; }

/* ── Happening image gallery ─────────────────────────────── */
/* Create-form thumbnails */
.hc-thumbs { display:flex; gap:8px; flex-wrap:wrap; }
.hc-thumb { position:relative; width:72px; height:72px; border-radius:10px; overflow:hidden; }
.hc-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.hc-thumb .gp-preview-x { width:22px; height:22px; top:3px; right:3px; }
.hc-cover { position:absolute; left:0; right:0; bottom:0; font-size:9px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; text-align:center; background:rgba(0,0,0,.55); color:#fff; padding:2px 0; }
/* Detail carousel */
.hap-car { position:relative; margin-bottom:14px; border-radius:12px; overflow:hidden; }
.hap-car-track { display:flex; overflow-x:auto; scroll-snap-type:x mandatory; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
.hap-car-track::-webkit-scrollbar { display:none; }
.hap-car-slide { flex:0 0 100%; width:100%; height:240px; object-fit:cover; scroll-snap-align:center; cursor:zoom-in; display:block; }
.hap-car-dots { position:absolute; left:0; right:0; bottom:10px; display:flex; justify-content:center; gap:6px; pointer-events:none; }
.hap-dot { width:6px; height:6px; border-radius:50%; background:rgba(255,255,255,.5); transition:width .2s, background .2s; }
.hap-dot.on { background:#fff; width:18px; border-radius:3px; }
.hap-car-count { position:absolute; top:10px; right:10px; font-size:11px; font-weight:700; color:#fff; background:rgba(0,0,0,.55); padding:3px 8px; border-radius:999px; font-variant-numeric:tabular-nums; }
/* List-card multi-photo badge */
.hap-thumb-n { position:absolute; right:3px; bottom:3px; display:flex; align-items:center; gap:2px; font-size:10px; font-weight:700; color:#fff; background:rgba(0,0,0,.6); padding:1px 5px 1px 4px; border-radius:999px; line-height:1.4; }

/* ── Profile photos (avatar images) ───────────────────────── */
.avatar-img { position:relative; overflow:hidden; }
.avatar-img img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
/* Avatar upload control on the edit-profile screen */
.av-edit { display:flex; align-items:center; gap:16px; }
.av-edit-actions { display:flex; flex-direction:column; gap:6px; }
.gp-del { color:var(--text-3); flex:0 0 auto; }
.gp-del:hover { color:var(--coral, #e5484d); }

/* ── Avatar cropper ───────────────────────────────────────── */
.cropper { min-width:min(340px, 86vw); }
.crop-view { position:relative; width:300px; max-width:100%; aspect-ratio:1/1; margin:0 auto; overflow:hidden; background:#000; border-radius:14px; touch-action:none; cursor:grab; }
.crop-view:active { cursor:grabbing; }
.crop-view img { position:absolute; top:0; left:0; max-width:none; user-select:none; -webkit-user-drag:none; }
/* Darken outside the circular crop area so the user sees the final shape. */
.crop-mask { position:absolute; inset:0; border-radius:50%; box-shadow:0 0 0 9999px rgba(0,0,0,.5); pointer-events:none; }
#crop-zoom { accent-color:var(--indigo); }

/* Group post body: wrap long unbroken strings (URLs) so they never overflow. */
.gp-body { line-height:1.55; white-space:pre-wrap; overflow-wrap:anywhere; word-break:break-word; }
.gp-body a { color:var(--indigo); text-decoration:underline; }

/* ── YouTube in chat: thumbnail card + floating player ────────── */
.cyt { position:relative; display:block; max-width:270px; aspect-ratio:16/9; border-radius:12px; overflow:hidden; cursor:pointer; margin:2px 0 6px; background:#000; }
.cyt-thumb { width:100%; height:100%; object-fit:cover; display:block; }
.cyt-play { position:absolute; inset:0; margin:auto; width:46px; height:46px; border-radius:50%; background:rgba(0,0,0,.62); display:grid; place-items:center; color:#fff; }
.cyt-play svg { margin-left:2px; }
.cyt-badge { position:absolute; left:8px; bottom:8px; display:flex; align-items:center; gap:4px; background:rgba(0,0,0,.72); color:#fff; font-size:11px; font-weight:600; padding:2px 7px; border-radius:6px; }

.ytfloat { position:fixed; z-index:400; background:#000; border-radius:12px; overflow:hidden; box-shadow:0 20px 55px rgba(0,0,0,.55); user-select:none; }
.ytfloat-head { display:flex; align-items:center; gap:8px; height:34px; padding:0 6px 0 10px; background:#1b1b26; color:#fff; cursor:move; touch-action:none; }
.ytfloat-grip { width:22px; height:10px; flex:0 0 auto; background:radial-gradient(circle, rgba(255,255,255,.5) 1px, transparent 1.5px); background-size:5px 5px; }
.ytfloat-title { flex:1; font-size:12px; font-weight:700; display:flex; align-items:center; gap:5px; overflow:hidden; white-space:nowrap; }
.ytfloat-close { background:none; border:none; color:#fff; cursor:pointer; padding:4px; display:grid; place-items:center; border-radius:6px; }
.ytfloat-close:hover { background:rgba(255,255,255,.15); }
.ytfloat-body { position:relative; width:100%; aspect-ratio:16/9; background:#000; }
.ytfloat-body iframe { position:absolute; inset:0; width:100%; height:100%; border:0; }
.ytfloat-resize { position:absolute; right:0; bottom:0; width:20px; height:20px; cursor:nwse-resize; touch-action:none; background:linear-gradient(135deg, transparent 45%, rgba(255,255,255,.45) 45%, rgba(255,255,255,.45) 55%, transparent 55%); }
