:root {
    --brand: #4A7C9D;
    --brand-dark: #3d6a86;
    --brand-soft: #e8f0f5;
    --gold: #c4a052;
    --type-people: #4A7C9D;
    --type-business: #2a9d8f;
    --type-job: #c4a052;
    --type-group: #6b5b95;
    --type-post: #4A7C9D;
    --type-market: #c45c26;
    --ink: #333;
    --muted: #6b7280;
    --line: #e4e4e4;
    --card: #ececec;
    --bg: #fff;
    --header: #4A7C9D;
    --footer: #3a3a3a;
    --radius: 12px;
    --radius-lg: 16px;
    --surface: #f4f7f9;
    --surface-elevated: #ffffff;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --form-bg: #ffffff;
    --form-ink: #333333;
    --toast-bg: #ffffff;
}

/* Dark mode — anchored to footer charcoal (#3a3a3a) */
html[data-theme="dark"] {
    color-scheme: dark;
    --brand: #6a9bb8;
    --brand-dark: #8bb4cc;
    --brand-soft: #2f3f4a;
    --ink: #ececec;
    --muted: #a8a8a8;
    --line: #4a4a4a;
    --card: #333333;
    --bg: #2c2c2c;
    --header: #3a3a3a;
    --footer: #2a2a2a;
    --surface: #333333;
    --surface-elevated: #3a3a3a;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
    --form-bg: #323232;
    --form-ink: #ececec;
    --toast-bg: #3a3a3a;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    color: var(--ink);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

.toast-host {
    position: fixed;
    right: max(0.75rem, env(safe-area-inset-right));
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: min(22rem, calc(100vw - 1.5rem));
    pointer-events: none;
}
.app-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.8rem 0.85rem;
    border-radius: 12px;
    background: var(--toast-bg);
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
    font-size: 0.92rem;
    line-height: 1.35;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.app-toast.is-in {
    opacity: 1;
    transform: translateY(0);
}
.app-toast.is-leaving {
    opacity: 0;
    transform: translateY(8px);
}
.app-toast-success {
    border-color: #198754;
}
.app-toast-error {
    border-color: #dc3545;
}
.app-toast-msg {
    flex: 1;
    min-width: 0;
}
.app-toast-close {
    border: 0;
    background: transparent;
    color: var(--muted);
    opacity: 0.9;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0;
    margin-top: -0.1rem;
}
@media (max-width: 768px) {
    .toast-host {
        right: max(0.65rem, env(safe-area-inset-right));
        left: max(0.65rem, env(safe-area-inset-left));
        width: auto;
    }
    body.has-tabbar .toast-host {
        /* Sit above in-flow tabbar (~3.6rem + safe area) */
        bottom: calc(4.25rem + env(safe-area-inset-bottom));
    }
}
body.page-home,
body.page-discover {
    background: var(--surface);
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

.app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--header);
}
.app-header .inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0.4rem 1.15rem;
    gap: 1rem;
}
.header-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: 1;
    justify-content: center;
}
.header-nav-link {
    color: rgba(255,255,255,0.82);
    font-size: 0.86rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    text-decoration: none;
}
.header-nav-link:hover { color: #fff; background: rgba(255,255,255,0.12); }
.header-nav-link.active { color: #fff; background: rgba(255,255,255,0.18); }
.header-nav-link { position: relative; }
.nav-count {
    display: inline-flex;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    margin-left: 0.25rem;
    border-radius: 99px;
    background: #e55353;
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    justify-content: center;
    vertical-align: middle;
}

.privacy-option {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 0.5rem;
    cursor: pointer;
}
.privacy-option:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand-soft);
}
.privacy-option input { margin-top: 0.2rem; }
.add-to-group { text-align: left; }
.logo-mark {
    display: flex;
    align-items: center;
    line-height: 0;
}
.logo-mark img.header-favicon {
    height: 30px;
    width: auto;
    display: block;
    object-fit: contain;
}
.header-actions { display: flex; align-items: center; gap: 0.55rem; }

/* Bell notification icon in header */
.header-bell {
    position: relative;
    padding: 0.3rem 0.45rem;
    border-radius: 999px;
    color: rgba(255,255,255,0.82);
    text-decoration: none;
    transition: background 0.15s;
}
.header-bell:hover,
.header-bell-active { color: #fff; background: rgba(255,255,255,0.18); }
.header-logout { margin: 0; }
.header-logout-btn {
    color: rgba(255,255,255,0.82);
    padding: 0.3rem 0.45rem;
    border-radius: 999px;
    border: 0;
    background: transparent;
    transition: background 0.15s, color 0.15s;
}
.header-logout-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.18);
    opacity: 1;
}
.header-bell-badge {
    position: absolute;
    top: -1px;
    right: -3px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 99px;
    background: #e55353;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    pointer-events: none;
}

