/* ============================================================
   Shared look for the social pages (login, register, feed, profile, groups, cases, messages).
   Same ember palette as the main site, with its Teko display face and crown mark.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Teko:wght@500;600;700&family=Source+Sans+3:ital,wght@0,400;0,600;0,700;0,800;0,900;1,400&display=swap');

:root {
  --bg:            #12161c;
  --bg-alt:        #0f1318;
  --bg-deep:       #0b0e12;
  --surface:       #1a2029;
  --surface-2:     #222a35;
  --surface-3:     #2a3340;
  --border:        rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --border-hover:  rgba(255, 255, 255, 0.22);

  --text:          #eef1f5;
  --text-2:        rgba(238, 241, 245, 0.74);
  --text-3:        rgba(238, 241, 245, 0.48);

  --accent:        #ff7a2f;
  --accent-2:      #ffc95c;
  --accent-grad:   linear-gradient(115deg, #ff5a24 0%, #ff8b3a 45%, #ffc95c 100%);
  /* polished gold with chrome highlights, like the ITD crown */
  --crown-grad:    linear-gradient(180deg, #fff8e1 0%, #ffe39a 22%, #e0a940 45%, #a8741f 55%, #f5d27a 72%, #fff3c4 85%, #c48c2c 100%);
  /* warmer, darker gold-bronze for page titles */
  --bronze-grad:   linear-gradient(180deg, #fbe3b0 0%, #e9bd72 28%, #c58a3e 52%, #9a6228 68%, #dcaa5f 88%, #f0cd8a 100%);
  --accent-dim:    rgba(255, 122, 47, 0.13);
  --accent-glow:   rgba(255, 122, 47, 0.35);
  --on-accent:     #14181e;
  --danger:        #ff4757;
  /* older names some pages still use */
  --gold:          var(--accent);
  --gold-dim:      var(--accent-dim);
  --text-secondary: var(--text-2);

  --font-display:  'Teko', 'Arial Narrow', Impact, sans-serif;
  --font-head:     'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-body:     var(--font-head);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  /* Raised surfaces: a faint top light plus a soft drop */
  --lift: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 28px rgba(0, 0, 0, 0.28);
  --lift-pop: 0 18px 48px rgba(0, 0, 0, 0.55);
  --nav-h: 68px;
  --tabbar-h: 62px;
}

html { background: var(--bg); color-scheme: dark; }

/* Classes like .btn set display, which would otherwise override the hidden attribute */
[hidden] { display: none !important; }

body {
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  /* Same faint ember haze as the main site */
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 90% 55% at 50% -12%, rgba(255, 122, 47, 0.10), transparent 60%),
    radial-gradient(ellipse 70% 45% at 85% 110%, rgba(255, 122, 47, 0.06), transparent 65%),
    radial-gradient(ellipse 60% 40% at 8% 95%, rgba(255, 201, 92, 0.05), transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
}

::selection { background: var(--accent-glow); color: var(--on-accent); }

.logo span {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

a.back-to-site,
.back-link a.back-to-site {
  display: inline-block;
  margin-top: 1rem;
  color: var(--text-3);
  text-decoration: none;
  font-size: 0.9rem;
}
.back-link a.back-to-site:hover { color: var(--accent); }

/* ============================================================
   Shared components
   ============================================================ */

body.app { font-family: var(--font-head); }
body.app * { box-sizing: border-box; }
body.app h1, body.app h2, body.app h3, body.app p { margin: 0; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

/* ---------- Navbar ---------- */
.navbar {
  min-height: var(--nav-h);
  padding: 0.55rem clamp(1rem, 3vw, 2rem);
  display: flex;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-strong);
  position: sticky;
  top: 0;
  z-index: 100;
}
/* The frosted background lives on a layer behind the bar: a backdrop-filter on the bar itself
   would make it the containing block for the fixed phone tab bar and pin that bar to the top */
.navbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(22, 27, 35, 0.86);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.nav-logo {
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: var(--text); text-decoration: none; flex-shrink: 0;
}
.nav-logo img { width: 52px; height: 40px; object-fit: contain; filter: brightness(0.92) contrast(0.9) saturate(0.8); }
.nav-wordmark {
  font: 600 1.55rem/1 var(--font-display); letter-spacing: 0.04em; text-transform: uppercase;
  padding-top: 0.2rem; white-space: nowrap;
}
.nav-wordmark {
  background: var(--crown-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6));
}
.nav-wordmark b {
  font-weight: 600;
  background: var(--crown-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav-links { display: flex; gap: 0.25rem; align-items: center; }
.nav-link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  color: var(--text-2); text-decoration: none; font-weight: 700; font-size: 0.95rem;
  padding: 0.55rem 0.9rem; border-radius: 100px;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: var(--accent); background: var(--accent-dim); }
.nav-link.nav-me { display: none; }
.nav-user { display: flex; align-items: center; gap: 0.6rem; }
.nav-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-grad); color: var(--on-accent); text-decoration: none;
  display: flex; align-items: center; justify-content: center; font-weight: 800;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px rgba(255, 122, 47, 0.55);
}
.btn-logout {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border-strong); color: var(--text-2);
  border-radius: 50%; cursor: pointer; transition: color 0.2s ease, border-color 0.2s ease;
}
.btn-logout:hover { border-color: var(--danger); color: var(--danger); }

