/* ui.css — BUDU web app design layer (Nov 2026)
   Loaded after app.css. Shares the type and colour of budu.com:
   Bricolage Grotesque for titles/names, Instrument Sans for the interface,
   BUDU violet with a sun-yellow highlight used sparingly.
   Phones: bottom bar.  ≥1024px: left sidebar + right-hand drawer for profiles/chats. */

@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(/assets/fonts/bricolage-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(/assets/fonts/bricolage-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-display: swap; font-weight: 400 700;
  src: url(/assets/fonts/instrument-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-display: swap; font-weight: 400 700;
  src: url(/assets/fonts/instrument-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

/* ── Tokens ─────────────────────────────────────────────────────────── */
:root {
    /* Safe-area insets (notch / home bar). Inside the App Store / Play app shell the native
       wrapper already keeps the page clear of the status and navigation bars, so these are
       zeroed there (html.in-wrapper) — otherwise the gap appears twice. */
    --sat: env(safe-area-inset-top, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    --ink: #16202c;
    --ink-2: #3a4553;
    --muted: #647080;
    --faint: #8b96a3;
    --violet: #1f4fd8;
    --violet-600: #183fb0;
    --violet-50: #eef3fe;
    --violet-100: #dbe6fd;
    --sun: #cfe0ff;            /* 2026-11-11: light blue highlight (was yellow) */
    --sun-50: #eef3fe;
    --live: #12b886;
    --paper: #f3f5f7;
    --card: #ffffff;
    --line: #e0e5ea;
    --line-2: #cfd6dd;
    --danger: #e5484d;

    --f-display: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;   /* one family since the 2026-11-11 redesign */
    --f-ui: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --r-s: 6px; --r-m: 8px; --r-l: 10px;
    --lift: 0 1px 2px rgba(22,32,44,.08);
    --pop:  0 24px 60px -20px rgba(22,32,44, .45), 0 2px 6px rgba(22,32,44, .08);

    --sidebar: 248px;
    --drawer: 480px;

    /* remap the old app.css tokens so every screen picks up the new palette */
    --primary-color: var(--violet);
    --primary-light: #6c93ee;
    --primary-dark: var(--violet-600);
    --secondary-color: var(--sun);
    --danger-color: var(--danger);
    --success-color: var(--live);
    --text-primary: var(--ink);
    --text-secondary: var(--muted);
    --text-light: var(--faint);
    --bg-primary: #ffffff;
    --bg-secondary: var(--paper);
    --bg-tertiary: var(--violet-50);
    --border-color: var(--line);
    --shadow-sm: 0 1px 2px rgba(22,32,44, .05);
    --shadow-md: var(--lift);
    --shadow-lg: var(--pop);

    /* phone bottom bar: full width, flush to the edge */
    --nav-height: 58px;
    --nav-gap: 0px;
    --nav-total: calc(var(--nav-height) + var(--sab));
}

html, body { background: var(--paper); }
body {
    font-family: var(--f-ui);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.45;
    text-rendering: optimizeLegibility;
}
button, input, select, textarea { font-family: inherit; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.skip-link {
    position: fixed; left: 12px; top: -60px; z-index: 99999;
    background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }
.app-main { outline: none; }

/* ── Views + headers ────────────────────────────────────────────────── */
.view { background: var(--paper); }
.view-header {
    background: rgba(243,245,247, .9);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    backdrop-filter: saturate(160%) blur(16px);
    border-bottom: 1px solid var(--line);
    padding: calc(8px + var(--sat)) 16px 8px;
    gap: 8px;
}
.vh-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.vh-title { min-width: 0; }
.view-header h2 {
    font-family: var(--f-display);
    font-size: 28px; line-height: 1.05; font-weight: 700; letter-spacing: -.025em;
    color: var(--ink); display: block; margin: 0;
}
.view-header h2 i { display: none; }
.header-stats { font-size: 13px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-stats:empty { display: none; }
.vh-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.header-invite-btn, .header-invite-btn.header-create-btn {
    position: static; display: inline-flex; align-items: center; gap: 7px;
    height: 36px; padding: 0 14px; border-radius: 999px;
    background: var(--card); color: var(--ink); border: 1px solid var(--line-2);
    font-size: 13.5px; font-weight: 600; box-shadow: none; cursor: pointer;
}
.header-invite-btn:hover { border-color: var(--ink); }
.header-invite-btn.header-create-btn { background: var(--violet); border-color: var(--violet); color: #fff; }
.header-invite-btn i { font-size: 13px; }
@media (max-width: 759px) {
    #viewNearby .header-invite-btn span, #viewFeed .header-invite-btn span, #viewProfile .header-invite-btn span { display: none; }
    #viewNearby .header-invite-btn, #viewFeed .header-invite-btn, #viewProfile .header-invite-btn { width: 36px; padding: 0; justify-content: center; }
}

/* Near me / Worldwide */
.scope-toggle { display: inline-flex; background: #e9edf1; border-radius: 999px; padding: 3px; }
.scope-btn {
    border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600;
    height: 30px; padding: 0 12px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.scope-btn i { font-size: 11px; }
.scope-btn.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(22,32,44,.14); }
@media (max-width: 380px) { .scope-btn i { display: none; } .scope-btn { padding: 0 10px; } }

/* Search */
.view-search { position: relative; margin: 0; }
.view-search input {
    width: 100%; height: 42px; border-radius: 12px; padding: 0 14px 0 40px;
    background: var(--card); border: 1px solid var(--line); font-size: 16px; color: var(--ink);
    box-shadow: none;
}
.view-search input::placeholder { color: var(--faint); }
.view-search input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-50); outline: none; }
.view-search i { left: 14px; color: var(--faint); }

/* Chips (distance, feed, group categories) */
.distance-chips, .feed-distance-filters, .group-cat-chips, .country-bubbles {
    display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 0; margin: 0;
}
.feed-distance-filters { padding: 0; border: 0; background: none; }
.distance-chips::-webkit-scrollbar, .feed-distance-filters::-webkit-scrollbar, .group-cat-chips::-webkit-scrollbar, .country-bubbles::-webkit-scrollbar { display: none; }
.filter-chip, .group-cat-chip, .country-bubble {
    flex-shrink: 0; height: 32px; padding: 0 13px; border-radius: 999px;
    background: var(--card); border: 1px solid var(--line); color: var(--ink-2);
    font-size: 13px; font-weight: 600; box-shadow: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.filter-chip:hover, .group-cat-chip:hover, .country-bubble:hover { border-color: var(--line-2); }
.filter-chip.active, .group-cat-chip.active, .country-bubble.active {
    background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: none;
}
.country-bubbles { flex-wrap: nowrap; }
.country-bubble .cb-count { font-weight: 600; color: var(--faint); font-size: 12px; margin-left: 2px; }
.country-bubble.active .cb-count { color: rgba(255,255,255,.65); }
.country-bubbles-hint { font-size: 13px; color: var(--muted); padding: 6px 2px; }

/* ── People grid ────────────────────────────────────────────────────── */
#nearbyList {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; align-content: start;
    padding: 14px 12px calc(var(--nav-total) + 20px);
}
#nearbyList > :not(.member-tile) { grid-column: 1 / -1; }
@media (min-width: 600px) { #nearbyList { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-left: 16px; padding-right: 16px; } }
@media (min-width: 900px) { #nearbyList { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 22px 16px; padding: 20px 24px 40px; } }

.member-tile {
    all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 7px; cursor: pointer; min-width: 0;
    -webkit-tap-highlight-color: transparent;
}
.member-tile:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 18px; }
.mt-photo {
    position: relative; display: block; aspect-ratio: 3 / 4; border-radius: 18px; overflow: hidden;
    background: hsl(var(--h, 260) 45% 62%);
    background-image: radial-gradient(120% 90% at 20% 0%, hsl(var(--h, 260) 70% 78%) 0%, hsl(var(--h, 260) 45% 48%) 100%);
    isolation: isolate;
}
.mt-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
@media (hover: hover) { .member-tile:hover .mt-photo img { transform: scale(1.04); } }
.member-tile:active .mt-photo { transform: scale(.985); transition: transform .12s; }
.mt-initial {
    position: absolute; inset: 0; display: grid; place-items: center;
    font-family: var(--f-display); font-weight: 700; font-size: 64px; color: rgba(255,255,255,.9); letter-spacing: -.03em; padding-bottom: 18%;
}
.mt-overlay {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
    padding: 36px 11px 10px; display: flex; flex-direction: column; gap: 1px;
    background: linear-gradient(to top, rgba(14, 10, 30, .78) 0%, rgba(14, 10, 30, .38) 55%, transparent 100%);
    color: #fff;
}
.mt-name {
    font-family: var(--f-display); font-weight: 700; font-size: 17px; line-height: 1.15; letter-spacing: -.01em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mt-age { font-weight: 400; opacity: .85; margin-left: 6px; }
.mt-place { font-size: 12.5px; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-dist {
    position: absolute; top: 8px; left: 8px; z-index: 1; max-width: calc(100% - 16px);
    display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px;
    background: rgba(255,255,255,.92); color: var(--ink); font-size: 11.5px; font-weight: 700;
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); white-space: nowrap; overflow: hidden;
}
.mt-dist i { font-size: 9px; color: var(--violet); }
.mt-dist.dist-same_location, .mt-dist.dist-walking_distance { background: var(--sun); }
.mt-dist.dist-same_location i, .mt-dist.dist-walking_distance i { color: var(--ink); }
.mt-dist.dist-far_away { background: rgba(22,32,44,.55); color: #fff; }
.mt-dist.dist-far_away i { color: #fff; }
.mt-live {
    position: absolute; top: 8px; right: 8px; z-index: 1; height: 24px; padding: 0 8px 0 7px; border-radius: 999px;
    display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: #fff;
    background: rgba(18, 184, 134, .95);
}
.mt-live span { width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.35); }
.mt-photo:has(.mt-dist) .mt-live { padding: 0; width: 24px; justify-content: center; font-size: 0; }
.mt-photo:has(.mt-dist) .mt-live span { width: 8px; height: 8px; }
.mt-bio {
    font-size: 13px; line-height: 1.38; color: var(--ink-2); padding: 0 2px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mt-bio-muted { color: var(--faint); }

/* ── Empty, loading, toasts ─────────────────────────────────────────── */
.empty-state { padding: 48px 24px; color: var(--muted); }
.empty-state i { color: var(--violet); opacity: .5; }
.empty-state h3 { font-family: var(--f-display); font-size: 20px; color: var(--ink); letter-spacing: -.01em; }
.loading-spinner::after, .loading-spinner { border-top-color: var(--violet) !important; }
.toast {
    background: var(--ink); color: #fff; border-radius: 999px; font-weight: 600; font-size: 14px;
    box-shadow: var(--pop); bottom: calc(var(--nav-total) + 14px);
}

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn { border-radius: 12px; font-weight: 600; font-size: 15px; letter-spacing: 0; }
.btn-primary {
    background: var(--violet); color: #fff; border: 0; box-shadow: none; min-height: 48px;
}
.btn-primary:hover { background: var(--violet-600); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--muted); border: 0; min-height: 44px; font-weight: 600; cursor: pointer; }
.btn-ghost:hover { color: var(--ink); }
.btn-link { color: var(--violet); font-weight: 600; }

/* ── Bottom bar (phones/tablets) ────────────────────────────────────── */
.bottom-nav {
    left: 0; right: 0; bottom: 0; max-width: none; margin: 0;
    height: var(--nav-total); padding: 0 4px var(--sab);
    border-radius: 0; border: 0; border-top: 1px solid var(--line);
    background: rgba(255,255,255,.94);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    box-shadow: 0 -6px 24px -18px rgba(22,32,44,.25);
}
.nav-indicator { display: none !important; }
.nav-brand, .nav-foot { display: none; }
.nav-item {
    color: var(--muted); gap: 3px; padding-top: 7px; justify-content: flex-start; min-width: 0;
}
.nav-icon-wrap { width: 48px; height: 28px; border-radius: 999px; transition: background .2s; }
.nav-item i { font-size: 18px; color: inherit; transition: none; }
.nav-item .nav-label {
    display: block; font-size: 10.5px; font-weight: 600; letter-spacing: 0; color: inherit; line-height: 1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.nav-item.active, .nav-bell.active, .nav-msgs.active { color: var(--violet); }
.nav-item.active i, .nav-bell.active i, .nav-msgs.active i { color: var(--violet); transform: none; }
.nav-item.active .nav-icon-wrap { background: var(--violet-50); }
.nav-item:active .nav-icon-wrap, .nav-item.active:active .nav-icon-wrap { transform: scale(.94); }
.nav-item .nav-profile-img { width: 24px !important; height: 24px !important; border-width: 0 !important; box-shadow: 0 0 0 1.5px var(--line-2); }
.nav-item.active .nav-profile-img { box-shadow: 0 0 0 2px var(--violet) !important; }
.msgs-badge, .bell-badge {
    background: var(--danger) !important; color: #fff !important; border: 2px solid #fff !important;
    font-family: var(--f-ui); font-weight: 700;
}
/* unread tints from the old dark dock → readable on the light bar */
.nav-msgs.has-unread, .nav-msgs.has-unread i, .nav-bell.has-unread, .nav-bell.has-unread i { color: var(--ink); }
.nav-msgs.active.has-unread, .nav-msgs.active.has-unread i, .nav-bell.active.has-unread, .nav-bell.active.has-unread i { color: var(--violet); }
.nav-msgs .msgs-badge, .nav-bell .bell-badge {
    box-shadow: 0 0 0 2px #fff !important; border: 0 !important; background: var(--danger) !important;
    font-size: 10px; min-width: 17px; height: 17px; line-height: 17px; top: -4px; right: 4px;
}
@media (max-width: 370px) { .nav-item .nav-label { font-size: 9.5px; } .nav-icon-wrap { width: 40px; } }

/* ── Detail panel (profiles, chats list, alerts) ────────────────────── */
.detail-panel { background: var(--paper); }
.detail-header {
    background: rgba(243,245,247,.92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line); padding: calc(10px + var(--sat)) 12px 10px; min-height: 56px;
}
.detail-header-title { font-family: var(--f-display); font-size: 19px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.back-btn, .settings-back, .chat-back {
    width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.detail-scrim { display: none; }

/* ── Profile (yours + others) ───────────────────────────────────────── */
#profileContent, .detail-content { padding-bottom: calc(var(--nav-total) + 24px); }
.profile-card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: none; overflow: hidden;
    margin: 14px 12px 0;
}
.profile-card-cover {
    height: 112px;
    background: var(--violet);
    background-image:
        radial-gradient(circle at 88% 120%, var(--sun) 0 70px, transparent 71px),
        radial-gradient(circle at 12% -40%, rgba(255,255,255,.18) 0 120px, transparent 121px);
}
.profile-avatar { border: 4px solid var(--card); box-shadow: 0 8px 24px -10px rgba(22,32,44,.4); }
.profile-avatar-edit { background: var(--ink); border: 3px solid var(--card); }
.profile-name { font-family: var(--f-display); font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.profile-loc { color: var(--muted); }
.profile-loc i { color: var(--violet); }
.profile-stat-row { border-top: 1px solid var(--line); border-bottom: 0; background: none; border-radius: 0; margin: 14px 0 0; }
.profile-stat-value { font-family: var(--f-display); font-size: 19px; color: var(--ink); }
.profile-stat-label { text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--muted); font-weight: 600; }
.profile-complete { background: var(--sun-50); border: 1px solid #f6e3a8; border-radius: 14px; }
.profile-complete-bar { background: rgba(22,32,44,.08); }
.profile-complete-bar > span { background: var(--ink); }
.profile-complete-cta { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.profile-quick { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); box-shadow: none; }
.profile-quick i { color: var(--violet); }
.profile-section {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: none; margin: 12px 12px 0;
}
.profile-section-title {
    text-transform: none; letter-spacing: -.005em; font-size: 15px; font-weight: 700; color: var(--ink);
    font-family: var(--f-display);
}
.profile-section-title i { color: var(--violet); }
.profile-bio { color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.profile-tag { background: var(--violet-50); color: var(--violet-600); border: 0; font-weight: 600; }
.profile-settings-btn { background: rgba(255,255,255,.95); color: var(--ink); box-shadow: 0 2px 8px rgba(22,32,44,.18); }

/* ── Settings ───────────────────────────────────────────────────────── */
.settings-header h2 { font-family: var(--f-display); font-size: 22px; letter-spacing: -.01em; }
.settings-section { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: none; overflow: hidden; }
.settings-section-title { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.settings-link-btn i:first-child { color: var(--violet); }
.settings-row-push { display: flex; align-items: center; gap: 14px; justify-content: space-between; }
.srp-text { min-width: 0; }
.srp-status { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.settings-mini-btn {
    flex-shrink: 0; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card);
    font-weight: 600; font-size: 13px; color: var(--ink); cursor: pointer;
}
.switch { position: relative; width: 50px; height: 30px; flex-shrink: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #cfd6dd; transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s cubic-bezier(.3,.7,.3,1); }
.switch input:checked + span { background: var(--live); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--violet); outline-offset: 2px; }
.switch input:disabled + span { opacity: .6; }

/* ── Feed, groups, lists ────────────────────────────────────────────── */
#feedList, #groupsList { padding: 14px 12px calc(var(--nav-total) + 20px); }
.feed-post-card, .group-card, .feed-compose-bar {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: none;
}
.feed-post-card:hover, .group-card:hover { box-shadow: var(--lift); }
.feed-compose-go, .groups-fab { background: var(--violet); box-shadow: 0 10px 24px -10px rgba(31,79,216,.7); }
.feed-compose-prompt { background: var(--paper); border: 1px solid var(--line); color: var(--muted); }
.group-card-name { font-family: var(--f-display); letter-spacing: -.01em; }
.req-row { border-bottom: 1px solid var(--line); background: var(--card); }
.req-name { font-weight: 700; color: var(--ink); }
.msg-thread-unread .req-msg { color: var(--ink); font-weight: 600; }
.msg-unread-dot { background: var(--violet) !important; }
.notif-tabs { background: var(--paper); border-bottom: 1px solid var(--line); }
.notif-tab.active { color: var(--violet); border-color: var(--violet); }

/* ── Chat ───────────────────────────────────────────────────────────── */
.chat-panel { background: var(--paper); }
.chat-head { background: rgba(255,255,255,.94); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); padding-top: calc(10px + var(--sat)); }
.chat-title { font-family: var(--f-display); font-weight: 700; font-size: 17px; }
.chat-compose { background: var(--card); border-top: 1px solid var(--line); padding-bottom: calc(10px + var(--sab)); }
.chat-compose input { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; font-size: 16px; height: 44px; }
.chat-compose input:focus { border-color: var(--violet); outline: none; }
.chat-send-btn { background: var(--violet); }

/* ── Push: prompt sheet, offers ─────────────────────────────────────── */
.push-sheet { position: fixed; inset: 0; z-index: 20000; display: flex; align-items: flex-end; justify-content: center; }
.ps-backdrop { position: absolute; inset: 0; background: rgba(22,32,44,.45); opacity: 0; transition: opacity .22s; }
.ps-card {
    position: relative; width: 100%; max-width: 440px; background: var(--card); color: var(--ink);
    border-radius: 24px 24px 0 0; padding: 26px 22px calc(18px + var(--sab));
    transform: translateY(100%); transition: transform .3s cubic-bezier(.2,.8,.2,1); text-align: center;
}
.push-sheet.open .ps-backdrop { opacity: 1; }
.push-sheet.open .ps-card { transform: none; }
@media (min-width: 600px) {
    .push-sheet { align-items: center; }
    .ps-card { border-radius: 24px; transform: translateY(16px) scale(.98); opacity: 0; transition: transform .25s, opacity .2s; padding-bottom: 20px; }
    .push-sheet.open .ps-card { opacity: 1; }
}
.ps-art {
    width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; background: var(--violet); color: #fff;
    display: grid; place-items: center; font-size: 26px; position: relative;
}
.ps-dot { position: absolute; top: 12px; right: 13px; width: 13px; height: 13px; border-radius: 50%; background: var(--sun); border: 2.5px solid var(--violet); }
.ps-card h2 { font-family: var(--f-display); font-size: 23px; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 8px; }
.ps-card p { color: var(--muted); font-size: 15px; margin: 0 auto 16px; max-width: 34ch; }
.ps-preview {
    display: flex; align-items: center; gap: 10px; text-align: left; margin: 0 0 18px; padding: 10px 12px;
    background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
}
.ps-preview img { width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0; }
.ps-preview div { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13.5px; }
.ps-preview span { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-preview small { color: var(--faint); font-size: 12px; align-self: flex-start; }
.ps-steps { text-align: left; margin: 0 0 18px; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 8px; }
.ps-steps li { counter-increment: s; display: flex; gap: 12px; align-items: center; padding: 10px 12px; background: var(--paper); border-radius: 14px; font-size: 14.5px; }
.ps-steps li::before { content: counter(s); flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.ps-steps i { color: var(--violet); margin-left: 2px; }
.ps-actions { display: grid; gap: 4px; }

.push-offer, .nav-push {
    display: flex; align-items: center; gap: 12px; background: var(--sun-50); border: 1px solid #f3dd9b; color: var(--ink);
    border-radius: 16px; padding: 12px; font-size: 13px; line-height: 1.35;
}
.push-offer { margin: 12px; }
.push-offer > i, .nav-push > i { width: 34px; height: 34px; border-radius: 10px; background: var(--sun); color: var(--ink); display: grid; place-items: center; font-size: 15px; flex-shrink: 0; }
.push-offer div, .nav-push div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.push-offer b, .nav-push b { font-size: 14px; }
.push-offer span, .nav-push span { color: var(--ink-2); }
.push-offer button, .nav-push button {
    flex-shrink: 0; height: 34px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--ink); color: #fff;
    font-weight: 600; font-size: 13px; cursor: pointer;
}

/* ── Rate-the-app banner (phones) ───────────────────────────────────── */
#rateAppBanner {
    position: fixed; left: 10px; right: 10px; z-index: 2147483000; top: calc(var(--sat) + 8px);
    display: none; align-items: center; gap: 10px; max-width: 460px; margin: 0 auto;
    background: var(--ink); color: #fff; padding: 10px 10px 10px 14px; border-radius: 16px; box-shadow: var(--pop);
    font-size: 13.5px; font-weight: 600; line-height: 1.25;
    transform: translateY(-12px); opacity: 0; transition: transform .25s ease, opacity .25s ease; cursor: pointer;
}
#rateAppBanner.show { display: flex; }
#rateAppBanner.in { transform: none; opacity: 1; }
#rateAppBanner .rab-star { color: var(--sun); font-size: 18px; flex-shrink: 0; }
#rateAppBanner .rab-txt { flex: 1; min-width: 0; }
#rateAppBanner .rab-txt small { display: block; font-weight: 500; opacity: .7; font-size: 12px; margin-top: 2px; }
@media (max-width: 400px) { #rateAppBanner .rab-txt small { display: none; } }
#rateAppBanner .rab-cta { flex-shrink: 0; background: var(--sun); color: var(--ink); border: 0; border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 700; cursor: pointer; }
#rateAppBanner .rab-x { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 16px; cursor: pointer; display: grid; place-items: center; }

/* ── Public landing + sign in (signed-out) ──────────────────────────── */
.guest { display: none; }
body.is-guest .guest {
    display: grid; position: fixed; inset: 0; z-index: 3000; overflow-y: auto; -webkit-overflow-scrolling: touch;
    background: var(--paper);
    grid-template-columns: minmax(0, 1fr);
    align-content: start; row-gap: 0;
    padding: calc(18px + var(--sat)) 18px calc(28px + var(--sab));
}
body.is-guest .bottom-nav, body.is-guest .view { display: none !important; }
.guest-hero { display: contents; }
.guest-hero > * { grid-column: 1; }
.guest-brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); justify-self: start; margin-bottom: 26px; }
.guest-brand span { font-family: var(--f-display); font-weight: 800; font-size: 22px; letter-spacing: -.03em; }
.guest h1 {
    font-family: var(--f-display); font-weight: 700; color: var(--ink);
    font-size: clamp(34px, 9vw, 64px); line-height: .98; letter-spacing: -.035em; margin: 0 0 14px; max-width: 13ch;
    text-wrap: balance;
}
.guest-lede { font-size: 16.5px; line-height: 1.5; color: var(--ink-2); margin: 0 0 22px; max-width: 46ch; }
.guest-faces {
    list-style: none; margin: 0 0 24px; padding: 6px 0 10px 4px; display: flex; align-items: flex-start; overflow: hidden; min-height: 100px;
}
.guest-faces li {
    flex-shrink: 0; width: 64px; height: 86px; margin-left: -12px; border-radius: 14px; overflow: hidden;
    border: 3px solid var(--paper); background: var(--violet-100);
    transform: rotate(calc((var(--i) - 4.5) * 1.6deg)) translateY(calc(var(--i) * var(--i) * .25px));
    box-shadow: 0 8px 20px -12px rgba(22,32,44,.55);
}
.guest-faces li:first-child { margin-left: 0; }
.guest-faces img { width: 100%; height: 100%; object-fit: cover; display: block; }
.guest-faces li:nth-child(n+7) { display: none; }
.guest-auth { grid-column: 1; margin: 0 0 30px; order: 5; }
.guest-brand { order: 1; } .guest h1 { order: 2; } .guest-lede { order: 3; } .guest-faces { order: 4; }
.guest-stats { order: 6; } .guest-points { order: 7; } .guest-places { order: 8; } .guest-links { order: 9; }
.guest-stats { display: flex; gap: 26px; margin: 0 0 24px; flex-wrap: wrap; }
.guest-stats div { display: flex; flex-direction: column-reverse; }
.guest-stats dd { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 30px; letter-spacing: -.03em; line-height: 1; color: var(--violet); }
.guest-stats dt { font-size: 13px; color: var(--muted); margin-top: 4px; }
.guest-points { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 14px; max-width: 52ch; }
.guest-points li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.guest-points i { width: 34px; height: 34px; border-radius: 11px; background: var(--violet-50); color: var(--violet); display: grid; place-items: center; flex-shrink: 0; font-size: 14px; }
.guest-points b { color: var(--ink); font-weight: 700; }
.guest-places h2 { font-family: var(--f-display); font-size: 17px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 10px; color: var(--ink); }
.guest-places ul { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-wrap: wrap; gap: 6px; }
.guest-places a {
    display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px;
    background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 13.5px; font-weight: 600;
}
.guest-places a:hover { border-color: var(--ink); }
.guest-places small { color: var(--faint); font-weight: 600; font-size: 12px; }
.guest-links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; margin: 6px 0 0; }
.guest-links a { color: var(--muted); text-decoration: none; }
.guest-links a:hover { color: var(--ink); text-decoration: underline; }

.auth-mount { width: 100%; }
.auth-screen { padding: 0; min-height: 0; display: block; background: none; }
.auth-card {
    background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 18px;
    box-shadow: 0 30px 60px -36px rgba(22,32,44,.45);
}
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--paper); border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.auth-tab { border: 0; background: transparent; height: 38px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.auth-tab.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(22,32,44,.14); }
.auth-title { font-family: var(--f-display); font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 14px; color: var(--ink); }
.auth-form { display: block; width: 100%; max-width: none; }
.auth-form .form-group { margin: 0 0 12px; }
.auth-form label:not(.auth-check) { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.auth-form input[type=text], .auth-form input[type=email], .auth-form input[type=password] {
    width: 100%; height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff;
    font-size: 16px; color: var(--ink);
}
.auth-form input::placeholder { color: var(--faint); }
.auth-form input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-50); outline: none; }
.auth-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); margin: 4px 0 16px; cursor: pointer; }
.auth-check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--violet); flex-shrink: 0; }
.auth-check a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.auth-small-link { display: block; text-align: center; margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.auth-foot { margin: 14px 0 0; font-size: 12.5px; color: var(--faint); text-align: center; }
.auth-error { border-radius: 12px; font-size: 14px; margin-bottom: 12px; }
.pw-toggle { color: var(--faint); }

@media (min-width: 1024px) {
    body.is-guest .guest {
        grid-template-columns: minmax(0, 1fr) 400px; column-gap: clamp(40px, 6vw, 96px);
        padding: 36px clamp(32px, 6vw, 96px) 48px; max-width: 1360px; margin: 0 auto; right: 0; left: 0;
    }
    .guest-brand { margin-bottom: 44px; }
    .guest-auth { grid-column: 2; grid-row: 1 / span 9; align-self: start; position: sticky; top: 36px; margin: 92px 0 0; }
    .guest-lede { font-size: 18.5px; margin-bottom: 30px; }
    .guest-faces { margin-bottom: 30px; }
    .guest-faces { min-height: 150px; }
    .guest-faces li { width: 96px; height: 128px; margin-left: -18px; border-width: 4px; border-radius: 18px; }
    .guest-faces li:nth-child(n+7) { display: block; }
    .guest-stats { gap: 40px; margin-bottom: 36px; }
    .guest-stats dd { font-size: 40px; }
    .guest-points { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; margin-bottom: 36px; gap: 20px; }
    .guest-points li { flex-direction: column; }
    .auth-card { padding: 22px; }
}

/* ── Tablet: wider content, still the bottom bar ────────────────────── */
@media (min-width: 760px) and (max-width: 1023px) {
    .bottom-nav { justify-content: center; }
    .nav-item { flex: 0 1 96px; }
}
@media (min-width: 760px) {
    #feedList > *, #groupsList > *, #profileContent > *:not(.profile-settings-btn) { max-width: 680px; margin-left: auto !important; margin-right: auto !important; }
    .profile-card, .profile-section { margin-left: auto; margin-right: auto; }
}

/* ── Desktop: sidebar + right-hand drawer ───────────────────────────── */
@media (min-width: 1024px) {
    :root { --nav-total: 0px; }
    .view, .app-main .view { left: var(--sidebar); }
    .view-header { padding: 24px 32px 14px; gap: 12px; }
    .view-header h2 { font-size: 34px; }
    .view-search { max-width: 560px; }
    #feedList, #groupsList { padding: 20px 32px 48px; }
    #profileContent { padding: 8px 32px 48px; }
    .toast { bottom: 28px; left: calc(50% + var(--sidebar) / 2); }

    .bottom-nav {
        top: 0; bottom: 0; left: 0; right: auto; width: var(--sidebar); height: auto;
        flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 2px;
        padding: 22px 14px 18px; border-top: 0; border-right: 1px solid var(--line);
        background: var(--card); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
    }
    .nav-brand {
        display: flex; align-items: center; gap: 10px; padding: 0 10px 22px; text-decoration: none; color: var(--ink);
    }
    .nav-brand span { font-family: var(--f-display); font-weight: 800; font-size: 23px; letter-spacing: -.03em; }
    .nav-item {
        flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 12px;
        height: 46px; padding: 0 12px; border-radius: 12px; color: var(--ink-2);
    }
    .nav-item:hover { background: var(--paper); }
    .nav-icon-wrap { width: 24px; height: 24px; margin: 0; background: none !important; border-radius: 0; }
    .nav-item i { font-size: 17px; }
    .nav-item .nav-label { font-size: 15px; font-weight: 600; }
    .nav-item.active, .nav-bell.active, .nav-msgs.active { background: var(--violet-50); color: var(--violet); }
    .nav-item[data-view="profile"] { order: 10; margin-top: 6px; }
    .nav-foot { display: flex; flex-direction: column; gap: 8px; margin-top: auto; order: 20; padding-top: 16px; }
    .nav-push { flex-wrap: wrap; }
    .nav-push button { width: 100%; }
    .nav-invite {
        height: 42px; border-radius: 12px; border: 0; background: var(--violet); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer;
        display: flex; align-items: center; justify-content: center; gap: 8px;
    }
    .nav-invite:hover { background: var(--violet-600); }
    .nav-get-app { text-align: center; font-size: 13px; color: var(--muted); text-decoration: none; padding: 4px; }
    .nav-get-app:hover { color: var(--ink); }
    .msgs-badge, .bell-badge { top: -6px !important; right: -9px !important; }

    /* profiles, chats, alerts open as a drawer on the right; the list stays visible */
    .detail-panel, .detail-panel.with-nav {
        left: auto; right: 0; width: var(--drawer); max-width: 100vw; bottom: 0; z-index: 4000;
        border-left: 1px solid var(--line); box-shadow: var(--pop);
    }
    .detail-panel.open { animation: drawerIn .26s cubic-bezier(.2,.8,.2,1); }
    .detail-panel.with-nav .detail-content { padding-bottom: 32px; }
    .detail-scrim { position: fixed; inset: 0 0 0 var(--sidebar); z-index: 3990; background: rgba(22,32,44,.28); }
    #app:has(.detail-panel.open) .detail-scrim { display: block; animation: fadeIn .2s; }
    .chat-panel { left: auto; right: 0; width: var(--drawer); border-left: 1px solid var(--line); box-shadow: var(--pop); z-index: 10003; }
    .profile-card, .profile-section { margin-left: 16px; margin-right: 16px; }
    .detail-content .profile-card { margin-top: 16px; }
    #rateAppBanner { display: none !important; }
}
@keyframes drawerIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* tiles must not inherit the old list-card chrome (hover/active states included) */
.member-card.member-tile, .member-card.member-tile:hover, .member-card.member-tile:active {
    background: none; border: 0; padding: 0; box-shadow: none; transform: none; margin: 0;
}
.toast { max-width: calc(100vw - 32px); white-space: normal; text-align: center; border-radius: 16px; line-height: 1.35; }
.nav-push[hidden], .push-offer[hidden] { display: none !important; }
.profile-stat-value { white-space: nowrap; font-size: 17px; }
/* hold the sign-up card's space until app.js draws it (no layout shift) */
body.is-guest .auth-mount { min-height: 554px; }
@media (min-width: 1024px) { body.is-guest .auth-mount { min-height: 562px; } }

/* ── Admin ──────────────────────────────────────────────────────────── */
.admin-box {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin: 16px 12px 0; padding: 12px 14px; border: 1px dashed var(--danger); border-radius: 16px; background: #fff5f6; font-size: 14px;
}
.admin-box div { display: flex; flex-direction: column; }
.admin-box span { color: var(--muted); font-size: 12.5px; }
.admin-del-btn { height: 38px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--danger); color: #fff; font-weight: 600; font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.btn-danger { background: var(--danger); color: #fff; border: 0; min-height: 48px; cursor: pointer; }
.btn-danger:disabled { opacity: .45; cursor: not-allowed; }
.ps-art-danger { background: var(--danger); }
.adm-label { display: block; text-align: left; font-size: 13.5px; font-weight: 600; margin: 4px 0 6px; }
.adm-input { width: 100%; height: 48px; border-radius: 12px; border: 1px solid var(--line-2); padding: 0 12px; font-size: 16px; margin-bottom: 4px; }
.adm-input:focus { outline: none; border-color: var(--danger); box-shadow: 0 0 0 3px #ffe3e6; }
.adm-err { color: var(--danger) !important; font-size: 13.5px !important; min-height: 1.2em; margin: 4px 0 10px !important; text-align: left; }

/* ══ Direct messages v2 ═══════════════════════════════════════════════ */
.dm { position: fixed; left: 0; right: 0; top: 0; bottom: var(--nav-total); z-index: 1500; display: none; background: var(--paper); }
.dm.open { display: flex; }
.dm.under { z-index: 1000; }
.dm-inbox { display: flex; flex-direction: column; width: 100%; min-width: 0; background: var(--card); }
.dm-chat { display: none; flex-direction: column; flex: 1; min-width: 0; position: relative; background: var(--paper); }
.dm[data-mode="chat"] { bottom: 0; z-index: 2600; }
.dm[data-mode="chat"].under { z-index: 1000; }
.dm[data-mode="chat"] .dm-inbox { display: none; }
.dm[data-mode="chat"] .dm-chat { display: flex; }
body.dm-open #rateAppBanner { display: none !important; }

/* inbox */
.dm-ih { display: flex; align-items: baseline; gap: 10px; padding: calc(14px + var(--sat)) 16px 8px; }
.dm-ih h2 { font-family: var(--f-display); font-size: 28px; font-weight: 700; letter-spacing: -.025em; margin: 0; }
.dm-ih-count { font-size: 13px; color: var(--violet); font-weight: 600; }
.dm-search { position: relative; margin: 4px 12px 8px; }
.dm-search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 13px; }
.dm-search input { width: 100%; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); padding: 0 12px 0 36px; font-size: 16px; color: var(--ink); }
.dm-search input:focus { outline: none; border-color: var(--violet); background: #fff; box-shadow: 0 0 0 3px var(--violet-50); }
.dm-list { flex: 1; overflow-y: auto; padding: 0 6px 16px; }
.dm-t { all: unset; box-sizing: border-box; display: flex; gap: 12px; align-items: center; width: 100%; padding: 10px; border-radius: 14px; cursor: pointer; }
.dm-t:hover { background: var(--paper); }
.dm-t.active { background: var(--violet-50); }
.dm-t:focus-visible { outline: 2px solid var(--violet); }
.dm-av { position: relative; flex-shrink: 0; width: 50px; height: 50px; }
.dm-av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--violet-50); }
.dm-on { position: absolute; right: 1px; bottom: 1px; width: 13px; height: 13px; border-radius: 50%; border: 2.5px solid #fff; background: transparent; display: none; }
.dm-on.on { display: block; background: var(--live); }
.dm-t-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dm-t-top, .dm-t-bot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dm-t-top b { font-weight: 600; font-size: 15.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-t-top time { font-size: 12px; color: var(--faint); flex-shrink: 0; }
.dm-t-prev { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-t.unread .dm-t-top b, .dm-t.unread .dm-t-prev { color: var(--ink); font-weight: 700; }
.dm-t.unread time { color: var(--violet); font-weight: 600; }
.dm-badge { flex-shrink: 0; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 999px; background: var(--violet); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.dm-typing-txt { color: var(--live); font-style: normal; font-weight: 600; }
.dm-tk { font-size: 11px; color: var(--faint); margin-left: 3px; }
.dm-tk-seen { color: #4fc3ff; }
.dm-tk-fail { color: var(--danger); }
.dm-none { text-align: center; padding: 56px 24px; color: var(--muted); }
.dm-none i { font-size: 34px; color: var(--violet); opacity: .5; }
.dm-none h3 { font-family: var(--f-display); color: var(--ink); font-size: 20px; margin: 12px 0 4px; }
.dm-none p { margin: 0 0 16px; }
.dm-none .btn { min-height: 42px; padding: 0 18px; }
.dm-none-s { padding: 24px; }

/* conversation header */
.dm-ch { display: flex; align-items: center; gap: 6px; padding: calc(8px + var(--sat)) 10px 8px; background: rgba(255,255,255,.94);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); flex-shrink: 0; z-index: 2; }
.dm-back, .dm-hbtn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--ink); cursor: pointer; display: grid; place-items: center; font-size: 17px; flex-shrink: 0; }
.dm-back:hover, .dm-hbtn:hover { background: var(--paper); }
.dm-who { all: unset; flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 2px 4px; border-radius: 12px; }
.dm-who:focus-visible { outline: 2px solid var(--violet); }
.dm-who .dm-av { width: 40px; height: 40px; }
.dm-who .dm-on { width: 12px; height: 12px; }
.dm-who-t { display: flex; flex-direction: column; min-width: 0; }
.dm-who-t b { font-family: var(--f-display); font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.dm-who-t small { font-size: 12.5px; color: var(--muted); min-height: 1em; }

/* messages */
.dm-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 10px 10px 6px; position: relative; -webkit-overflow-scrolling: touch; }
.dm-msgs { display: flex; flex-direction: column; }
.dm-day, .dm-unread-line { display: flex; justify-content: center; margin: 14px 0 8px; }
.dm-day span { font-size: 12px; font-weight: 600; color: var(--muted); background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.dm-unread-line { position: relative; }
.dm-unread-line::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--sun); }
.dm-unread-line span { position: relative; font-size: 12px; font-weight: 700; background: var(--sun); color: var(--ink); border-radius: 999px; padding: 2px 10px; }
.dm-r { position: relative; display: flex; flex-direction: column; max-width: 80%; margin-top: 2px; transition: transform .15s; }
.dm-r.grp-t { margin-top: 8px; }
.dm-r.mine { align-self: flex-end; align-items: flex-end; }
.dm-r.theirs { align-self: flex-start; align-items: flex-start; }
.dm-b {
    position: relative; padding: 7px 11px 6px; border-radius: 20px; font-size: 15.5px; line-height: 1.38; word-wrap: break-word; overflow-wrap: anywhere;
    box-shadow: 0 1px 1px rgba(22,32,44,.06); max-width: 100%;
}
.dm-r.mine .dm-b { background: var(--violet); color: #fff; }
.dm-r.theirs .dm-b { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.dm-r.mine:not(.grp-b) .dm-b { border-bottom-right-radius: 6px; }
.dm-r.mine:not(.grp-t) .dm-b { border-top-right-radius: 6px; }
.dm-r.theirs:not(.grp-b) .dm-b { border-bottom-left-radius: 6px; }
.dm-r.theirs:not(.grp-t) .dm-b { border-top-left-radius: 6px; }
.dm-r.mine.grp-b .dm-b { border-bottom-right-radius: 6px; }
.dm-r.theirs.grp-b .dm-b { border-bottom-left-radius: 6px; }
.dm-txt { display: inline; white-space: normal; }
.dm-txt a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.dm-meta { float: right; display: inline-flex; align-items: center; gap: 2px; margin: 6px 0 -2px 10px; font-size: 11px; line-height: 1; opacity: .75; white-space: nowrap; }
.dm-r.mine .dm-meta .dm-tk { color: rgba(255,255,255,.8); }
.dm-r.mine .dm-meta .dm-tk-seen { color: #9fe4ff; }
.dm-r.pending .dm-b { opacity: .78; }
.dm-r.failed .dm-b { background: #fde8ea !important; color: var(--ink) !important; border: 1px solid #f5b5bd; }
.dm-retry { all: unset; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--danger); margin-top: 3px; }
.dm-r.big .dm-b { background: none !important; border: 0 !important; box-shadow: none; padding: 0 2px; font-size: 42px; line-height: 1.1; }
.dm-r.big .dm-meta { float: none; display: flex; justify-content: flex-end; color: var(--muted); opacity: 1; font-size: 11px; margin: 2px 0 0; }
.dm-r.big.mine .dm-meta .dm-tk { color: var(--faint); }
.dm-r.unsent .dm-b { background: transparent !important; color: var(--faint) !important; border: 1px dashed var(--line-2) !important; font-style: italic; font-size: 14px; box-shadow: none; }
.dm-img { all: unset; display: block; cursor: zoom-in; margin: -3px -7px 4px; }
.dm-img img { display: block; max-width: min(280px, 64vw); max-height: 340px; border-radius: 16px; object-fit: cover; background: rgba(0,0,0,.06); }
.dm-r.has-img .dm-b { padding: 4px 4px 6px; }
.dm-r.has-img .dm-txt { padding: 2px 7px 0; }
.dm-r.has-img .dm-meta { margin-right: 6px; }
.dm-q { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 1px; margin: 0 -3px 5px; padding: 5px 9px; border-radius: 12px; border-left: 3px solid; font-size: 13px; max-width: 260px; }
.dm-r.mine .dm-q { background: rgba(255,255,255,.16); border-color: var(--sun); }
.dm-r.theirs .dm-q { background: var(--paper); border-color: var(--violet); }
.dm-q b { font-size: 12.5px; }
.dm-q span { opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-r.flash .dm-b { animation: dmFlash 1.2s; }
@keyframes dmFlash { 0%, 60% { box-shadow: 0 0 0 4px var(--sun); } 100% { box-shadow: none; } }
.dm-r.sel .dm-b { filter: brightness(.94); }
.dm-r.swipe-ok::before { content: '\f3e5'; font-family: 'Font Awesome 6 Free'; font-weight: 900; position: absolute; left: -34px; top: 50%; transform: translateY(-50%); color: var(--violet); }
.dm-reacts { display: flex; gap: 4px; margin-top: -6px; padding: 0 8px; position: relative; z-index: 1; }
.dm-react { all: unset; cursor: pointer; font-size: 13px; line-height: 1; padding: 3px 6px; border-radius: 999px; background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 3px rgba(22,32,44,.1); }
.dm-react.me { border-color: var(--violet); background: var(--violet-50); }
.dm-more { position: absolute; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; border: 0; background: #fff; color: var(--muted);
    box-shadow: 0 1px 4px rgba(22,32,44,.18); cursor: pointer; opacity: 0; transition: opacity .12s; font-size: 12px; }
.dm-r.mine .dm-more { left: -38px; }
.dm-r.theirs .dm-more { right: -38px; }
@media (hover: hover) { .dm-r:hover .dm-more, .dm-more:focus-visible { opacity: 1; } }
@media (hover: none) { .dm-more { display: none; } }
.dm-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; margin-top: 8px; background: #fff; border: 1px solid var(--line); border-radius: 20px; border-bottom-left-radius: 6px; }
.dm-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); animation: dmDot 1.2s infinite; }
.dm-typing span:nth-child(2) { animation-delay: .15s; } .dm-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes dmDot { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.dm-status-line { text-align: right; font-size: 12px; color: var(--muted); padding: 4px 4px 2px; min-height: 18px; }
.dm-status-line i { font-size: 10.5px; }
.dm-status-line .seen { color: var(--violet); font-weight: 600; }
.dm-status-line .seen i { color: #2bb5f0; }
.dm-status-line .ok { color: #0d9a70; font-weight: 600; }
.dm-status-line .bad { color: var(--danger); font-weight: 600; }
.dm-status-line .muted { color: var(--faint); }
.dm-status-line .dot { color: var(--faint); margin: 0 2px; }
.dm-hello { text-align: center; color: var(--muted); padding: 48px 20px; }
.dm-hello span { font-size: 44px; }
.dm-err { text-align: center; color: var(--muted); padding: 40px 20px; }
.dm-skel { display: flex; flex-direction: column; gap: 10px; padding: 20px 4px; }
.dm-skel span { width: 55%; height: 36px; border-radius: 18px; background: linear-gradient(90deg, #e9edf1 0%, #f5f4fa 50%, #e9edf1 100%); background-size: 200% 100%; animation: dmSk 1.2s infinite; }
.dm-skel span.r { align-self: flex-end; } .dm-skel span.w { width: 35%; }
@keyframes dmSk { to { background-position: -200% 0; } }
.dm-jump { position: absolute; left: 50%; transform: translateX(-50%); bottom: 86px; z-index: 3; height: 36px; padding: 0 14px; border-radius: 999px; border: 0;
    background: var(--ink); color: #fff; font-weight: 600; font-size: 13px; box-shadow: var(--pop); cursor: pointer; }

/* message menu */
.dm-menu { position: absolute; z-index: 5; background: #fff; border-radius: 18px; box-shadow: var(--pop); border: 1px solid var(--line); padding: 6px; min-width: 220px; animation: dmPop .14s ease-out; }
@keyframes dmPop { from { transform: scale(.94); opacity: 0; } }
.dm-menu-r { display: flex; gap: 2px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.dm-menu-r button { all: unset; cursor: pointer; font-size: 22px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; transition: transform .1s; }
.dm-menu-r button:hover, .dm-menu-r button:focus-visible { transform: scale(1.2); background: var(--paper); }
.dm-menu-r button.on { background: var(--violet-50); }
.dm-menu-a { display: flex; flex-direction: column; padding-top: 4px; }
.dm-menu-a button { all: unset; cursor: pointer; display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; font-size: 14.5px; color: var(--ink); }
.dm-menu-a button:hover, .dm-menu-a button:focus-visible { background: var(--paper); }
.dm-menu-a button i { width: 16px; color: var(--muted); }
.dm-menu-a .danger, .dm-menu-a .danger i { color: var(--danger); }

/* composer */
.dm-compose { flex-shrink: 0; background: var(--card); border-top: 1px solid var(--line); padding: 8px 8px calc(8px + var(--sab)); }
.dm-row-in { display: flex; align-items: flex-end; gap: 6px; }
.dm-row-in textarea {
    flex: 1; resize: none; min-height: 42px; max-height: 140px; border-radius: 21px; border: 1px solid var(--line); background: var(--paper);
    padding: 10px 14px; font-size: 16px; line-height: 1.35; color: var(--ink); font-family: inherit;
}
.dm-row-in textarea:focus { outline: none; border-color: var(--violet); background: #fff; box-shadow: 0 0 0 3px var(--violet-50); }
.dm-attach { width: 42px; height: 42px; border-radius: 50%; border: 0; background: transparent; color: var(--violet); font-size: 20px; cursor: pointer; flex-shrink: 0; }
.dm-attach:hover { background: var(--violet-50); }
.dm-send { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--violet); color: #fff; font-size: 16px; cursor: pointer; flex-shrink: 0; transition: transform .12s, background .12s; }
.dm-send:disabled { background: #cfd6dd; cursor: default; }
.dm-send:not(:disabled):active { transform: scale(.9); }
.dm-replybar, .dm-imgbar { display: flex; align-items: center; gap: 10px; margin: 0 4px 8px; padding: 8px 10px; border-radius: 14px; background: var(--paper); border-left: 3px solid var(--violet); }
.dm-replybar div { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; }
.dm-replybar b { color: var(--violet); font-size: 12.5px; }
.dm-replybar span { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-replybar button, .dm-imgbar button { width: 28px; height: 28px; border-radius: 50%; border: 0; background: #fff; color: var(--muted); font-size: 18px; cursor: pointer; flex-shrink: 0; }
.dm-imgbar { border-left-color: var(--sun); }
.dm-imgbar img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; }
.dm-imgprog { flex: 1; height: 5px; border-radius: 999px; background: #e6e3ef; overflow: hidden; }
.dm-imgprog span { display: block; height: 100%; width: 0; background: var(--violet); transition: width .2s; }
.dm-imgbar.done .dm-imgprog span { background: var(--live); }
.dm-imgbar.bad .dm-imgprog span { background: var(--danger); width: 100% !important; }
.dm.dm-drop .dm-chat::after { content: 'Drop the photo to send it'; position: absolute; inset: 10px; border: 2px dashed var(--violet); border-radius: 20px; background: rgba(238,243,254,.85);
    display: grid; place-items: center; font-weight: 700; color: var(--violet); z-index: 9; }

/* not connected yet */
.dm-gate { margin: auto; text-align: center; padding: 30px 24px; max-width: 360px; }
.dm-gate img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; margin-bottom: 12px; }
.dm-gate h3 { font-family: var(--f-display); font-size: 21px; margin: 0 0 6px; }
.dm-gate p { color: var(--muted); margin: 0 0 16px; }
.dm-gate .btn { min-height: 44px; padding: 0 18px; }
.dm-empty { display: none; }

@media (min-width: 1024px) {
    .dm { left: var(--sidebar); bottom: 0; }
    .dm[data-mode="chat"] { z-index: 1500; }
    .dm[data-mode] .dm-inbox { display: flex; width: 360px; flex-shrink: 0; border-right: 1px solid var(--line); }
    .dm[data-mode] .dm-chat { display: flex; }
    .dm-ih { padding-top: 24px; } .dm-ih h2 { font-size: 30px; }
    .dm-back { display: none; }
    .dm-empty { margin: auto; text-align: center; color: var(--muted); display: block; max-width: 320px; }
    .dm-empty[hidden] { display: none; }
    .dm-empty i { font-size: 44px; color: var(--violet); opacity: .45; }
    .dm-empty h3 { font-family: var(--f-display); color: var(--ink); font-size: 22px; margin: 12px 0 4px; }
    .dm-ch { padding: 12px 16px; }
    .dm-body { padding: 14px 8% 8px; }
    .dm-r { max-width: 62%; }
    .dm-compose { padding: 10px 8% 14px; }
    .dm-jump { bottom: 96px; }
}
.toast { pointer-events: none; }
.dm [hidden] { display: none !important; }

/* ══ Map v2 ═══════════════════════════════════════════════════════════ */
#map { background: #e8eef3; }
.leaflet-container { font-family: var(--f-ui); }
.map-top-bar { top: calc(64px + var(--sat)) !important; right: 12px !important; left: auto !important; }
.location-btn, .map-fab {
    width: 46px; height: 46px; border-radius: 50%; border: 0; background: #fff; color: var(--violet); font-size: 18px; cursor: pointer;
    box-shadow: 0 6px 18px -6px rgba(22,32,44,.35), 0 0 0 1px rgba(22,32,44,.06); display: grid; place-items: center;
}
.map-fabs { position: absolute; right: 12px; top: calc(118px + var(--sat)); z-index: 800; }
.map-bar {
    position: absolute; z-index: 800; left: 12px; right: 70px; top: calc(12px + var(--sat));
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.map-count {
    height: 36px; padding: 0 14px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; font-size: 13.5px;
    display: inline-flex; align-items: center; box-shadow: 0 6px 18px -8px rgba(22,32,44,.6); white-space: nowrap;
}
.map-filters { display: inline-flex; background: rgba(255,255,255,.95); border-radius: 999px; padding: 3px; box-shadow: 0 6px 18px -8px rgba(22,32,44,.4), 0 0 0 1px rgba(22,32,44,.06); }
.map-f { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.map-f.active { background: var(--violet); color: #fff; }
.map-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); }
.map-f.active .map-live-dot { background: #fff; }
.leaflet-control-zoom { border: 0 !important; box-shadow: 0 6px 18px -6px rgba(22,32,44,.35), 0 0 0 1px rgba(22,32,44,.06) !important; border-radius: 14px !important; overflow: hidden; }
.leaflet-control-zoom a { width: 40px !important; height: 40px !important; line-height: 40px !important; color: var(--ink) !important; border-color: var(--line) !important; }
.leaflet-bottom.leaflet-right { bottom: calc(var(--nav-total) + 6px); transition: bottom .25s; }
#viewMap.sheet-open .leaflet-bottom.leaflet-right { bottom: calc(var(--nav-total) + 214px); }
.leaflet-control-attribution { font-size: 10px; background: rgba(255,255,255,.75) !important; border-radius: 8px 0 0 0; }

/* pins */
.mp-wrap { background: none !important; border: 0 !important; }
.mp { width: 46px; height: 46px; border-radius: 50%; padding: 3px; background: #fff; box-shadow: 0 6px 14px -4px rgba(22,32,44,.45); position: relative; transition: transform .18s; }
.mp img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; background: var(--violet-50); }
.mp.on { background: var(--live); }
.mp.friend:not(.on) { background: var(--violet); }
.mp.me { background: var(--sun); }
.mp.sel { transform: scale(1.28); z-index: 2; box-shadow: 0 0 0 4px rgba(31,79,216,.25), 0 10px 22px -6px rgba(22,32,44,.55); }
.mp:hover { transform: scale(1.12); }
.mp-you { position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px; }
.mc {
    height: 40px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px 0 4px; border-radius: 999px; background: #fff;
    box-shadow: 0 8px 18px -6px rgba(22,32,44,.45), 0 0 0 1px rgba(22,32,44,.06); cursor: pointer; transition: transform .15s; white-space: nowrap;
}
.mc:hover { transform: scale(1.06); }
.mc.on { box-shadow: 0 8px 18px -6px rgba(22,32,44,.45), 0 0 0 2px var(--live); }
.mc-faces { display: inline-flex; }
.mc-faces img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; margin-left: -10px; background: var(--violet-50); }
.mc-faces img:first-child { margin-left: 0; }
.mc b { font-family: var(--f-display); font-size: 15px; color: var(--ink); }
.you-dot { width: 18px; height: 18px; border-radius: 50%; background: rgba(29,127,255,.25); display: grid; place-items: center; animation: youPulse 2.4s infinite; }
.you-dot span { width: 12px; height: 12px; border-radius: 50%; background: #1d7fff; border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
@keyframes youPulse { 0% { box-shadow: 0 0 0 0 rgba(29,127,255,.45); } 70% { box-shadow: 0 0 0 16px rgba(29,127,255,0); } 100% { box-shadow: 0 0 0 0 rgba(29,127,255,0); } }

/* card carousel */
.pf-sheet { display: none !important; }
.map-sheet {
    position: absolute; z-index: 900; left: 0; right: 0; bottom: calc(var(--nav-total) + 10px);
    transform: translateY(120%); transition: transform .28s cubic-bezier(.2,.8,.2,1); pointer-events: none;
}
.map-sheet.open { transform: none; pointer-events: auto; }
.ms-track {
    display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
    padding: 6px max(16px, calc((100% - 420px) / 2)) 4px; -webkit-overflow-scrolling: touch;
}
.ms-track::-webkit-scrollbar { display: none; }
.ms-card {
    position: relative; flex: 0 0 min(86%, 420px); scroll-snap-align: center; scroll-snap-stop: always;
    display: flex; gap: 12px; padding: 12px; background: #fff; border-radius: 22px;
    box-shadow: 0 18px 40px -16px rgba(22,32,44,.45), 0 0 0 1px rgba(22,32,44,.05); min-width: 0;
}
.ms-photo { all: unset; cursor: pointer; position: relative; flex-shrink: 0; width: 92px; height: 116px; border-radius: 16px; overflow: hidden; background: var(--violet-50); }
.ms-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ms-on { position: absolute; top: 7px; right: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--live); border: 2.5px solid #fff; }
.ms-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ms-name { display: flex; align-items: baseline; gap: 6px; padding-right: 24px; }
.ms-name b { font-family: var(--f-display); font-size: 19px; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-name span { color: var(--muted); font-size: 15px; }
.ms-name em { font-style: normal; font-size: 11px; font-weight: 700; background: var(--sun); border-radius: 999px; padding: 1px 7px; }
.ms-place { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-meta { display: flex; gap: 10px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.ms-meta i { font-size: 10px; color: var(--violet); margin-right: 4px; }
.ms-meta .live { color: #0d9a70; font-weight: 600; }
.ms-bio { margin: 2px 0 0; font-size: 13px; line-height: 1.35; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ms-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; }
.ms-btn { flex: 1; height: 38px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); font-weight: 600; font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.ms-btn.primary { background: var(--violet); border-color: var(--violet); color: #fff; }
.ms-btn:disabled { opacity: .6; cursor: default; }
.ms-x { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--paper); color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; }
.ms-dots { display: flex; justify-content: center; gap: 5px; margin-top: 8px; min-height: 8px; }
.ms-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(22,32,44,.25); transition: all .2s; }
.ms-dots span.on { width: 18px; border-radius: 999px; background: var(--violet); }
.ms-dots em { font-style: normal; font-size: 12px; font-weight: 600; background: rgba(255,255,255,.9); padding: 2px 8px; border-radius: 999px; color: var(--ink); }
@media (min-width: 1024px) {
    .map-sheet { bottom: 24px; }
    .map-bar { left: 20px; top: 20px; }
    .map-top-bar { top: 20px !important; right: 20px !important; }
    .map-fabs { right: 20px; top: 74px; }
    #viewMap.sheet-open .leaflet-bottom.leaflet-right { bottom: 210px; }
    .leaflet-bottom.leaflet-right { bottom: 12px; }
}
@media (max-width: 400px) { .map-f { padding: 0 9px; } .map-count { padding: 0 11px; font-size: 12.5px; } }
@media (min-width: 1024px) { #viewMap { left: var(--sidebar); } }
.leaflet-gl-layer { z-index: 1; }
#viewMap.vector-map #map { background: #f2f3f0; }
/* desktop carousel: fixed card width, centred */
@media (min-width: 760px) {
    .ms-card { flex-basis: 400px; }
    .ms-track { padding-left: calc(50% - 200px); padding-right: calc(50% - 200px); }
}

/* waiting contact requests */
.req-nudge { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border-radius: 16px; background: var(--sun-50); border: 1px solid #f3dd9b; font-size: 13.5px; }
.rn-faces { display: inline-flex; flex-shrink: 0; }
.rn-faces img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 2px solid var(--sun-50); margin-left: -9px; }
.rn-faces img:first-child { margin-left: 0; }
.rn-txt { flex: 1; min-width: 0; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rn-txt b { color: var(--ink); }
.rn-go { flex-shrink: 0; height: 32px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--ink); color: #fff; font-weight: 600; font-size: 13px; cursor: pointer; }
.rn-x { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
@media (min-width: 1024px) { .req-nudge { max-width: 560px; } }

html.in-wrapper { --sat: 0px; --sab: 0px; }
html.in-wrapper .nav-item { padding-top: 6px; }
.admin-head-del { margin-left: auto; height: 34px; padding: 0 12px; border-radius: 999px; border: 0; background: #ffe8eb; color: var(--danger); font-weight: 700; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.admin-head-del:hover { background: var(--danger); color: #fff; }
.detail-header { display: flex; align-items: center; }

/* ══ Sub-screens, round 4 ═════════════════════════════════════════════ */
/* sentence case everywhere (no shouty labels) */
.profile-section-title, .profile-stat-label, .req-section-title, .req-wrap .req-section-title, .req-status-pill, .profile-meta-label,
.settings-section-title, .group-card-cat, .group-hero-cat, .gmember-admin, .cg-label { text-transform: none !important; letter-spacing: 0 !important; }

/* group cards (list) */
.groups-grid { gap: 12px !important; }
.group-card { border-radius: 20px !important; overflow: hidden; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line) !important; box-shadow: none !important; }
.group-card-cover { height: 84px !important; position: relative; display: flex; align-items: flex-end; padding: 0 12px; }
.group-card-emoji { width: 52px; height: 52px; border-radius: 16px; background: #fff; display: grid !important; place-items: center; font-size: 28px !important;
    box-shadow: 0 6px 16px -6px rgba(22,32,44,.35); transform: translateY(22px); filter: none !important; }
.group-card-cat { position: absolute; top: 8px; right: 8px; left: auto !important; background: rgba(255,255,255,.92) !important; color: var(--ink) !important;
    font-size: 11px !important; font-weight: 700 !important; padding: 3px 8px !important; border-radius: 999px !important; }
.group-card-body { padding: 30px 12px 4px !important; flex: 1; }
.group-card-name { font-family: var(--f-display); font-size: 16px !important; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.group-card-desc { font-size: 13px !important; color: var(--muted) !important; -webkit-line-clamp: 2; }
.group-card-meta { font-size: 12px !important; color: var(--faint) !important; gap: 10px !important; }
.group-join-btn { margin: 8px 12px 12px !important; height: 36px !important; border-radius: 12px !important; font-weight: 600 !important; font-size: 13.5px !important;
    background: var(--violet) !important; color: #fff !important; border: 0 !important; box-shadow: none !important; }
.group-join-btn.is-member { background: var(--violet-50) !important; color: var(--violet) !important; }

/* group page */
.gd { padding-bottom: 16px; }
.gd-cover { position: relative; height: 150px; overflow: hidden; }
.gd-pattern { position: absolute; right: -20px; top: -24px; font-size: 96px; letter-spacing: 10px; opacity: .16; transform: rotate(-12deg); white-space: nowrap; pointer-events: none; filter: saturate(0); }
.gd-emoji { position: absolute; left: 16px; bottom: -34px; width: 84px; height: 84px; border-radius: 24px; background: #fff; display: grid; place-items: center; font-size: 46px;
    box-shadow: 0 12px 28px -12px rgba(22,32,44,.45); border: 4px solid var(--paper); }
.gd-cover { overflow: visible; }
.gd-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,0) 50%, rgba(0,0,0,.08)); pointer-events: none; }
.gd-body { padding: 44px 16px 4px; }
.gd-cat { display: inline-block; font-size: 12px; font-weight: 700; color: var(--violet); background: var(--violet-50); padding: 3px 10px; border-radius: 999px; margin-bottom: 8px; }
.gd-name { font-family: var(--f-display); font-size: 28px; line-height: 1.08; letter-spacing: -.025em; margin: 0 0 8px; color: var(--ink); }
.gd-desc { font-size: 15px; line-height: 1.5; color: var(--ink-2); margin: 0 0 12px; }
.gd-stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); margin-bottom: 12px; }
.gd-stats b { color: var(--ink); font-weight: 700; }
.gd-who { all: unset; cursor: pointer; display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); margin-bottom: 14px; }
.gd-faces { display: inline-flex; }
.gd-face { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 2px solid var(--paper); margin-left: -8px; }
.gd-face:first-child { margin-left: 0; }
.gd-actions { display: flex; gap: 8px; }
.gd-actions .group-membership-btn { flex: 1; min-height: 46px; border-radius: 14px; font-size: 15px; }
.btn-joined, .gd-actions .btn-secondary { background: var(--violet-50) !important; color: var(--violet) !important; border: 0 !important; }
.gd-share { width: 46px; min-height: 46px; padding: 0; border-radius: 14px; background: var(--card); border: 1px solid var(--line-2); color: var(--ink); cursor: pointer; }
.gd-tabs { display: flex; gap: 4px; margin: 18px 16px 12px; background: #e9edf1; border-radius: 14px; padding: 4px; position: sticky; top: 0; z-index: 2; }
.gd-tab { flex: 1; height: 38px; border: 0; border-radius: 11px; background: transparent; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.gd-tab small { font-weight: 600; color: var(--faint); margin-left: 3px; }
.gd-tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(22,32,44,.14); }
.group-tab-content { padding: 0 12px; }
.group-composer { display: flex; gap: 8px; align-items: flex-end; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 8px; margin-bottom: 12px; }
.group-composer textarea { flex: 1; border: 0 !important; background: transparent !important; resize: none; font-size: 15.5px; padding: 8px; min-height: 40px; box-shadow: none !important; outline: none; font-family: inherit; color: var(--ink); }
.group-post-btn { width: 42px; height: 42px; min-height: 42px !important; padding: 0 !important; border-radius: 50% !important; flex-shrink: 0; }
.group-join-hint { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--violet-50); color: var(--violet); border-radius: 14px; padding: 12px; font-weight: 600; font-size: 14px; margin-bottom: 12px; cursor: pointer; border: 0; }
.group-feed { display: flex; flex-direction: column; gap: 10px; }
.gpost { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; display: block !important; }
.gpost-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.gpost-avatar { width: 40px !important; height: 40px !important; border-radius: 50%; object-fit: cover; cursor: pointer; flex-shrink: 0; }
.gpost-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gpost-name { all: unset; cursor: pointer; font-weight: 700; font-size: 15px; color: var(--ink); }
.gpost-time { font-size: 12.5px; color: var(--faint); }
.gpost-del { border: 0; background: transparent; color: var(--faint); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; }
.gpost-del:hover { background: #ffe8eb; color: var(--danger); }
.gpost-text { font-size: 15.5px; line-height: 1.5; color: var(--ink); white-space: pre-wrap; word-wrap: break-word; }
.gpost-actions { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.gpost-reply-toggle { border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 13.5px; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.gpost-reply-toggle:hover { background: var(--paper); color: var(--violet); }
.greply { display: flex; gap: 8px; padding: 8px 0; }
.greply-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.greply-body { background: var(--paper); border-radius: 14px; padding: 7px 11px; font-size: 14px; flex: 1; min-width: 0; }
.greply-name { font-weight: 700; }
.greply-time { color: var(--faint); font-size: 12px; }
.greply-compose { display: flex; gap: 6px; margin-top: 6px; }
.greply-compose input { flex: 1; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); padding: 0 14px; font-size: 16px; }
.greply-compose button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--violet); color: #fff; cursor: pointer; }
.group-members { display: flex; flex-direction: column; gap: 6px; }
.gmember { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); cursor: pointer; }
.gmember:hover { border-color: var(--line-2); }
.gmember-avatar { width: 46px !important; height: 46px !important; border-radius: 50%; object-fit: cover; }
.gmember-name { font-weight: 700; font-size: 15px; color: var(--ink); }
.gmember-loc { font-size: 13px; color: var(--muted); }
.gmember-loc i { color: var(--violet); font-size: 11px; }
.gmember-admin { background: var(--sun) !important; color: var(--ink) !important; font-size: 11px !important; font-weight: 700 !important; padding: 2px 8px !important; border-radius: 999px !important; margin-left: 4px; }
.groups-empty h3 { font-family: var(--f-display); }

/* replies */
.rp { padding: 12px 12px 8px; }
.rp-original { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; margin-bottom: 12px; position: relative; }
.rp-original img { max-width: 100%; }
.rp-count { font-size: 13px; font-weight: 700; color: var(--muted); margin: 4px 4px 8px; }
.rp-row { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; position: relative; }
.rp-av { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; cursor: pointer; flex-shrink: 0; }
.rp-bubble { background: var(--card); border: 1px solid var(--line); border-radius: 18px; border-top-left-radius: 6px; padding: 8px 12px; min-width: 0; max-width: calc(100% - 80px); }
.rp-row.mine .rp-bubble { background: var(--violet-50); border-color: var(--violet-100); }
.rp-row.sending .rp-bubble { opacity: .65; }
.rp-row.failed .rp-bubble { border-color: #f5b5bd; background: #fde8ea; }
.rp-row.failed .rp-time { color: var(--danger); font-weight: 600; }
.rp-head { display: flex; gap: 8px; align-items: baseline; }
.rp-name { all: unset; cursor: pointer; font-weight: 700; font-size: 14px; color: var(--ink); }
.rp-time { font-size: 12px; color: var(--faint); }
.rp-text { font-size: 15px; line-height: 1.45; color: var(--ink); word-wrap: break-word; white-space: pre-wrap; }
.rp-menu { border: 0; background: transparent; color: var(--faint); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; flex-shrink: 0; }
.rp-empty { text-align: center; color: var(--muted); padding: 28px 16px; }
.rp-empty i { font-size: 28px; color: var(--violet); opacity: .45; }
.rp-compose { position: sticky; bottom: 0; display: flex; gap: 8px; align-items: center; padding: 10px 12px calc(10px + var(--sab)); background: var(--card); border-top: 1px solid var(--line); }
.rp-me { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.rp-compose input { flex: 1; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); padding: 0 16px; font-size: 16px; color: var(--ink); }
.rp-compose input:focus { outline: none; border-color: var(--violet); background: #fff; box-shadow: 0 0 0 3px var(--violet-50); }
.rp-send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--violet); color: #fff; cursor: pointer; flex-shrink: 0; }
#detailContent:has(.rp) { display: flex; flex-direction: column; }
#detailContent:has(.rp) .rp { flex: 1; }

/* alerts */
.notif-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--card); }
.notif-row:hover { background: var(--paper); }
.notif-row.notif-unread { background: #f7f4ff; }
.notif-av { position: relative; width: 46px; height: 46px; flex-shrink: 0; }
.notif-av img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.notif-av-ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--violet-50); color: var(--violet); font-size: 18px; }
.notif-badge-ic { position: absolute; right: -3px; bottom: -3px; width: 22px; height: 22px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-size: 10px; border: 2.5px solid #fff; }
.notif-body { flex: 1; min-width: 0; }
.notif-msg { font-size: 14.5px; line-height: 1.4; color: var(--ink-2); }
.notif-msg b { color: var(--ink); font-weight: 700; }
.notif-when { font-size: 12.5px; color: var(--faint); margin-top: 2px; }
.notif-unread .notif-when { color: var(--violet); font-weight: 600; }
.notif-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--violet); flex-shrink: 0; }
.notif-tab { font-weight: 600 !important; }

/* bottom sheets / modals: report, contact request, delete account, create group, invite, legal */
.report-modal-card, .legal-modal-card, .cg-sheet, .invite-sheet, .modal-card { border-radius: 26px 26px 0 0 !important; box-shadow: 0 -20px 50px -20px rgba(22,32,44,.4) !important; }
@media (min-width: 768px) { .report-modal-card, .legal-modal-card { border-radius: 24px !important; } }
.report-modal-head h3, .report-modal-head h2, .legal-modal-head h2, .report-modal-head { font-family: var(--f-display); letter-spacing: -.01em; }
.report-modal-head { border-bottom: 1px solid var(--line) !important; }
.report-modal-close, .legal-modal-close { width: 34px !important; height: 34px !important; border-radius: 50% !important; background: var(--paper) !important; border: 0 !important; }
.report-modal-body textarea, .report-modal-body input[type=password], .report-modal-body input[type=text], .cg-input {
    border-radius: 12px !important; border: 1px solid var(--line-2) !important; font-size: 16px !important; padding: 10px 12px !important; background: #fff !important;
}
.report-modal-body textarea:focus, .report-modal-body input:focus, .cg-input:focus { outline: none; border-color: var(--violet) !important; box-shadow: 0 0 0 3px var(--violet-50) !important; }
.report-reason { border-radius: 12px; padding: 10px 8px !important; }
.report-reason:hover { background: var(--paper); }
.report-reason input { accent-color: var(--violet); width: 18px; height: 18px; }
.report-modal-foot .btn, .legal-modal-foot .btn { min-height: 46px; border-radius: 14px; }
.cg-label { font-size: 13px !important; font-weight: 600 !important; color: var(--ink-2) !important; }
.cg-emoji { border-radius: 12px !important; }
.cg-emoji.active, .cg-emoji.selected { box-shadow: 0 0 0 2px var(--violet) !important; background: var(--violet-50) !important; }
.invite-opt-icon { box-shadow: 0 6px 14px -8px rgba(22,32,44,.5); }
.invite-link-row { border-radius: 14px !important; border: 1px solid var(--line) !important; background: var(--paper) !important; }
.invite-copy-btn { border-radius: 10px !important; background: var(--violet) !important; }

/* requests screen */
.req-card { border-radius: 18px !important; border: 1px solid var(--line) !important; box-shadow: none !important; }
.req-section-title { font-size: 14px !important; font-weight: 700 !important; color: var(--ink) !important; }
.req-actions .btn { border-radius: 12px !important; min-height: 42px; }

/* edit profile form */
#profileContent input[type=text], #profileContent input[type=date], #profileContent select, #profileContent textarea {
    border-radius: 12px; border: 1px solid var(--line-2); font-size: 16px; background: #fff;
}
#profileContent input:focus, #profileContent select:focus, #profileContent textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-50); }
/* admin quick delete */
.adm-trash { width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(229,72,77,.95); color: #fff; font-size: 13px; cursor: pointer;
    display: grid; place-items: center; box-shadow: 0 4px 10px -4px rgba(0,0,0,.45); flex-shrink: 0; }
.adm-trash:hover { background: #c9313a; transform: scale(1.06); }
.mt-photo .adm-trash { position: absolute; z-index: 3; right: 8px; bottom: 52px; }
.ms-actions .adm-trash { width: 38px; height: 38px; border-radius: 12px; flex: 0 0 38px; }
.gmember .adm-trash { margin-left: auto; }
.admin-sheet .ps-card p { margin-bottom: 8px; }

/* remind (re-send a pending request) */
.btn-remind { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 16px; border-radius: 12px;
    background: var(--sun) !important; color: var(--ink) !important; border: 0 !important; font-weight: 700; font-size: 14px; cursor: pointer; }
.btn-remind:hover { filter: brightness(.96); }
.btn-remind.done, .btn-remind:disabled { background: var(--paper) !important; color: var(--muted) !important; cursor: default; }
.ct-pending-row { display: flex; gap: 8px; align-items: stretch; }
.ct-pending-row .ct-pill { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; }
.req-card-out .req-actions { display: flex; }
.req-card-out .btn-remind { flex: 1; }
.ms-btn.btn-remind { min-height: 38px; height: 38px; border-radius: 12px; }
/* an open conversation owns the whole screen on phones/tablets: no footer bar over the message box */
@media (max-width: 1023px) {
    body.dm-chat-open .bottom-nav { display: none !important; }
    body.dm-chat-open #rateAppBanner { display: none !important; }
}

/* Map cards: the whole card opens the profile */
.ms-card { cursor: pointer; }
.ms-card .ms-btn, .ms-card .ms-x { cursor: pointer; }


/* ===== Distance sliders (Activity + People) ===== */
.feed-range { padding: 2px 2px 0; }
.feed-range-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.feed-range-label { font-size: 13px; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.feed-range-label i { color: var(--violet); }
.feed-range output {
    font-size: 13px; font-weight: 700; color: var(--violet);
    background: var(--violet-50); border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
.feed-range output.is-world { color: var(--ink-2); background: var(--paper); }
.feed-range input[type="range"] {
    --pct: 100%;
    -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: 0;
    background: transparent; cursor: pointer; touch-action: pan-y;
}
.feed-range input[type="range"]:focus { outline: none; }
.feed-range input[type="range"]::-webkit-slider-runnable-track {
    height: 6px; border-radius: 999px;
    background: linear-gradient(to right, var(--violet) 0, var(--violet) var(--pct), var(--line) var(--pct), var(--line) 100%);
}
.feed-range input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--line); }
.feed-range input[type="range"]::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--violet); }
.feed-range input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 22px; height: 22px; margin-top: -8px;
    border-radius: 50%; background: #fff; border: 2px solid var(--violet);
    box-shadow: 0 1px 3px rgba(22,32,44,.25);
}
.feed-range input[type="range"]::-moz-range-thumb {
    width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--violet);
    box-shadow: 0 1px 3px rgba(22,32,44,.25);
}
.feed-range input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--violet-50); }
.feed-range input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--violet-50); }
.feed-range-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-top: 1px; }
.feed-range-note { font-size: 12px; color: var(--muted); margin-top: 4px; }

#viewNearby .feed-range { margin-top: 2px; }