/* Round icon button (+ in groups, compose in chat, etc.) */
.btn-icon-round {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: 1rem;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.15s;
}
.btn-icon-round:hover { background: var(--brand-dark); color: #fff; }
/* no override — btn-icon-round always uses brand colour */

/* Admin layout: sidebar + content */
.admin-layout {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 1.5rem;
    align-items: start;
}
.admin-sidenav {
    background: var(--surface-elevated);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    position: sticky;
    top: 5rem;
}
.admin-sidenav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    position: relative;
    min-height: 44px;
    line-height: 1.2;
}
.admin-sidenav-link:last-child { border-bottom: 0; }
.admin-sidenav-link:hover { background: var(--surface); color: var(--brand); }
.admin-sidenav-link.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.admin-sidenav-link i { width: 16px; text-align: center; opacity: 0.7; }
.admin-sidenav-link.active i { opacity: 1; }
.admin-nav-badge {
    position: absolute;
    top: 6px;
    right: 8px;
    background: #e55353;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 99px;
    padding: 1px 6px;
    line-height: 1.35;
}
.admin-content { min-width: 0; }
.admin-action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    align-items: end;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}
.admin-approve-form,
.admin-reject-form {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.admin-action-row .btn {
    min-height: 38px;
    width: 100%;
}
.admin-avatar-zoom {
    position: relative;
    display: inline-block;
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 50%;
    cursor: zoom-in;
}
.admin-avatar-zoom img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.admin-avatar-zoom-sm img {
    width: 72px;
    height: 72px;
}
.admin-avatar-zoom-hint {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}
.admin-avatar-compare {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.admin-avatar-modal-img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
    object-fit: contain;
    background: #0f172a;
}
@media (max-width: 576px) {
    .admin-action-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
}
.btn[aria-busy="true"],
button[disabled].btn-brand {
    opacity: 0.85;
    pointer-events: none;
}
.icon-btn {
    width: auto;
    height: auto;
    padding: 0.2rem;
    border: 0;
    background: transparent;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    line-height: 0;
}
.icon-btn:hover { color: #fff; opacity: 0.85; }
.icon-btn i { font-size: 1.15rem; }
.header-avatar-btn { gap: 0.2rem; }
.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    display: block;
}
.header-caret {
    font-size: 0.65rem;
    color: #fff;
    line-height: 1;
}
.badge-dot {
    position: absolute;
    top: -2px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 99px;
    background: #e55353;
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
}

.page {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 1.25rem 1rem 4rem;
    flex: 1;
}
body.page-search .page,
body.page-discover .page {
    max-width: 720px;
}
body.page-profile .page { max-width: 980px; }
body.page-legal .page { max-width: 820px; }

.app-footer {
    background: var(--footer);
    color: #ddd;
    padding: 0.55rem 1.25rem;
    font-size: 0.82rem;
    margin-top: auto;
}
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.25rem;
    flex-wrap: wrap;
}
.footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem 1.1rem;
}
.footer-links a {
    color: #eee;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}
.footer-links a:hover { color: #fff; }
.footer-links i { width: auto; font-size: 0.85rem; }
.app-footer .copy { opacity: 0.75; font-size: 0.75rem; }

.btn-brand {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    border-radius: 999px;
    padding: 0.45rem 1.25rem;
    font-weight: 600;
}
.btn-brand:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

.card-soft {
    background: var(--surface-elevated);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--radius-lg);
    padding: 1.15rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

/* ——— Page hero ——— */
.page-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.35rem;
}
.page-hero > div { flex: 1; min-width: 0; }
.page-hero-compact { margin-bottom: 1rem; }
.page-hero-logo {
    height: 44px;
    width: auto;
    display: block;
    flex: 0 0 auto;
}
.page-hero-title {
    font-size: 1.45rem;
    font-weight: 700;
    margin: 0 0 0.15rem;
    letter-spacing: -0.02em;
}
.page-hero-sub {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

/* ——— Home feed ——— */
.feed-page {
    padding-bottom: 0.5rem;
    max-width: 100%;
    min-width: 0;
}
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.65rem;
    margin-bottom: 1.5rem;
}
.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.85rem 0.35rem;
    background: var(--surface-elevated);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--radius-lg);
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s, box-shadow 0.15s;
}
.quick-action:hover {
    color: var(--brand-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.quick-action-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}
.section-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 0.85rem;
}
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0 0.85rem;
}
.sort-bar {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
}
.sort-select {
    /* Native fallback before JS enhances; visually replaced by .sort-menu */
    width: auto;
    max-width: 100%;
    min-width: 0;
    font-size: 0.82rem;
    border-radius: 999px;
    padding: 0.25rem 1.75rem 0.25rem 0.75rem;
}
.sort-menu {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
    max-width: 100%;
    flex-shrink: 0;
}
.sort-menu > select.sort-select {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.sort-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2rem;
    padding: 0.28rem 0.7rem 0.28rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-elevated);
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.sort-menu-trigger:hover {
    border-color: var(--brand);
}
.sort-menu-trigger:focus {
    outline: none;
}
.sort-menu-trigger:focus-visible {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 28%, transparent);
}
.sort-menu.is-open .sort-menu-trigger {
    border-color: var(--brand);
}
.sort-menu-trigger i {
    font-size: 0.65rem;
    color: var(--muted);
    transition: transform 0.15s;
}
.sort-menu.is-open .sort-menu-trigger i {
    transform: rotate(180deg);
}
.sort-menu-list {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    left: auto;
    z-index: 40;
    min-width: 100%;
    width: max-content;
    max-width: min(16rem, calc(100vw - 2rem));
    margin: 0;
    padding: 0.3rem;
    list-style: none;
    background: var(--surface-elevated);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}
.sort-menu-list[hidden] { display: none; }
.sort-menu-option {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--ink);
    text-align: left;
    font-size: 0.84rem;
    font-weight: 500;
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
}
.sort-menu-option:hover,
.sort-menu-option:focus {
    background: var(--brand-soft);
    color: var(--brand-dark);
    outline: none;
}
.sort-menu-option.is-active {
    background: var(--brand);
    color: #fff;
    font-weight: 600;
}
.sort-menu-option.is-active:hover,
.sort-menu-option.is-active:focus {
    background: var(--brand-dark);
    color: #fff;
}
.search-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    min-height: 1.6rem;
    margin: 0.15rem 0 0.85rem;
    max-width: 100%;
    min-width: 0;
}
.search-toolbar #searchMeta {
    margin-right: auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.feed-stream { display: flex; flex-direction: column; gap: 0.85rem; }
.feed-stream > .section-head { margin-bottom: 0; }
.feed-card {
    background: var(--surface-elevated);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--brand);
}
.feed-card.type-people { border-left-color: var(--type-people); }
.feed-card.type-businesses { border-left-color: var(--type-business); }
.feed-card.type-jobs { border-left-color: var(--type-job); }
.feed-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem 0;
    font-size: 0.75rem;
}
.feed-kind {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.feed-card.type-people .feed-kind { color: var(--type-people); }
.feed-card.type-businesses .feed-kind { color: var(--type-business); }
.feed-card.type-jobs .feed-kind { color: var(--type-job); }
.feed-time { font-size: 0.75rem; }
.feed-card-body {
    display: flex;
    gap: 0.85rem;
    padding: 0.65rem 1rem 0.85rem;
    color: inherit;
    text-decoration: none;
}
.feed-card-body:hover { color: inherit; }
.feed-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--brand-soft);
    flex-shrink: 0;
}
.feed-card.type-people .feed-avatar { border-radius: 50%; }
.feed-copy { min-width: 0; flex: 1; }
.feed-headline {
    font-size: 0.98rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    line-height: 1.35;
    color: var(--brand);
}
.feed-headline a { color: var(--brand); }
.feed-headline a:hover { color: var(--brand-dark); }
.feed-body {
    margin: 0 0 0.35rem;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.feed-loc {
    margin: 0;
    font-size: 0.8rem;
    color: var(--muted);
}
.feed-loc i { margin-right: 0.2rem; }
.feed-card-footer {
    padding: 0 1rem 0.85rem;
}
.feed-cta {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--brand);
    text-decoration: none;
}
.feed-cta i { font-size: 0.72rem; margin-left: 0.15rem; }
.feed-cta:hover { color: var(--brand-dark); }
.feed-pagination { margin-top: 1.25rem; }
.feed-items {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.feed-load-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.1rem 0 0.35rem;
    min-height: 2.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}