/* Phones: slim top bar, and the links become an app-style tab bar along the bottom */
@media (max-width: 760px) {
  :root { --nav-h: 58px; }
  .navbar { padding: 0.45rem 0.9rem; padding-top: calc(0.45rem + env(safe-area-inset-top, 0px)); }
  .nav-logo img { width: 44px; height: 34px; }
  .nav-wordmark { font-size: 1.35rem; }
  .nav-links {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding: 0 0.25rem env(safe-area-inset-bottom, 0px);
    background: rgba(18, 22, 28, 0.94);
    backdrop-filter: saturate(1.4) blur(14px);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-top: 1px solid var(--border-strong);
  }
  .nav-links .nav-link {
    flex-direction: column; justify-content: center; gap: 0.2rem;
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.02em;
    padding: 0.35rem 0; border-radius: 0; background: none !important; position: relative;
  }
  .nav-links .nav-link i { font-size: 1.2rem; }
  .nav-links .nav-link.active::before {
    content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px;
    border-radius: 0 0 3px 3px; background: var(--accent-grad);
  }
  .nav-link.nav-me { display: inline-flex; }
  #adminLink { display: none !important; }
  .nav-user { gap: 0.45rem; }
  .nav-avatar, .btn-logout, .bell { width: 36px; height: 36px; }
  /* The tab bar already has Messages and Me; Me opens a menu with Main site and Log out (social.js mountMeMenu) */
  .navbar .msg-btn, .navbar .nav-avatar, .navbar .btn-home, .navbar .btn-logout { display: none; }
  .nav-links .tab-badge:not([hidden]) { display: block; top: 4px; right: auto; left: calc(50% + 6px); border-color: rgba(18, 22, 28, 0.94); }
  /* Keep page content clear of the tab bar */
  body.app { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 440px) {
  .nav-wordmark { display: none; }
}

/* ---------- Page scaffolding ---------- */
.page { max-width: 1100px; margin: 2rem auto; padding: 0 1rem 4rem; }
.page.narrow { max-width: 820px; }
.page-head { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-end; margin-bottom: 1.75rem; }
.page-head h1, .display {
  font: 600 clamp(2.3rem, 5vw, 3.2rem)/0.95 var(--font-display);
  letter-spacing: 0.02em; text-transform: uppercase; text-wrap: balance;
}
.page-head h1 {
  padding-top: 0.2rem;
  background: var(--bronze-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.55));
}
.page-head p { color: var(--text-2); margin-top: 0.4rem; max-width: 60ch; }
.section-label {
  display: flex; align-items: center; gap: 0.75rem;
  font: 600 1.35rem/1 var(--font-display); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-2); margin: 2.25rem 0 0.9rem; padding-top: 0.15rem;
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--border-strong); }
.page-head + .section-label { margin-top: 0.5rem; }

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 120px), var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--lift);
  transition: border-color 0.25s ease;
}
.card:hover { border-color: var(--border-hover); }
.card h3 { font-size: 1.2rem; font-weight: 800; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card .muted, .muted { color: var(--text-3); font-size: 0.9rem; }
.card p { color: var(--text-2); line-height: 1.6; margin-top: 0.5rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.card-row { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between; align-items: flex-start; }
.card-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; align-items: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1rem; }
.grid .card { margin-bottom: 0; display: flex; flex-direction: column; }
.grid .card .card-actions { margin-top: auto; padding-top: 1rem; }
.meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; color: var(--text-3); font-size: 0.9rem; margin-top: 0.5rem; }
.meta i { color: var(--accent); margin-right: 0.3rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: var(--accent-grad); color: var(--on-accent);
  border: none; padding: 0.65rem 1.4rem; border-radius: 100px;
  font: 800 0.95rem var(--font-head); cursor: pointer; text-decoration: none;
  box-shadow: 0 6px 18px rgba(255, 90, 36, 0.22);
  transition: filter 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { filter: brightness(1.08); box-shadow: 0 8px 24px rgba(255, 90, 36, 0.32); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid var(--border-hover); box-shadow: none; }
.btn-ghost:hover { color: var(--accent); border-color: var(--accent); filter: none; box-shadow: none; background: var(--accent-dim); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid rgba(255, 71, 87, 0.4); box-shadow: none; }
.btn-danger:hover { background: rgba(255, 71, 87, 0.1); filter: none; box-shadow: none; }
.btn-sm { padding: 0.42rem 0.95rem; font-size: 0.85rem; }

.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.03em;
  padding: 0.22rem 0.65rem; border-radius: 100px;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border-strong);
  white-space: nowrap;
}
.badge-accent { background: var(--accent-dim); color: var(--accent); border-color: rgba(255, 122, 47, 0.3); }
.badge-ok { background: rgba(46, 213, 115, 0.1); color: #2ed573; border-color: rgba(46, 213, 115, 0.3); }
.badge-warn { background: rgba(255, 165, 2, 0.1); color: #ffa502; border-color: rgba(255, 165, 2, 0.3); }
.badge-bad { background: rgba(255, 71, 87, 0.1); color: var(--danger); border-color: rgba(255, 71, 87, 0.3); }

.form { display: grid; gap: 1rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.field { display: grid; gap: 0.4rem; }
.field label { font-size: 0.85rem; font-weight: 700; color: var(--text-2); }
.field input, .field textarea, .field select {
  width: 100%; background: var(--bg-alt); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  padding: 0.75rem 0.9rem; font: 1rem var(--font-head);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input[type="checkbox"], .field input[type="radio"] { width: auto; padding: 0; flex-shrink: 0; accent-color: var(--accent); }
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.field .hint { font-size: 0.8rem; color: var(--text-3); }
.form-error { color: var(--danger); font-size: 0.9rem; min-height: 1.2em; }

.empty {
  text-align: center; color: var(--text-3); padding: 2.5rem 1.25rem;
  border: 1px dashed var(--border-hover); border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.015);
}
.empty a { color: var(--accent); }
.tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.notice { background: var(--accent-dim); border: 1px solid rgba(255, 122, 47, 0.3); color: var(--text); border-radius: var(--r-md); padding: 0.9rem 1.1rem; margin-bottom: 1rem; }
details.card > summary { cursor: pointer; font-weight: 800; list-style: none; display: flex; align-items: center; gap: 0.5rem; }
details.card > summary::-webkit-details-marker { display: none; }
details.card[open] > summary { margin-bottom: 1rem; }

@media (max-width: 600px) {
  .page { margin-top: 1.25rem; }
  .card { padding: 1.15rem; border-radius: var(--r-md); }
}

/* ---------- Notifications bell ---------- */
.bell-wrap { position: relative; }
.bell {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-2);
  cursor: pointer; font-size: 1rem; transition: color 0.2s ease, border-color 0.2s ease;
}
.bell:hover { color: var(--accent); border-color: var(--accent); }
/* Unread count on the tab bar's Messages tab: phones only (bigger screens have the messages button) */
.tab-badge { display: none; }
/* Messages button: a link styled like the bell */
.msg-btn { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; text-decoration: none; }
.msg-btn.active { color: var(--accent); border-color: var(--accent); }
/* Find people button: same look, and it stays on phones (social.js mountSearchButton) */
.nav-search { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; text-decoration: none; }
.nav-search.active { color: var(--accent); border-color: var(--accent); }
.bell.ring i { animation: ring 0.6s ease; }
@keyframes ring { 20% { transform: rotate(18deg); } 40% { transform: rotate(-14deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }
.bell-badge {
  position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 100px; background: var(--danger); color: #fff; font: 800 0.7rem/15px var(--font-head);
  border: 2px solid var(--surface);
}
.bell-panel {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 300; width: min(360px, calc(100vw - 1.5rem));
  background: var(--surface); border: 1px solid var(--border-hover); border-radius: var(--r-md);
  box-shadow: var(--lift-pop); overflow: hidden; font-family: var(--font-head);
}
@media (max-width: 760px) { .bell-panel { position: fixed; right: 0.75rem; top: calc(var(--nav-h) + 6px); } }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); }
.bell-head strong { font: 600 1.3rem/1 var(--font-display); letter-spacing: 0.04em; text-transform: uppercase; padding-top: 0.15rem; }
.bell-head .link-btn { background: none; border: none; color: var(--accent); cursor: pointer; font: 700 0.85rem var(--font-head); }
.notif-list { max-height: min(460px, 70vh); overflow-y: auto; }
.notif { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); cursor: pointer; position: relative; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: rgba(255, 122, 47, 0.06); padding-left: 1.6rem; }
.notif.unread::before { content: ''; position: absolute; left: 0.7rem; top: 1.1rem; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.notif-text { color: var(--text); font-size: 0.92rem; line-height: 1.4; overflow-wrap: anywhere; }
.notif-time { color: var(--text-3); font-size: 0.78rem; margin-top: 0.2rem; }
.notif-actions { display: flex; gap: 0.4rem; margin-top: 0.5rem; }

/* ---------- @mention autocomplete & rich text ---------- */
.mention-box {
  position: fixed; z-index: 400; width: 280px; background: var(--surface-2);
  border: 1px solid var(--border-hover); border-radius: var(--r-md); box-shadow: var(--lift-pop);
  overflow: hidden; font-family: var(--font-head);
}
.mention-item { display: flex; gap: 0.6rem; align-items: center; padding: 0.55rem 0.75rem; cursor: pointer; color: var(--text); font-size: 0.9rem; }
.mention-item.on, .mention-item:hover { background: var(--accent-dim); }
.mention-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-grad); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.8rem; flex-shrink: 0; }
a.mention, a.hashtag { color: var(--accent-2); text-decoration: none; font-weight: 700; }
a.mention:hover, a.hashtag:hover { text-decoration: underline; }