.feed-load-more.is-loading { opacity: 1; }
.feed-load-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--line);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: feed-spin 0.7s linear infinite;
}
@keyframes feed-spin {
    to { transform: rotate(360deg); }
}
.feed-card.type-post { border-left-color: var(--type-post); }
.feed-card.type-groups { border-left-color: var(--type-group); }
.feed-card.type-market { border-left-color: var(--type-market); }
.feed-card.type-post .feed-kind { color: var(--type-post); }
.feed-card.type-groups .feed-kind { color: var(--type-group); }
.feed-card.type-market .feed-kind { color: var(--type-market); }
.feed-copy-link { color: inherit; text-decoration: none; display: block; }
.feed-copy-link:hover { color: inherit; }
.feed-copy-link .feed-headline { color: var(--brand); }
.feed-body-post {
    display: block;
    -webkit-line-clamp: unset;
    white-space: pre-wrap;
    overflow: visible;
}
.feed-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.feed-card-meta {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.feed-more-wrap { flex-shrink: 0; }
.feed-more {
    width: 28px;
    height: 28px;
    border: 0;
    background: none;
    color: var(--muted);
    opacity: 0.45;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 0;
}
.feed-more:hover,
.feed-more[aria-expanded="true"] {
    opacity: 1;
    color: var(--text, #0f172a);
    background: rgba(15, 23, 42, 0.06);
}
.feed-more i { font-size: 0.95rem; }
.dropdown-menu .feed-delete,
.dropdown-menu .moderate-form {
    margin: 0;
    display: block;
}
.dropdown-menu .dropdown-item {
    width: 100%;
    text-align: left;
    font-size: 0.9rem;
    padding: 0.48rem 0.85rem;
}
.dropdown-menu .feed-delete button,
.dropdown-menu .moderate-form button {
    border: 0;
    background: transparent;
    width: 100%;
}
.feed-delete button:hover { color: #c0392b; }

.comment-block {
    padding: 0 1rem 0.9rem;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    margin-top: 0.15rem;
}
.comment-row {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    padding: 0.55rem 0 0.15rem;
}
.comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--brand-soft);
    flex-shrink: 0;
}
.comment-copy { min-width: 0; flex: 1; }
.comment-meta {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    gap: 0.45rem;
    align-items: baseline;
}
.comment-meta a { color: var(--brand); }
.comment-text {
    margin: 0.1rem 0 0;
    font-size: 0.88rem;
    color: #444;
    line-height: 1.4;
}
.comment-delete button {
    border: 0;
    background: none;
    color: #bbb;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 0.15rem;
}
.comment-delete button:hover { color: #c0392b; }
.comment-form {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.55rem;
    align-items: center;
}
.comment-form .form-control { flex: 1; }
.comment-compose { margin-top: 0.35rem; }

.composer-card {
    background: var(--surface-elevated);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
    margin-bottom: 1.35rem;
}
.composer-modes {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}
.composer-mode {
    margin: 0;
    cursor: pointer;
}
.composer-mode input { position: absolute; opacity: 0; pointer-events: none; }
.composer-mode span {
    display: inline-block;
    padding: 0.28rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
    background: var(--surface);
}
.composer-mode input:checked + span {
    background: var(--brand-soft);
    color: var(--brand-dark);
}
/* Quick links inside composer (Add business / Post a job) */
.composer-quick-links {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0;
    flex-wrap: wrap;
}
.composer-quick-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--muted);
    background: transparent;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.composer-quick-link:hover {
    border-color: var(--line);
    color: var(--brand);
    background: rgba(74, 124, 157, 0.08);
}
.composer-quick-link i { font-size: 0.74rem; color: currentColor; }

.composer-links-card {
    background: var(--surface-elevated);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--radius);
    padding: 0.55rem 0.65rem;
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* Listing action buttons on My Listings page */
.listing-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
}
.listing-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.8rem 0.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface-elevated);
    color: var(--ink);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}
.listing-action-btn:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.listing-action-btn i { font-size: 1.1rem; color: var(--brand); }
.result-item-sold { opacity: 0.65; }

.composer-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}
.composer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--brand-soft);
}
.composer-listing {
    margin: 0.75rem 0 0;
    padding-left: 3.1rem;
}
.composer-card-collapsible .composer-input-collapsed {
    /* Tall enough for a wrapping placeholder beside the avatar on mobile */
    min-height: 4.25rem;
    height: 4.25rem;
    overflow: hidden;
    resize: none;
    line-height: 1.4;
    transition: height 0.2s ease, min-height 0.2s ease;
}
.composer-card-collapsible.composer-expanded .composer-input-collapsed,
.composer-card-collapsible .composer-input-collapsed:focus {
    min-height: 7.5rem;
    height: 7.5rem;
}
.composer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.65rem;
    padding-left: 3.1rem;
    flex-wrap: wrap;
}
.composer-tools {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}
.photo-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    color: var(--brand);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.photo-add-btn:hover { color: var(--brand-dark); }
.photo-add-btn-icon {
    width: 34px;
    height: 34px;
    justify-content: center;
    border-radius: 8px;
    background: var(--brand-soft);
    flex-shrink: 0;
}
.comment-form .photo-add-btn-icon { width: 32px; height: 32px; }
.photo-preview {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 0.45rem;
    margin-top: 0.7rem;
    padding-left: 3.1rem;
}
.comment-compose .photo-preview { padding-left: 0; }
.photo-picker.has-photos .photo-preview { display: grid; }
.photo-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: #eef2f5;
}
.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.photo-preview-item button {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border: 0;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    line-height: 1;
    font-size: 0.85rem;
    padding: 0;
}
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
    padding: 0 1rem 0.85rem;
}
.photo-grid-one { grid-template-columns: 1fr; }
.photo-grid-sm {
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    padding: 0.4rem 0 0;
    max-width: 280px;
}
.photo-grid-item {
    border: 0;
    padding: 0;
    background: #eef2f5;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 1;
    cursor: zoom-in;
}
.photo-grid-one .photo-grid-item { aspect-ratio: 4 / 3; max-height: 420px; }
.photo-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.photo-carousel {
    position: relative;
    margin: 0 0 0.85rem;
}
.photo-carousel-viewport {
    overflow: hidden;
    background: #eef2f5;
}
.photo-carousel-track {
    display: flex;
    transition: transform 0.28s ease;
    will-change: transform;
}
.photo-carousel-slide {
    flex: 0 0 100%;
    border: 0;
    padding: 0;
    background: #eef2f5;
    cursor: zoom-in;
    max-height: 420px;
}
.photo-carousel-slide img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}
.photo-carousel.is-single .photo-carousel-slide img { height: 320px; }
.photo-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}
.photo-carousel-nav.prev { left: 0.65rem; }
.photo-carousel-nav.next { right: 0.65rem; }
.photo-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 0 0;
}
.photo-carousel-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #c5ced6;
}
.photo-carousel-dots span.active { background: var(--brand); }
.moderate-form { display: inline; margin: 0; }
.suspended-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #9a3412;
    background: #ffedd5;
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
}
.photo-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.listing-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.65rem;
    margin: 0 0 0.35rem;
}
.listing-price {
    font-weight: 800;
    color: var(--type-market);
    font-size: 1.05rem;
}
/* Contact form honeypot — off-screen for bots, invisible to people */
.hp-field {
    position: absolute !important;
    left: -10000px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.listing-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.55rem 0 0;
}
.photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1080;
    background: rgba(15, 23, 42, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    cursor: zoom-out;
}
.photo-lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}
.photo-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    color: var(--ink);
}
.photo-lightbox-nav.prev { left: 1rem; }
.photo-lightbox-nav.next { right: 1rem; }

/* .mobile-bell removed — replaced by mobile-topbar-bell */