/* ---------- Profile photos inside avatars ---------- */
.avatar.has-photo, .nav-avatar.has-photo { background: var(--surface-2); overflow: hidden; padding: 0; }
.avatar img, .nav-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

@media (prefers-reduced-motion: reduce) {
  *:not(.spinner), *::before, *::after { transition: none !important; animation: none !important; }
}

/* Founder badge: a gold crown after the founder's name on posts, comments and the profile */
.founder-badge {
  display: inline-flex; align-items: center; gap: 0.3rem; vertical-align: 0.1em;
  margin-left: 0.35rem; padding: 0.18rem 0.5rem 0.14rem; border-radius: 999px;
  font: 700 0.66rem/1 var(--font-head); letter-spacing: 0.08em; text-transform: uppercase;
  color: #1a1206; background: var(--crown-grad);
  box-shadow: 0 0 0 1px rgba(255, 227, 154, 0.35), 0 2px 8px rgba(224, 169, 64, 0.25);
  white-space: nowrap;
}
.founder-badge i { font-size: 0.7rem; }

/* Back to the public website from the community */
.btn-home {
  height: 40px; display: inline-flex; align-items: center; gap: 0.45rem; padding: 0 0.95rem;
  border: 1px solid var(--border-strong); border-radius: 999px; color: var(--text-2);
  font-weight: 700; font-size: 0.88rem; text-decoration: none; white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.btn-home:hover { color: var(--text); border-color: var(--accent); }
.btn-home i { color: var(--accent); }
@media (max-width: 760px) {
  /* Icon only on small screens so the top bar fits */
  .btn-home { width: 36px; height: 36px; padding: 0; justify-content: center; }
  .btn-home span { display: none; }
}

/* "Undo (5)" countdown before a friend request is sent (social.js sendWithUndo) */
.btn.undo-pending, .undo-pending { background: var(--surface-2) !important; color: var(--accent-2) !important; border: 1px solid var(--accent) !important; box-shadow: none !important; }

/* ============ CALENDAR REMINDER POP-UPS (social.js showReminderPopup) ============ */
.reminder-stack {
  position: fixed; z-index: 2500; left: 50%; transform: translateX(-50%); top: calc(var(--nav-h) + 12px + env(safe-area-inset-top, 0px));
  width: min(440px, calc(100vw - 1.5rem)); display: grid; gap: 0.6rem;
}
.reminder-pop {
  display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 0.85rem; align-items: center; padding: 0.95rem 1rem;
  background: var(--surface-2); border: 1px solid var(--accent); border-radius: var(--r-lg);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6), 0 0 0 4px var(--accent-dim); animation: reminder-in 0.3s ease;
}
@keyframes reminder-in { from { transform: translateY(-14px); opacity: 0; } }
.reminder-pop-icon {
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--accent-grad); color: var(--on-accent); font-size: 1.15rem;
}
.reminder-pop-icon i { animation: ring 0.8s ease 2; }
.reminder-pop-text strong { display: block; font: 600 1.25rem/1 var(--font-display); letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-2); padding-top: 0.15rem; }
.reminder-pop-text p { margin-top: 0.2rem; font-weight: 700; overflow-wrap: anywhere; }
.reminder-pop-actions { grid-column: 1 / -1; display: flex; gap: 0.5rem; justify-content: flex-end; }
@media (prefers-reduced-motion: reduce) { .reminder-pop, .reminder-pop-icon i { animation: none; } }