.min-w-0 { min-width: 0; }
.notice-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 0.5rem;
}
.notice-list { display: flex; flex-direction: column; gap: 0.5rem; }
.notice-row-approval { color: inherit; }
.notice-row-approval:hover { color: inherit; }
.notice-arrow { color: var(--muted); font-size: 0.75rem; flex-shrink: 0; }
.notice-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface-elevated);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--radius-lg);
    padding: 0.75rem 0.85rem;
    color: inherit;
}
.notice-row.unread { background: var(--brand-soft); }
.notice-row-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}
.notice-row-inner:hover { color: inherit; }
.notice-row:hover { box-shadow: var(--shadow-sm); }
.notice-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.notice-title { margin: 0; font-weight: 600; font-size: 0.9rem; line-height: 1.3; }
.notice-read-form { flex-shrink: 0; }
.notice-read-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.75rem;
    transition: background 0.15s, color 0.15s;
}
.notice-read-btn:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

/* New message picker overflow fixes */
.message-picker-results .result-item h3,
.message-picker-results .result-item p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.network-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--surface-elevated);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    margin-bottom: 0.55rem;
}
.network-person {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: inherit;
    min-width: 0;
}
.network-person:hover { color: inherit; }
.network-person img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}
.network-person-block {
    background: var(--surface-elevated);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--radius-lg);
    padding: 0.7rem 1rem;
    margin-bottom: 0.45rem;
}
.network-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.group-hero {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1rem;
}
.group-mark {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.group-mark.lg { width: 64px; height: 64px; font-size: 1.35rem; }
.group-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--brand-soft);
    flex-shrink: 0;
}
.group-avatar.lg { width: 64px; height: 64px; }
.admin-media-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.admin-media-thumbs img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}
.group-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}
.group-tile {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    background: var(--surface-elevated);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1rem;
    color: inherit;
}
.group-tile:hover { color: inherit; box-shadow: var(--shadow-sm); }

.empty-state {
    text-align: center;
    padding: 2.5rem 1.25rem;
    background: var(--surface-elevated);
    border-radius: var(--radius-lg);
    border: 1px dashed rgba(74, 124, 157, 0.25);
}
.empty-state i {
    font-size: 2rem;
    color: var(--brand);
    margin-bottom: 0.75rem;
}
.empty-state h3 {
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
}
.empty-inline { padding: 2rem 0; }

/* ——— Discover ——— */
.discover-page {
    padding-bottom: 0.5rem;
    max-width: 100%;
    min-width: 0;
}
.discover-page .search-wrap { width: 100%; margin: 0 0 0.75rem; }
.discover-page .search-tabs { width: 100%; max-width: 100%; margin: 0 0 1rem; overflow: hidden; }
.discover-add-cta {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 0.85rem;
}
.discover-add-cta .composer-quick-link {
    background: var(--surface-elevated);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    font-weight: 600;
}
.discover-add-cta .composer-quick-link:hover {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand-dark);
}
.discover-page .search-results { width: 100%; }
body.page-discover .alert,
body.page-discover #searchMeta,
body.page-discover .pagination { width: 100%; }

.home-logo-wrap { display: none; }

.auth-wrap { max-width: 440px; margin: 1.5rem auto; }
.auth-wrap.profile-editor { max-width: 560px; }
.avatar-preview {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--brand-soft);
    display: inline-block;
}
.crop-wrap {
    max-height: 360px;
    overflow: hidden;
}
.crop-wrap img { max-width: 100%; display: block; }
.tag-box {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.4rem 0.5rem;
    min-height: 42px;
}
.tag-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--brand-soft);
    color: var(--brand-dark);
    border-radius: 99px;
    padding: 0.15rem 0.55rem;
    font-size: 0.82rem;
}
.tag-chip button {
    border: 0;
    background: none;
    color: inherit;
    line-height: 1;
    padding: 0;
}
.tag-input {
    border: 0;
    outline: none;
    width: 100%;
    margin-top: 0.35rem;
    font-size: 0.9rem;
}
.auth-hero { text-align: center; margin-bottom: 1.25rem; }
.auth-hero p { color: var(--muted); margin: 0.35rem 0 0; }
.auth-hero .logo-lg { height: 56px; width: auto; }

.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    background: #fff;
    border: 1px solid #dadce0;
    color: #3c4043;
    font-weight: 500;
}
.btn-google:hover,
.btn-google:focus {
    background: #f8f9fa;
    border-color: #dadce0;
    color: #202124;
}
.btn-google:disabled {
    opacity: 0.65;
}
.btn-google-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.steps {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    position: relative;
}
.steps::before {
    content: "";
    position: absolute;
    top: 14px;
    left: 16%;
    right: 16%;
    height: 2px;
    background: var(--line);
    z-index: 0;
}
.step {
    flex: 1;
    text-align: center;
    font-size: 0.8rem;
    color: var(--muted);
    position: relative;
    z-index: 1;
}
.step .num {
    width: 28px;
    height: 28px;
    margin: 0 auto 0.35rem;
    border-radius: 50%;
    border: 2px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: #fff;
}
.step.active { color: var(--brand-dark); font-weight: 600; }
.step.active .num { border-color: var(--brand); background: var(--brand); color: #fff; }
.step.done .num { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }

.home-logo-wrap { display: none; }

.search-wrap {
    position: relative;
    width: 100%;
    margin: 0 auto;
}
.search-wrap input {
    /* Match home composer textarea / placeholder size (not Bootstrap lg) */
    font-size: 1rem;
    line-height: 1.4;
    padding: 0.7rem 2.8rem 0.7rem 1.2rem;
    border-radius: 999px;
    border: 1px solid #cfcfcf;
    box-shadow: none;
    background: #fff;
}
.search-wrap input::placeholder {
    font-size: 1rem;
    line-height: 1.4;
}
.search-wrap input.has-clear {
    padding-right: 4.4rem;
}
.search-wrap input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}
.search-wrap input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(74, 124, 157, 0.15);
}
.search-wrap .search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa4ab;
    pointer-events: none;
}
.search-clear {
    position: absolute;
    right: 2.45rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.7rem;
    height: 1.7rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    cursor: pointer;
}
.search-clear.is-visible { display: inline-flex; }
.search-clear:hover,
.search-clear:focus-visible {
    color: var(--ink);
    background: rgba(15, 23, 42, 0.06);
    outline: none;
}
.search-reset-link {
    border: 0;
    background: none;
    padding: 0;
    margin-left: 0.35rem;
    color: var(--brand);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.search-reset-link:hover { color: var(--brand-dark); }

.search-tabs {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    border-bottom: 1px solid var(--line);
    margin: 0 0 1rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}
.search-tabs a, .search-tabs button {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    background: none;
    border: 0;
    border-bottom: 3px solid transparent;
    padding: 0.7rem 0.15rem;
    font-size: clamp(0.68rem, 2.4vw, 0.82rem);
    font-weight: 600;
    letter-spacing: 0;
    color: #8a9399;
    text-align: center;
    text-transform: none;
    white-space: nowrap;
}
.search-tabs .active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}
.tab-label-short { display: none; }
.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15em;
    height: 1.15em;
    padding: 0 0.38em;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    color: #64748b;
    font-size: 0.78em;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    box-sizing: border-box;
    flex: 0 0 auto;
}
.tab-count-n {
    font-size: inherit;
    font-weight: inherit;
    line-height: 1;
}
.search-tabs .active .tab-count {
    background: var(--brand-soft);
    color: var(--brand);
}
@media (max-width: 560px) {
    .tab-label-full { display: none; }
    .tab-label-short { display: inline; }
    .search-tabs a, .search-tabs button {
        gap: 0.22rem;
        padding: 0.6rem 0.08rem;
    }
}

.search-results { width: 100%; margin: 0 auto; }
body.page-search .alert,
body.page-search #searchMeta,
body.page-search .pagination {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 0.95rem;
    padding: 0.95rem 1.1rem;
    margin-bottom: 0.75rem;
    background: var(--surface-elevated);
    border-radius: var(--radius-lg);
    color: inherit;
    text-decoration: none;
    border-left: 4px solid transparent;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s, transform 0.15s;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}
.result-item.type-people { border-left: 4px solid var(--type-people); }
.result-item.type-businesses { border-left: 4px solid var(--type-business); }
.result-item.type-jobs { border-left: 4px solid var(--type-job); }
.result-item.type-groups { border-left: 4px solid var(--type-group); }
.result-item.type-market { border-left: 4px solid var(--type-market); }
.result-item:hover {
    color: inherit;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.result-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--brand-soft);
    flex-shrink: 0;
}
.result-item.type-market .result-avatar {
    border-radius: 50%;
}
.result-body,
.result-item > .flex-grow-1 {
    min-width: 0;
    flex: 1;
    overflow: hidden;
}
.result-item-chat h3,
.result-item-chat p,
.result-item-chat .loc {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.result-type {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.15rem;
}
.result-item.type-people .result-type { color: var(--type-people); }
.result-item.type-businesses .result-type { color: var(--type-business); }
.result-item.type-jobs .result-type { color: var(--type-job); }
.result-item.type-groups .result-type { color: var(--type-group); }
.result-item.type-market .result-type { color: var(--type-market); }
.search-results .result-item h3,
.result-item .result-name {
    font-size: 1.05rem;
    margin: 0 0 0.15rem;
    color: var(--brand);
    font-weight: 700;
}
.result-item h3,
.result-item h3 a,
.result-name a {
    color: var(--brand);
}
.result-item h3 { font-size: 1rem; margin: 0 0 0.15rem; }
.result-item p { margin: 0; color: #555; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-loc {
    margin-left: auto;
    font-weight: 700;
    color: #444;
    white-space: nowrap;
    padding-left: 0.75rem;
    font-size: 0.92rem;
}

.result-item.featured {
    background: var(--surface-elevated);
    border: 1px solid rgba(74, 124, 157, 0.15);
}
.featured-badge {
    display: inline-block;
    background: var(--brand);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    border-radius: 99px;
    margin-bottom: 0.35rem;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink);
}
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }

.chat-thread { display: flex; flex-direction: column; gap: 0.45rem; padding-bottom: 5rem; }
.chat-day {
    display: flex;
    justify-content: center;
    margin: 0.65rem 0 0.35rem;
}
.chat-day span {
    background: #ececec;
    color: #666;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.7rem;
    border-radius: 99px;
}
.bubble {
    max-width: 80%;
    padding: 0.7rem 0.9rem 0.45rem;
    border-radius: 16px;
    line-height: 1.4;
}
.bubble.mine { margin-left: auto; background: var(--brand); color: #fff; }
.bubble.theirs { margin-right: auto; background: #f4f4f4; border: 1px solid var(--line); }
.bubble-text a,
.bubble-text .webpage-link {
    word-break: break-all;
    text-decoration: underline;
    text-underline-offset: 2px;
}
/* Beat Bootstrap/global `a { color: brand }` — blue-on-blue made sent links invisible */
.bubble.mine a:not(.bubble-image-link):not(.bubble-file),
.bubble.mine a:not(.bubble-image-link):not(.bubble-file):link,
.bubble.mine a:not(.bubble-image-link):not(.bubble-file):visited,
.bubble.mine a:not(.bubble-image-link):not(.bubble-file):hover,
.bubble.mine a:not(.bubble-image-link):not(.bubble-file):active,
.bubble.mine .bubble-text a,
.bubble.mine .bubble-text a:link,
.bubble.mine .bubble-text a:visited,
.bubble.mine .bubble-text a:hover,
.bubble.mine .bubble-text a:active {
    color: #fff !important;
    text-decoration: underline !important;
    text-decoration-color: rgba(255, 255, 255, 0.9) !important;
}
.bubble.theirs .bubble-text a,
.bubble.theirs .bubble-text a:link,
.bubble.theirs .bubble-text a:visited {
    color: var(--brand-dark);
}
.bubble.has-attach { padding-top: 0.45rem; }
.bubble-image-link { display: block; margin: 0 0 0.35rem; }
.bubble-image {
    display: block;
    max-width: min(240px, 70vw);
    max-height: 280px;
    width: auto;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
}
.bubble-file {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 0.35rem;
    padding: 0.45rem 0.55rem;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    background: rgba(0, 0, 0, 0.08);
}
.bubble.mine .bubble-file { background: rgba(255, 255, 255, 0.18); color: #fff; }
.bubble.theirs .bubble-file { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.bubble-file-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: 0.85rem;
    line-height: 1.25;
}
.bubble-file-meta strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}
.bubble-file-meta span { opacity: 0.8; font-size: 0.75rem; }
.bubble-time {
    font-size: 0.68rem;
    opacity: 0.75;
    margin-top: 0.3rem;
}
.bubble.mine .bubble-time { text-align: right; }
.chat-composer {
    position: sticky;
    bottom: 0;
    background: var(--bg);
    padding: 0.75rem 0;
    z-index: 5;
}
.chat-composer-main { display: flex; flex-direction: column; gap: 0.4rem; width: 100%; }
.chat-composer-row {
    display: flex;
    align-items: flex-end;
    gap: 0.35rem;
}
.chat-composer-row textarea {
    flex: 1;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    line-height: 1.3;
}
.chat-tool-btn {
    width: 40px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #666;
    flex-shrink: 0;
}
.chat-tool-btn:hover { color: var(--brand); background: rgba(0, 0, 0, 0.04); }
.chat-emoji-panel {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    padding: 0.55rem 0.55rem 0.4rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.chat-emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 0.15rem;
    max-height: 180px;
    overflow: auto;
}
.chat-emoji-btn {
    border: 0;
    background: transparent;
    border-radius: 8px;
    font-size: 1.25rem;
    line-height: 1.4;
    padding: 0.2rem;
    cursor: pointer;
}
.chat-emoji-btn:hover { background: rgba(0, 0, 0, 0.06); }
.chat-emoji-hint {
    font-size: 0.72rem;
    margin-top: 0.35rem;
    padding: 0 0.15rem;
}
.chat-attach-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    font-size: 0.85rem;
}
.chat-attach-preview img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 8px;
}
.chat-attach-preview span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-attach-clear {
    border: 0;
    background: transparent;
    font-size: 1.25rem;
    line-height: 1;
    color: #888;
    padding: 0 0.25rem;
}
.send-btn {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    flex-shrink: 0;
}