/* ============ "ME" MENU ON PHONES (social.js mountMeMenu) ============ */
/* Covers the page and tab bar (so tapping Me again, or anywhere else, closes it); the sheet sits just above the tab bar */
.me-sheet-backdrop { position: fixed; inset: 0; z-index: 130; background: rgba(0, 0, 0, 0.55); }
.me-sheet {
  position: fixed; left: 0; right: 0; z-index: 131; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  display: grid; padding: 0.5rem 0.6rem 0.6rem; background: var(--surface);
  border: 1px solid var(--border-hover); border-bottom: 0; border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5); animation: sheet-up 0.18s ease;
}
@keyframes sheet-up { from { transform: translateY(16px); opacity: 0; } }
.me-sheet-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.6rem 0.8rem; margin-bottom: 0.3rem; border-bottom: 1px solid var(--border); }
.me-sheet-head strong { display: block; font-weight: 800; }
.me-sheet-head span { color: var(--text-3); font-size: 0.85rem; }
.me-sheet a, .me-sheet button {
  display: flex; align-items: center; gap: 0.85rem; width: 100%; padding: 0.85rem 0.7rem; border: 0; border-radius: var(--r-sm);
  background: none; color: var(--text); font: 700 1rem var(--font-head); text-decoration: none; text-align: left; cursor: pointer;
}
.me-sheet a i, .me-sheet button i { width: 1.2rem; text-align: center; color: var(--accent); }
.me-sheet a:hover, .me-sheet a:focus-visible, .me-sheet button:hover, .me-sheet button:focus-visible { background: var(--accent-dim); outline: none; }
.me-sheet .me-sheet-logout { margin-top: 0.3rem; border-top: 1px solid var(--border); border-radius: 0 0 var(--r-sm) var(--r-sm); }
.me-sheet .me-sheet-logout i { color: var(--danger); }
@media (prefers-reduced-motion: reduce) { .me-sheet { animation: none; } }