.profile-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}
.profile-layout > section {
    min-width: 0;
}
.profile-card, .profile-details {
    background: var(--surface-elevated);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.35rem 1.2rem;
}
.profile-card { text-align: center; position: relative; }
.profile-card .feed-more-wrap {
    position: absolute;
    top: 0.65rem;
    right: 0.55rem;
}
.profile-card img.profile-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--brand-soft);
    margin: 0 auto 0.85rem;
    display: block;
}
.profile-card h1 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
    color: var(--brand);
}
.profile-card .result-type {
    justify-content: center;
    color: var(--muted);
    width: 100%;
    margin-bottom: 0.35rem;
}
.profile-card .profile-loc { color: var(--muted); margin-bottom: 0.9rem; }
.profile-card .btn-message {
    background: var(--brand);
    border: 0;
    color: #fff;
    border-radius: 999px;
    padding: 0.45rem 1.5rem;
    display: inline-block;
    font-weight: 600;
}
.profile-card .btn-message:hover { background: var(--brand-dark); color: #fff; }
.profile-card .btn-message-secondary {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink);
}
.profile-card .btn-message-secondary:hover {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: var(--brand-dark);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--brand);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}
.back-link:hover { color: var(--brand-dark); }

.entity-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}
.entity-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: #444;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.entity-action:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-soft);
}
.entity-action-danger:hover {
    border-color: #c0392b;
    color: #c0392b;
    background: #fdf0ee;
}
.entity-action i { font-size: 0.85rem; }

.detail-page { max-width: 720px; margin: 0 auto; }
.detail-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.detail-hero .feed-more-wrap {
    margin-left: auto;
    align-self: flex-start;
}
.group-hero .feed-more-wrap {
    margin-left: 0;
}
.detail-hero img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--brand-soft);
}
.detail-hero img.detail-hero-icon {
    border-radius: 50%;
    padding: 0.75rem;
    object-fit: contain;
}
.detail-hero h1 { color: var(--brand); }
.group-hero .page-hero-title { color: var(--brand); }
.share-copy-field {
    font-size: 0.9rem;
    resize: none;
}

.detail-row {
    display: grid;
    grid-template-columns: minmax(7rem, 9.5rem) minmax(0, 1fr);
    gap: 0.75rem 1rem;
    padding: 0.85rem 0.15rem;
    border-bottom: 1px solid #e6e6e6;
    font-size: 0.95rem;
    align-items: start;
}
.detail-row:last-child { border-bottom: 0; }
.detail-row-stack {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
}
.detail-row-stack .detail-label,
.detail-row-stack .detail-value {
    width: 100%;
    max-width: 100%;
}
.detail-label { font-weight: 700; color: #333; }
.detail-value {
    color: #444;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.5;
}
.detail-value a { text-decoration: underline; }

.profile-hero { text-align: center; }
.profile-hero img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--brand-soft);
}
.muted { color: var(--muted); }
.webpage-link { word-break: break-all; }
.help-text { font-size: 0.82rem; color: var(--muted); margin-top: 0.25rem; }

.legal-doc h1 { font-size: 1.45rem; margin-bottom: 0.35rem; }
.legal-doc h2 { font-size: 1.05rem; margin-top: 1.4rem; margin-bottom: 0.5rem; color: var(--brand-dark); }
.legal-doc p, .legal-doc li { color: #444; line-height: 1.55; }
.legal-doc .updated { color: var(--muted); font-size: 0.88rem; margin-bottom: 1rem; }
.legal-doc ul { padding-left: 1.2rem; }

.dropdown-menu { border-radius: 12px; }
.alert { border-radius: 10px; }

.wizard-pane { display: none; }
.wizard-pane.active { display: block; }

.settings-group {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    background: #fff;
}
.settings-row:last-child { border-bottom: 0; }
.settings-row:hover { color: var(--ink); background: #f7f7f7; }
.settings-row.is-disabled { color: var(--muted); cursor: default; }
.settings-row.is-disabled:hover { background: #fff; }
.settings-chevron { color: #bbb; font-size: 0.75rem; }
.notif-pref-table {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
}
.notif-pref-head,
.notif-pref-row {
    display: grid;
    grid-template-columns: 1fr 64px 64px;
    gap: 0.5rem;
    align-items: center;
    padding: 0.85rem 1rem;
}
.notif-pref-head {
    background: var(--surface);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.notif-pref-row + .notif-pref-row { border-top: 1px solid var(--line); }
.notif-pref-row strong { display: block; margin-bottom: 0.15rem; }
.notif-pref-check {
    display: flex;
    justify-content: center;
    margin: 0;
}
.app-welcome-inner {
    padding-top: 8rem;
    padding-bottom: 4rem;
}
/* Native Capacitor shell: reduce browser chrome / refresh flash feel */
html.is-native-app,
html.is-native-app body {
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
}
html.is-native-app body.has-tabbar .page {
    background: var(--bg);
}
html.is-native-app .app-header,
html.is-native-app .mobile-topbar,
html.is-native-app .tabbar {
    transition: none;
}
.settings-logout {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    color: #c0392b;
    border-radius: 12px;
    padding: 0.9rem 1rem;
    font-weight: 600;
}

/* Mobile top bar (logo + bell) — hidden on desktop */
.mobile-topbar { display: none; }

.tabbar { display: none; }

@media (max-width: 767px) {
    .header-nav { display: none; }
    .page-hero-logo { display: block; height: 36px; }
    /* .mobile-bell no longer used */
    .listing-actions { grid-template-columns: repeat(2, 1fr); }
    .composer-links-card { padding: 0.5rem; }
    .page-hero-title { font-size: 1.25rem; }
    .profile-layout { grid-template-columns: 1fr; }
    .detail-row { grid-template-columns: 1fr; gap: 0.2rem; }
    .footer-inner { justify-content: center; text-align: center; }
    .footer-links { justify-content: center; }
    .result-loc { display: none; }
    .quick-actions { grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
    .quick-action { font-size: 0.68rem; padding: 0.7rem 0.2rem; }
    .header-actions { display: none; }
    .section-head {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0.5rem 0.65rem;
        max-width: 100%;
    }
    .section-head .section-label {
        flex: 1 1 8rem;
        min-width: 0;
        margin-bottom: 0;
    }
    .sort-bar {
        flex: 0 1 auto;
        max-width: 100%;
        min-width: 0;
    }
    .sort-bar > .muted { flex-shrink: 0; }
    body.has-tabbar .app-header { display: none; }
    body.has-tabbar .app-footer { display: none; }
    body.has-tabbar .page {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        padding-top: 3rem; /* room for fixed mobile-topbar */
        padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
    }

    /* Mobile top bar */
    .mobile-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 45;
        height: 2.8rem;
        background: var(--header);
        padding: 0 1rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    }
    .mobile-topbar-logo img {
        height: 26px;
        width: auto;
        display: block;
        object-fit: contain;
    }
    .mobile-topbar-actions {
        display: flex;
        align-items: center;
        gap: 0.15rem;
    }
    .mobile-topbar-bell,
    .mobile-topbar-logout button {
        position: relative;
        color: rgba(255,255,255,0.82);
        font-size: 1.15rem;
        padding: 0.25rem 0.4rem;
        border-radius: 8px;
        line-height: 1;
        text-decoration: none;
        transition: background 0.15s, color 0.15s;
        border: 0;
        background: transparent;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .mobile-topbar-logout { margin: 0; }
    .mobile-topbar-bell:hover,
    .mobile-topbar-bell.active,
    .mobile-topbar-logout button:hover {
        color: #fff;
        background: rgba(255,255,255,0.18);
    }
    .mobile-topbar-badge {
        position: absolute;
        top: -3px;
        right: -4px;
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        border-radius: 99px;
        background: #e55353;
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        line-height: 16px;
        text-align: center;
        pointer-events: none;
    }
    /* Admin layout stacks on mobile */
    .admin-layout {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .admin-sidenav {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        border-radius: var(--radius);
        position: static;
    }
    .admin-sidenav-link {
        flex-direction: column;
        gap: 0.2rem;
        padding: 0.55rem 0.75rem;
        border-bottom: 0;
        border-right: 1px solid var(--line);
        font-size: 0.72rem;
        white-space: nowrap;
        flex: 1;
        justify-content: center;
        text-align: center;
    }
    .admin-sidenav-link:last-child { border-right: 0; }
    .admin-sidenav-link i { width: auto; }
    .tabbar {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        z-index: 50;
        background: var(--header);
        border-top: 0;
        padding: 0.35rem 0.15rem calc(0.35rem + env(safe-area-inset-bottom));
        justify-content: space-around;
        box-shadow: 0 -4px 16px rgba(0,0,0,0.12);
        /* Keep above iOS browser chrome / keyboard jank */
        transform: translateZ(0);
    }
    .tabbar a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.1rem;
        color: rgba(255,255,255,0.7);
        font-size: 0.62rem;
        font-weight: 600;
        position: relative;
        padding: 0.15rem 0;
    }
    .tabbar a:hover { color: #fff; }
    .tabbar a.active { color: #fff; }
    .tabbar i { font-size: 1.05rem; }
    .tabbar-badge {
        position: absolute;
        top: 0;
        right: calc(50% - 18px);
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        border-radius: 99px;
        background: #e55353;
        color: #fff;
        font-size: 10px;
        line-height: 16px;
        text-align: center;
    }
    .chat-composer {
        bottom: calc(3.6rem + env(safe-area-inset-bottom));
        padding-bottom: 0.75rem;
    }
    .composer-listing,
    .composer-actions,
    .photo-preview {
        padding-left: 0;
    }
    .composer-card-collapsible .composer-input-collapsed {
        min-height: 4.75rem;
        height: 4.75rem;
        font-size: 1rem; /* avoid iOS zoom; also keeps placeholder readable */
    }
}

.theme-picker {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.theme-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-elevated);
    cursor: pointer;
}
.theme-option:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand-soft);
}
.theme-option input {
    margin-top: 0.2rem;
}

/* ----- Dark mode component overrides (hardcoded light colors) ----- */
html[data-theme="dark"] .app-toast {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus,
html[data-theme="dark"] textarea.form-control {
    background-color: var(--form-bg);
    color: var(--form-ink);
    border-color: var(--line);
}
html[data-theme="dark"] .form-control::placeholder {
    color: #8e8e8e;
}
html[data-theme="dark"] .modal-content {
    background: var(--surface-elevated);
    color: var(--ink);
    border-color: var(--line);
}
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
    border-color: var(--line);
}
html[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(1);
}
html[data-theme="dark"] .dropdown-menu {
    background: var(--surface-elevated);
    border-color: var(--line);
    color: var(--ink);
}
html[data-theme="dark"] .dropdown-item {
    color: var(--ink);
}
html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus {
    background: var(--surface);
    color: var(--ink);
}
html[data-theme="dark"] .bubble.theirs {
    background: #454545;
    border-color: var(--line);
    color: var(--ink);
}
html[data-theme="dark"] .bubble.theirs .bubble-file {
    background: #3a3a3a;
    border-color: var(--line);
    color: var(--ink);
}
html[data-theme="dark"] .chat-composer,
html[data-theme="dark"] .chat-attach-preview {
    background: var(--bg);
}
html[data-theme="dark"] .chat-tool-btn:hover {
    background: rgba(255, 255, 255, 0.06);
}
html[data-theme="dark"] .btn-google {
    background: var(--surface-elevated);
    border-color: var(--line);
    color: var(--ink);
}
html[data-theme="dark"] .btn-google:hover,
html[data-theme="dark"] .btn-google:focus {
    background: #454545;
    border-color: var(--line);
    color: var(--ink);
}
html[data-theme="dark"] .settings-group,
html[data-theme="dark"] .settings-row,
html[data-theme="dark"] .settings-logout {
    background: var(--surface-elevated);
    border-color: var(--line);
    color: var(--ink);
}
html[data-theme="dark"] .settings-row:hover {
    background: #454545;
    color: var(--ink);
}
html[data-theme="dark"] .settings-row.is-disabled:hover {
    background: var(--surface-elevated);
}
html[data-theme="dark"] .detail-label { color: var(--ink); }
html[data-theme="dark"] .detail-value,
html[data-theme="dark"] .legal-doc p,
html[data-theme="dark"] .legal-doc li,
html[data-theme="dark"] .result-item p,
html[data-theme="dark"] .result-loc,
html[data-theme="dark"] .entity-action {
    color: #c8c8c8;
}
html[data-theme="dark"] .entity-action {
    background: var(--surface-elevated);
    border-color: var(--line);
}
html[data-theme="dark"] .entity-action:hover {
    background: var(--brand-soft);
}
html[data-theme="dark"] .pagination a {
    background: var(--surface-elevated);
    border-color: var(--line);
    color: var(--ink);
}
html[data-theme="dark"] .search-tabs a,
html[data-theme="dark"] .search-tabs button,
html[data-theme="dark"] .composer-mode span,
html[data-theme="dark"] .btn-outline-secondary {
    background: var(--surface-elevated);
    border-color: var(--line);
    color: var(--ink);
}
html[data-theme="dark"] .table,
html[data-theme="dark"] .card,
html[data-theme="dark"] .list-group-item {
    --bs-table-bg: var(--surface-elevated);
    --bs-table-color: var(--ink);
    --bs-table-border-color: var(--line);
    background-color: var(--surface-elevated);
    color: var(--ink);
    border-color: var(--line);
}
html[data-theme="dark"] .alert-warning {
    background: #4a3b1f;
    border-color: #6b5424;
    color: #f5e6c8;
}
html[data-theme="dark"] .notice-row.unread {
    background: var(--brand-soft);
}
html[data-theme="dark"] .tabbar {
    background: var(--header);
    border-color: var(--line);
}
html[data-theme="dark"] .mobile-topbar {
    background: var(--header);
}

/* ——— Marketing landing (pre-signin) ——— */
body.page-landing {
    margin: 0;
    background: #f7f5f1;
    color: #1f2a30;
    font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
    min-height: 100vh;
    display: block;
}
.landing-nav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem clamp(1rem, 4vw, 2.5rem);
}
.landing-nav-brand img {
    height: 32px;
    width: auto;
    display: block;
    object-fit: contain;
}
.landing-nav-links {
    display: flex;
    align-items: center;
    gap: 0.85rem 1.15rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.landing-nav-links a {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.92rem;
    font-weight: 560;
    text-decoration: none;
}
.landing-nav-links a:hover { color: #fff; }
.landing-nav-join {
    padding: 0.4rem 0.95rem !important;
    border-radius: 999px !important;
    font-weight: 650 !important;
}
.landing-hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: flex-end;
    color: #fff;
    overflow: hidden;
    background:
        linear-gradient(160deg, #16303c 0%, #1e333f 42%, #2a4f63 78%, #3d6a86 100%);
}
.landing-hero-media {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.landing-hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.55;
    will-change: transform;
}
.landing-hero-glow-a {
    width: min(72vw, 640px);
    height: min(72vw, 640px);
    top: -18%;
    right: -12%;
    background: radial-gradient(circle, rgba(106, 155, 184, 0.55) 0%, transparent 68%);
    animation: landing-glow-a 18s ease-in-out infinite alternate;
}
.landing-hero-glow-b {
    width: min(58vw, 480px);
    height: min(58vw, 480px);
    bottom: -12%;
    left: -8%;
    background: radial-gradient(circle, rgba(74, 124, 157, 0.45) 0%, transparent 70%);
    animation: landing-glow-b 22s ease-in-out infinite alternate;
}
.landing-hero-mesh {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(ellipse 80% 70% at 60% 40%, #000 20%, transparent 75%);
    opacity: 0.55;
}
.landing-hero-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, rgba(18, 28, 34, 0.72) 0%, rgba(18, 28, 34, 0.28) 45%, transparent 100%),
        linear-gradient(105deg, rgba(22, 48, 60, 0.35) 0%, transparent 55%);
}
@keyframes landing-glow-a {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(-6%, 8%, 0) scale(1.12); }
}
@keyframes landing-glow-b {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(8%, -6%, 0) scale(1.08); }
}
.landing-hero-inner {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    padding: 7.5rem clamp(1.15rem, 4vw, 2.75rem) 3.25rem;
    animation: landing-rise 0.85s ease both;
}
.landing-hero-logo {
    display: block;
    height: clamp(52px, 9vw, 78px);
    width: auto;
    margin-bottom: 1.35rem;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.25));
}
.landing-hero-title {
    font-family: "Source Serif 4", Georgia, serif;
    font-weight: 700;
    font-size: clamp(2rem, 5.2vw, 3.35rem);
    line-height: 1.12;
    letter-spacing: -0.02em;
    margin: 0 0 0.85rem;
    max-width: 14ch;
}
.landing-hero-lead {
    margin: 0 0 1.6rem;
    font-size: clamp(1.02rem, 2.2vw, 1.2rem);
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.88);
    max-width: 34ch;
}
.landing-hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}
.landing-hero-cta .btn-lg {
    border-radius: 999px;
    padding: 0.7rem 1.35rem;
    font-weight: 650;
}
.landing-hero-cta .btn-outline-light {
    border-width: 1.5px;
    background: transparent;
}
.landing-hero-cta .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}
@keyframes landing-rise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