/* ============ EMAIL CONFIRMATION BANNER (social.js mountEmailBanner) ============ */
.email-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem 1rem;
  padding: 0.6rem 2.75rem 0.6rem 1rem; position: relative;
  background: var(--accent-dim); border-bottom: 1px solid var(--border-strong);
  color: var(--text); font-size: 0.92rem; text-align: center;
}
.email-banner i { color: var(--accent); margin-right: 0.35rem; }
.email-banner.is-success i { color: #2ed573; }
.email-banner-send {
  border: 1px solid var(--accent); background: transparent; color: var(--accent);
  border-radius: 100px; padding: 0.3rem 0.9rem; font: inherit; font-weight: 700; cursor: pointer;
}
.email-banner-send:hover { background: var(--accent); color: var(--on-accent, #14181e); }
.email-banner-send:disabled { opacity: 0.6; cursor: default; }
.email-banner-close {
  position: absolute; right: 0.6rem; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--text-3); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0.2rem 0.4rem;
}
.email-banner-close:hover { color: var(--text); }

/* Account settings under "Edit your profile" (profile page) */
.account-form { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border-strong); }
.account-form h3 { font-size: 1rem; margin: 0 0 0.75rem; }
.account-form .hint i { color: #2ed573; }

/* Welcome card for new members (feed) */
.welcome[hidden] { display: none; }
.welcome { border-color: var(--accent); background: linear-gradient(160deg, var(--accent-dim), transparent 60%), var(--surface); }
.welcome-head h2 { font-size: 1.25rem; margin: 0 0 0.3rem; }
.welcome-steps { list-style: none; counter-reset: step; margin: 1.1rem 0 0; padding: 0; display: grid; gap: 1rem; }
.welcome-steps > li { counter-increment: step; position: relative; padding-left: 2.4rem; display: grid; gap: 0.2rem; }
.welcome-steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-dim); color: var(--accent); font-weight: 800; font-size: 0.85rem;
}
.welcome-steps .muted { font-size: 0.9rem; }
.welcome-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.4rem; }
.welcome-row select {
  max-width: 100%; background: var(--bg-alt); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  padding: 0.6rem 0.8rem; font: 0.95rem var(--font-head);
}
.welcome-row select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.welcome-saved { color: #2ed573; font-size: 0.85rem; font-weight: 700; }
#welcomeGroups .side-item { margin-top: 0.4rem; }
.checkin.highlight { box-shadow: 0 0 0 3px var(--accent), 0 0 30px var(--accent-glow); transition: box-shadow 0.3s ease; }