.landing-section {
    padding: clamp(3.25rem, 8vw, 5.5rem) clamp(1.15rem, 4vw, 2.75rem);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}
.landing-section.is-in,
.landing-close.is-in {
    opacity: 1;
    transform: translateY(0);
}
.landing-section-alt {
    background: #efece6;
}
.landing-section-inner {
    width: min(720px, 100%);
    margin: 0 auto;
}
.landing-kicker {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #4A7C9D;
    margin: 0 0 0.65rem;
}
.landing-section-title {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: clamp(1.55rem, 3.4vw, 2.15rem);
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -0.015em;
    margin: 0 0 1rem;
    color: #1f2a30;
}
.landing-copy {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #4a5560;
}
.landing-copy em { font-style: italic; color: #2c3a42; }

.landing-features {
    list-style: none;
    margin: 1.75rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid rgba(31, 42, 48, 0.12);
}
.landing-features li {
    padding: 1.15rem 0;
    border-bottom: 1px solid rgba(31, 42, 48, 0.12);
}
.landing-features h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 0.3rem;
    color: #1f2a30;
}
.landing-features p {
    margin: 0;
    color: #4a5560;
    line-height: 1.5;
    font-size: 0.98rem;
}

.landing-steps {
    list-style: none;
    margin: 1.75rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}
.landing-steps li {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
}
.landing-step-num {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #4A7C9D;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}
.landing-steps strong {
    display: block;
    margin-bottom: 0.15rem;
    color: #1f2a30;
}
.landing-steps p {
    margin: 0;
    color: #4a5560;
    font-size: 0.98rem;
    line-height: 1.45;
}

.landing-close {
    background: #1e333f;
    color: #fff;
    padding: clamp(3.5rem, 9vw, 5.75rem) clamp(1.15rem, 4vw, 2.75rem);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}
.landing-close-inner {
    width: min(720px, 100%);
    margin: 0 auto;
    text-align: left;
}
.landing-close-logo {
    height: 48px;
    width: auto;
    display: block;
    margin-bottom: 1.1rem;
}
.landing-close-title {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: clamp(1.55rem, 3.4vw, 2.1rem);
    font-weight: 650;
    margin: 0 0 1.35rem;
    letter-spacing: -0.015em;
}
.landing-footer {
    margin-top: 0;
}
.landing-footer .footer-links a { gap: 0; }
.landing-footer .footer-links i { display: none; }

@media (max-width: 767px) {
    .landing-hero {
        min-height: 100svh;
        min-height: 100dvh;
    }
    .landing-hero-inner {
        padding-top: 5.75rem;
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }
    .landing-hero-title {
        max-width: none;
        font-size: clamp(1.75rem, 7.5vw, 2.35rem);
    }
    .landing-hero-lead {
        max-width: none;
    }
}
@media (prefers-reduced-motion: reduce) {
    .landing-hero-glow-a,
    .landing-hero-glow-b,
    .landing-hero-inner {
        animation: none;
    }
}
@media (max-width: 640px) {
    .landing-nav-links a:not(.landing-nav-join):not(.landing-nav-signin) {
        display: none;
    }
    .landing-hero-cta {
        flex-direction: column;
        align-items: stretch;
    }
    .landing-hero-cta .btn { width: 100%; text-align: center; }
}

html[data-theme="dark"] body.page-landing {
    background: #2c2c2c;
    color: #ececec;
}
html[data-theme="dark"] .landing-section-alt { background: #333; }
html[data-theme="dark"] .landing-section-title,
html[data-theme="dark"] .landing-features h3,
html[data-theme="dark"] .landing-steps strong,
html[data-theme="dark"] .landing-copy em { color: #ececec; }
html[data-theme="dark"] .landing-copy,
html[data-theme="dark"] .landing-features p,
html[data-theme="dark"] .landing-steps p { color: #a8a8a8; }
html[data-theme="dark"] .landing-features,
html[data-theme="dark"] .landing-features li {
    border-color: rgba(255, 255, 255, 0.1);
}
