/* =============================================================================
   Off Grid Forum — OGM-native styling.
   Uses OGM theme CSS tokens defined in the active theme (--ogm-accent,
   --ogm-bg-elev, etc.) so the forum looks like part of the marketplace.
   Loaded only on /forum/* pages.
   ============================================================================= */

.ogforum-shell {
    color: var(--ogm-text);
    font-family: var(--ogm-font);
}
.ogforum-shell a { color: var(--ogm-accent); text-decoration: none; }
.ogforum-shell a:hover { text-decoration: underline; }
/* Button overrides — link color must NOT bleed into button labels. */
.ogforum-shell a.ogm-btn,
.ogforum-shell a.ogm-btn:hover { text-decoration: none; }
.ogforum-shell a.ogm-btn--primary,
.ogforum-shell a.ogm-btn--primary:hover { color: #fff; }
.ogforum-shell a.ogm-btn--ghost,
.ogforum-shell a.ogm-btn--ghost:hover  { color: var(--ogm-text); }
.ogforum-shell a.ogm-btn--danger,
.ogforum-shell a.ogm-btn--danger:hover { color: var(--ogm-danger); }
.ogforum-shell h1, .ogforum-shell h2, .ogforum-shell h3 { color: var(--ogm-text); margin: 0 0 .5em; }
.ogforum-muted { color: var(--ogm-text-muted); font-size: .9rem; }

.ogforum-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 0 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--ogm-border);
    flex-wrap: wrap;
}
.ogforum-page-header h1 { font-size: 1.7rem; margin: 0; }
.ogforum-page-header p  { margin: 4px 0 0; }

.ogforum-section { margin: 24px 0; }
.ogforum-section__title { font-size: 1.2rem; font-weight: 700; margin: 0 0 12px; }

.ogforum-breadcrumbs {
    color: var(--ogm-text-muted);
    font-size: .9rem;
    margin: 8px 0 12px;
    display: flex; gap: 6px; align-items: center;
}
.ogforum-breadcrumbs span { color: var(--ogm-text-muted); }

.ogforum-empty {
    background: var(--ogm-bg-elev);
    border: 1px dashed var(--ogm-border);
    border-radius: var(--ogm-radius-lg);
    padding: 40px 24px;
    text-align: center;
    color: var(--ogm-text-muted);
}

.ogforum-flash {
    padding: 12px 14px;
    border-radius: var(--ogm-radius);
    margin: 12px 0;
    font-size: .95rem;
}
.ogforum-flash--error   { background: rgba(181, 58, 58, .08);  color: var(--ogm-danger);  border: 1px solid rgba(181, 58, 58, .25); }
.ogforum-flash--success { background: rgba(47, 122, 58, .08);  color: var(--ogm-accent);  border: 1px solid rgba(47, 122, 58, .25); }

.ogforum-error {
    background: rgba(181, 58, 58, .08);
    color: var(--ogm-danger);
    border: 1px solid rgba(181, 58, 58, .25);
    border-radius: var(--ogm-radius);
    padding: 16px;
}

/* ── Avatars ────────────────────────────────────────────────────────── */
.ogforum-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--ogm-bg-soft);
    flex-shrink: 0;
}
.ogforum-avatar--sm { width: 36px; height: 36px; }
.ogforum-avatar-link {
    display: inline-block;
    flex-shrink: 0;
    flex-grow: 0;
    align-self: flex-start;
    line-height: 0;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    transition: box-shadow .15s;
}
.ogforum-reply .ogforum-avatar-link { width: 36px; height: 36px; }
.ogforum-avatar-link img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.ogforum-avatar-link:hover { box-shadow: 0 0 0 2px var(--ogm-accent); }

/* ── Pills (Pinned/Locked/Private) ──────────────────────────────────── */
.ogforum-pill {
    display: inline-block;
    font-size: .7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em;
    padding: 2px 8px; border-radius: 999px;
    vertical-align: middle;
    background: var(--ogm-bg-soft); color: var(--ogm-text-muted);
}
.ogforum-pill--pin  { background: rgba(192, 128, 32, .15); color: var(--ogm-warning); }
.ogforum-pill--lock { background: rgba(107, 102, 96, .15); color: var(--ogm-text-muted); }

/* ── Group list ─────────────────────────────────────────────────────── */
.ogforum-search {
    display: flex;
    gap: 8px;
    margin: 12px 0 20px;
}
.ogforum-search input[type="search"] {
    flex: 1 1 auto;
    padding: 10px 12px;
    border: 1px solid var(--ogm-border);
    border-radius: var(--ogm-radius);
    background: var(--ogm-bg);
    color: var(--ogm-text);
    font: inherit;
}

.ogforum-group-list {
    list-style: none;
    padding: 0; margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.ogforum-group-card {
    background: var(--ogm-bg-elev);
    border: 1px solid var(--ogm-border);
    border-radius: var(--ogm-radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color .15s, box-shadow .15s;
}
.ogforum-group-card:hover { border-color: var(--ogm-accent); box-shadow: var(--ogm-shadow-lg); }
.ogforum-group-card__cover {
    display: block;
    height: 80px;
    background: var(--ogm-bg-soft) center/cover no-repeat;
    background-image: linear-gradient(135deg, rgba(47,122,58,.15), rgba(192,128,32,.10));
}
.ogforum-group-card__body { padding: 14px 16px; flex: 1 1 auto; }
.ogforum-group-card__name { display: block; font-weight: 700; font-size: 1.05rem; color: var(--ogm-text); margin-bottom: 4px; }
.ogforum-group-card__name:hover { color: var(--ogm-accent); text-decoration: none; }
.ogforum-group-card__desc { font-size: .9rem; color: var(--ogm-text); margin: 6px 0; line-height: 1.4; }

/* ── Group header (single-group view) ──────────────────────────────────
   Facebook-style layout, OGM brand: clean cover photo on top with a
   floating "Manage" pill in the bottom-right (admins only); below the
   cover, a title row with meta line + member-avatar pile on the left
   and primary action button on the right. Text and buttons NEVER
   overlap the photo. */
.ogforum-group-header {
    background: var(--ogm-bg-elev);
    border: 1px solid var(--ogm-border);
    border-radius: var(--ogm-radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}

/* Cover photo */
.ogforum-group-header__cover {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 5;
    background-color: var(--ogm-bg-soft);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

/* "Manage" pill floating on the cover (admin only) — frosted glass so
   it reads on any photo without darkening the whole cover. */
.ogforum-group-header__cover-action {
    position: absolute;
    right: 16px;
    bottom: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255,255,255,.92);
    color: var(--ogm-text);
    border-radius: 999px;
    font-size: .88rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    transition: background .12s, transform .08s;
}
.ogforum-group-header__cover-action:hover {
    background: #fff;
    color: var(--ogm-text);
    text-decoration: none;
}
.ogforum-group-header__cover-action:active { transform: translateY(1px); }
.ogforum-group-header__cover-action svg { width: 14px; height: 14px; fill: currentColor; }

/* Info bar below the cover */
.ogforum-group-header__bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 24px 22px;
    flex-wrap: wrap;
}
.ogforum-group-header__main { flex: 1 1 auto; min-width: 0; }

.ogforum-group-header__title {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 6px;
    letter-spacing: -.01em;
    color: var(--ogm-text);
}

/* Meta line — globe/lock icon + public/private + member count + thread
   count, all in a single muted row. */
.ogforum-group-header__meta {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: .9rem;
    color: var(--ogm-text-muted);
}
.ogforum-group-header__meta-icon {
    width: 14px; height: 14px;
    fill: currentColor;
    flex: none;
}
.ogforum-group-header__meta-sep { opacity: .6; }

.ogforum-group-header__desc {
    margin: 8px 0 0;
    font-size: .98rem;
    line-height: 1.5;
    color: var(--ogm-text);
    max-width: 760px;
}

/* Avatar pile — overlapping small circles, member social proof. */
.ogforum-group-header__avatars {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: flex;
}
.ogforum-group-header__avatars li {
    margin-left: -8px;
}
.ogforum-group-header__avatars li:first-child { margin-left: 0; }
.ogforum-group-header__avatars a {
    display: inline-block;
    line-height: 0;
    text-decoration: none;
    transition: transform .12s;
}
.ogforum-group-header__avatars a:hover {
    transform: translateY(-2px);
    z-index: 2;
    position: relative;
}
.ogforum-group-header__avatar {
    width: 32px !important;
    height: 32px !important;
    font-size: 12px;
    border: 2px solid var(--ogm-bg-elev);
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

/* Primary action on the right */
.ogforum-group-header__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex: none;
    align-self: center;
}
.ogforum-group-header__actions .ogm-btn {
    padding: 10px 20px;
    font-weight: 700;
    font-size: .95rem;
}

@media (max-width: 640px) {
    .ogforum-group-header__cover { aspect-ratio: 16 / 7; }
    .ogforum-group-header__cover-action { right: 10px; bottom: 10px; padding: 6px 12px; font-size: .82rem; }
    .ogforum-group-header__bar { padding: 16px 18px 18px; gap: 14px; }
    .ogforum-group-header__title { font-size: 1.4rem; }
    .ogforum-group-header__actions { width: 100%; }
    .ogforum-group-header__actions .ogm-btn { flex: 1; text-align: center; }
    .ogforum-group-header__avatar { width: 28px !important; height: 28px !important; font-size: 11px; }
}

/* ── Compose-thread modal (in-page, no navigation) ──────────────────── */
.ogforum-compose-form .ogforum-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: .92rem;
    color: var(--ogm-text);
}
.ogforum-compose-form input[type="text"],
.ogforum-compose-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--ogm-border);
    border-radius: 8px;
    font: inherit;
    background: var(--ogm-bg);
    color: var(--ogm-text);
    box-sizing: border-box;
}
.ogforum-compose-form input[type="text"]:focus,
.ogforum-compose-form textarea:focus {
    outline: 2px solid var(--ogm-accent);
    outline-offset: 1px;
    border-color: transparent;
}
.ogforum-compose-form textarea { resize: vertical; min-height: 160px; line-height: 1.5; }
.ogforum-compose-form__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}
.ogforum-compose-form__actions [data-ogforum-compose-status] { flex: 1; font-size: .85rem; }

/* ── Sort tabs ──────────────────────────────────────────────────────── */
.ogforum-sort {
    display: flex; gap: 4px;
    margin: 16px 0 12px;
    border-bottom: 1px solid var(--ogm-border);
}
.ogforum-sort__btn {
    padding: 8px 14px;
    color: var(--ogm-text-muted);
    border-bottom: 2px solid transparent;
    font-weight: 600;
}
.ogforum-sort__btn:hover { color: var(--ogm-accent); text-decoration: none; }
.ogforum-sort__btn.is-active { color: var(--ogm-accent); border-bottom-color: var(--ogm-accent); }

/* ── Thread list (group view) ── Native <details>/<summary> for click-to-expand.
   Works without JavaScript. Full thread content is server-rendered inside
   each <details>; the browser handles the toggle. */
.ogforum-thread-list {
    list-style: none;
    padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 8px;
}
.ogforum-thread-row {
    background: var(--ogm-bg-elev);
    border: 1px solid var(--ogm-border);
    border-radius: var(--ogm-radius-lg);
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
}
.ogforum-thread-row:hover { border-color: var(--ogm-border-strong); }
.ogforum-thread-row__details[open] { background: var(--ogm-bg-elev); }
.ogforum-thread-row__details[open] ~ *,
.ogforum-thread-row:has(.ogforum-thread-row__details[open]) {
    border-color: var(--ogm-accent);
    box-shadow: var(--ogm-shadow);
}

.ogforum-thread-row__head {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 28px;
    gap: 12px;
    padding: 14px 16px;
    align-items: flex-start;
    cursor: pointer;
    user-select: none;
    list-style: none;
}
.ogforum-thread-row__head::-webkit-details-marker { display: none; } /* kill default disclosure triangle */
.ogforum-thread-row__head::marker { display: none; }
.ogforum-thread-row__head:hover { background: var(--ogm-bg-soft); }
.ogforum-thread-row__main { min-width: 0; }
.ogforum-thread-row__title { font-weight: 600; font-size: 1.05rem; color: var(--ogm-text); margin-bottom: 4px; }
.ogforum-thread-row__excerpt { color: var(--ogm-text); font-size: .92rem; margin: 6px 0 0; line-height: 1.5; }
.ogforum-thread-row__chev {
    color: var(--ogm-text-muted);
    font-size: 1.1rem;
    transition: transform .2s;
    text-align: center;
    align-self: center;
}
.ogforum-thread-row__details[open] .ogforum-thread-row__chev {
    transform: rotate(180deg);
}

/* The expand container — sits below the summary, shown when <details open> */
.ogforum-thread-row__expand {
    border-top: 1px solid var(--ogm-border);
    padding: 16px 20px 20px;
    background: var(--ogm-bg);
}
/* Inside the expand container, the .ogforum-thread shouldn't have its own
   card border/padding — it's already inside the row card. The expand
   container's bg is var(--ogm-bg), so the thread-line mask must use that
   color (instead of the default --ogm-bg-elev) to blend invisibly. */
.ogforum-thread-row__expand .ogforum-thread {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    --ogforum-thread-bg: var(--ogm-bg);
}

@media (max-width: 720px) {
    .ogforum-thread-row__head { grid-template-columns: 36px 1fr 24px; gap: 10px; }
}

/* ── Thread detail ── sleeker, lighter, more whitespace ─────────────── */
.ogforum-thread {
    background: var(--ogm-bg-elev);
    border: 1px solid var(--ogm-border);
    border-radius: 16px;
    padding: 28px 28px 20px;
    margin-bottom: 20px;
}
.ogforum-thread__title { font-size: 1.45rem; font-weight: 700; margin: 0 0 14px; letter-spacing: -.01em; }
.ogforum-thread__body { line-height: 1.65; word-wrap: break-word; color: var(--ogm-text); }
.ogforum-thread__body p { margin: 0 0 1em; }
.ogforum-thread__footer {
    display: flex; align-items: center; gap: 10px;
    margin-top: 18px; padding-top: 14px;
    border-top: 1px solid var(--ogm-border);
    flex-wrap: wrap;
}

.ogforum-byline { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.ogforum-byline__name { color: var(--ogm-text); font-weight: 600; font-size: .95rem; }
.ogforum-byline__name:hover { color: var(--ogm-accent); text-decoration: none; }

/* ── React / vote buttons ── pill, soft, low-contrast borders ───────── */
.ogforum-react {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px;
    background: transparent;
    border: 1px solid var(--ogm-border);
    border-radius: 999px;
    color: var(--ogm-text);
    cursor: pointer;
    font: inherit;
    font-size: .88rem;
    transition: background .12s, border-color .12s, color .12s;
}
.ogforum-react:hover { border-color: var(--ogm-accent); color: var(--ogm-accent); }
.ogforum-react.is-on { background: rgba(47, 122, 58, .10); border-color: var(--ogm-accent); color: var(--ogm-accent); }

.ogforum-vote {
    display: inline-flex; align-items: center; gap: 2px;
    border: 1px solid var(--ogm-border);
    border-radius: 999px;
    padding: 0 6px;
}
.ogforum-vote button {
    background: transparent; border: none;
    color: var(--ogm-text-muted);
    cursor: pointer; font-size: .85rem;
    padding: 4px 4px;
    font: inherit;
}
.ogforum-vote button:hover { color: var(--ogm-accent); }
.ogforum-vote button.is-on { color: var(--ogm-accent); font-weight: 700; }
.ogforum-vote .js-score { font-weight: 600; min-width: 1.4em; text-align: center; font-size: .85rem; }

.ogforum-report-btn,
.ogforum-reply-link {
    background: none; border: none;
    color: var(--ogm-text-muted);
    cursor: pointer; font: inherit;
    padding: 4px 8px; border-radius: 999px;
    font-size: .82rem;
}
.ogforum-report-btn:hover { color: var(--ogm-danger); background: rgba(181, 58, 58, .06); }
.ogforum-reply-link:hover { color: var(--ogm-accent); background: rgba(47, 122, 58, .06); }
.ogforum-reply-link--danger:hover { color: var(--ogm-danger); background: rgba(181, 58, 58, .06); }

/* ── Report modal ── */
.ogforum-modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(20, 18, 16, .55);
    z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.ogforum-modal-backdrop[hidden] { display: none; }
.ogforum-modal {
    background: var(--ogm-bg-elev);
    border: 1px solid var(--ogm-border);
    border-radius: 16px;
    width: 100%; max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--ogm-shadow-lg);
    color: var(--ogm-text);
}
.ogforum-modal__header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--ogm-border);
}
.ogforum-modal__header h2 { margin: 0; font-size: 1.1rem; font-weight: 700; }
.ogforum-modal__close {
    background: transparent; border: 0;
    width: 32px; height: 32px;
    font-size: 22px; line-height: 1;
    color: var(--ogm-text-muted);
    cursor: pointer; border-radius: 50%;
}
.ogforum-modal__close:hover { background: var(--ogm-bg-soft); color: var(--ogm-text); }
.ogforum-modal__body { padding: 18px 22px 22px; }

.ogforum-report-form__reasons {
    border: 0;
    padding: 0;
    margin: 14px 0 4px;
    display: flex; flex-direction: column;
    gap: 4px;
}
.ogforum-report-form__reasons legend {
    font-weight: 600; font-size: .95rem;
    margin-bottom: 6px;
    padding: 0;
}
.ogforum-report-form__radio {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .12s;
}
.ogforum-report-form__radio:hover { background: var(--ogm-bg-soft); }
.ogforum-report-form__radio input { margin: 0; accent-color: var(--ogm-accent); }
.ogforum-report-form__radio input:checked + span { color: var(--ogm-accent); font-weight: 600; }

.ogforum-report-form__details {
    display: block;
    margin-top: 14px;
}
.ogforum-report-form__details > span {
    display: block;
    font-weight: 600; font-size: .92rem;
    margin-bottom: 6px;
}
.ogforum-report-form__details textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--ogm-border);
    border-radius: 10px;
    background: var(--ogm-bg);
    color: var(--ogm-text);
    font: inherit;
    resize: vertical;
    min-height: 80px;
}
.ogforum-report-form__details textarea:focus {
    outline: none;
    border-color: var(--ogm-accent);
}
.ogforum-report-form__actions {
    display: flex; align-items: center; gap: 10px;
    margin-top: 16px;
}
.ogforum-report-form__actions > [data-report-status] { flex: 1 1 auto; }

/* ── Kebab (⋮) more-actions menu ──
   Sits in the reply/thread footer in place of inline Edit/Delete/Report
   buttons. Click toggles a small dropdown with the appropriate items
   (Edit + Delete for owners/mods, Report for everyone else). */
.ogforum-kebab {
    position: relative;
    display: inline-block;
}
.ogforum-kebab__btn {
    background: transparent;
    border: 0;
    color: var(--ogm-text-muted);
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 999px;
}
.ogforum-kebab__btn:hover,
.ogforum-kebab__btn[aria-expanded="true"] {
    background: var(--ogm-bg-soft);
    color: var(--ogm-text);
}
.ogforum-kebab__menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 160px;
    z-index: 50;
    background: var(--ogm-bg-elev);
    border: 1px solid var(--ogm-border);
    border-radius: 10px;
    box-shadow: var(--ogm-shadow-lg);
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ogforum-kebab__menu[hidden] { display: none; }
.ogforum-kebab__item {
    background: transparent;
    border: 0;
    cursor: pointer;
    text-align: left;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--ogm-text);
    font: inherit;
    font-size: .9rem;
    white-space: nowrap;
}
.ogforum-kebab__item:hover { background: var(--ogm-bg-soft); color: var(--ogm-accent); }
.ogforum-kebab__item--danger { color: var(--ogm-danger); }
.ogforum-kebab__item--danger:hover { color: var(--ogm-danger); background: rgba(181, 58, 58, .08); }

/* ── Inline edit form (reply + thread) ── */
.ogforum-edit-form {
    margin: 8px 0 4px;
    padding: 10px;
    background: var(--ogm-bg-soft);
    border: 1px solid var(--ogm-border);
    border-radius: 12px;
}
.ogforum-edit-form[hidden] { display: none; }
.ogforum-edit-form input[type="text"],
.ogforum-edit-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    border: 1px solid var(--ogm-border);
    border-radius: 10px;
    background: var(--ogm-bg);
    color: var(--ogm-text);
    font: inherit;
    margin-bottom: 6px;
}
.ogforum-edit-form input[type="text"]:focus,
.ogforum-edit-form textarea:focus {
    outline: none;
    border-color: var(--ogm-accent);
}
.ogforum-edit-form textarea { resize: vertical; min-height: 60px; }
.ogforum-edit-form__actions {
    display: flex; align-items: center; gap: 8px;
    margin-top: 6px;
}

/* ── Reply tree ── AION-style threading.
   Each reply is a flex row: [36px avatar] [gap 12px] [main].
   The "thread line" runs vertically through the avatar's CENTER column and
   curves over to each nested child's avatar with a rounded L-connector. The
   line ORIGINATES at the parent avatar (not the reactions row) and traces
   the reply chain visually. No row borders — just soft whitespace. */
.ogforum-thread__replies {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--ogm-border);
}
.ogforum-reply-tree {
    list-style: none;
    padding: 0; margin: 0;
}
.ogforum-reply {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    position: relative;
}
.ogforum-reply + .ogforum-reply { border-top: 0; } /* no row separator — replies are visually grouped by spacing + thread line */
.ogforum-reply > .ogforum-avatar,
.ogforum-reply > .ogforum-avatar--sm {
    flex: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 1;                      /* sits above the thread line */
}
.ogforum-reply__main { flex: 1 1 auto; min-width: 0; }
.ogforum-reply__body { line-height: 1.55; word-wrap: break-word; color: var(--ogm-text); font-size: .95rem; }
.ogforum-reply__body p { margin: 0 0 .5em; }
.ogforum-reply__footer { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.ogforum-byline { margin-bottom: 4px; }

/* ── Vertical thread line — lives INSIDE the nested children container.
   This guarantees the line can never extend past the parent reply into a
   sibling top-level reply. The line height is JS-set via --line-stop so it
   ends exactly at the LAST child's avatar mid-height (no dangling tail). */
.ogforum-reply-list--nested {
    list-style: none;
    margin: 8px 0 0 0;
    padding: 0;
    border-left: 0;
    position: relative;
}
.ogforum-reply-list--nested::before {
    content: '';
    position: absolute;
    left: -31px;          /* aligns with parent avatar's vertical center */
    top: 0;
    height: var(--line-stop, calc(100% - 22px));
    width: 2px;
    background: var(--ogm-border);
    border-radius: 1px;
}
.ogforum-reply-list--nested > .ogforum-reply {
    padding: 10px 0 10px 28px;       /* room on the left for the curve */
    margin-left: 0;
}

/* ── The L-curve from parent line column over to this child's avatar.
   Geometry driven by JS-measured CSS variables on this child's li:
       --curve-left   = x of parent line column in child-local coords (negative)
       --curve-top    = y where the curve segment starts (small negative, so it
                        overlaps the parent line for a continuous visual)
       --curve-width  = horizontal distance from parent line column to the
                        child avatar's LEFT EDGE (so the line TOUCHES the avatar)
       --curve-height = vertical distance from curve top to the child avatar's
                        MID-HEIGHT (where the circle is widest, so end-of-line
                        lands ON the circle's edge with no visual gap)
   Sensible defaults baked in for the first paint before JS runs. */
.ogforum-reply-list--nested > .ogforum-reply::before {
    content: '';
    position: absolute;
    left:   var(--curve-left,  -31px);
    top:    var(--curve-top,   -10px);
    width:  var(--curve-width,  59px);
    height: var(--curve-height, 38px);
    border-left:   2px solid var(--ogm-border);
    border-bottom: 2px solid var(--ogm-border);
    border-bottom-left-radius: 14px;
}

/* Mobile: tighter indent so threads don't run off-screen. JS measures live
   layout, so the only adjustment needed is the padding (the JS reads from it). */
@media (max-width: 600px) {
    .ogforum-reply-list--nested > .ogforum-reply { padding-left: 22px; }
    .ogforum-reply-list--nested > .ogforum-reply::before {
        border-bottom-left-radius: 12px;
    }
}

/* ── Forms ──────────────────────────────────────────────────────────── */
.ogforum-form, .ogforum-reply-form {
    background: var(--ogm-bg-elev);
    border: 1px solid var(--ogm-border);
    border-radius: var(--ogm-radius-lg);
    padding: 24px;
    margin: 24px 0;
}
.ogforum-label { display: block; font-weight: 600; margin: 14px 0 6px; color: var(--ogm-text); }
.ogforum-form input[type="text"],
.ogforum-form input[type="search"],
.ogforum-form select,
.ogforum-form textarea,
.ogforum-reply-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--ogm-border);
    border-radius: var(--ogm-radius);
    background: var(--ogm-bg);
    color: var(--ogm-text);
    font: inherit;
    box-sizing: border-box;
}
.ogforum-form textarea, .ogforum-reply-form textarea { resize: vertical; min-height: 120px; }
.ogforum-form__actions, .ogforum-reply-form .ogforum-form__actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; }

/* ── Members table ──────────────────────────────────────────────────── */
.ogforum-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--ogm-bg-elev);
    border: 1px solid var(--ogm-border);
    border-radius: var(--ogm-radius-lg);
    overflow: hidden;
    margin: 12px 0;
}
.ogforum-table th, .ogforum-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--ogm-border);
    vertical-align: middle;
}
.ogforum-table tr:last-child td { border-bottom: none; }
.ogforum-table th { background: var(--ogm-bg-soft); font-weight: 700; }

/* ── Pager ──────────────────────────────────────────────────────────── */
.ogforum-pager {
    display: flex; justify-content: center; align-items: center; gap: 14px;
    margin: 24px 0;
    color: var(--ogm-text-muted);
}
.ogforum-pager a { color: var(--ogm-accent); font-weight: 600; }

/* ── Notifications ──────────────────────────────────────────────────── */
.ogforum-notif-list {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 6px;
}
.ogforum-notif {
    background: var(--ogm-bg-elev);
    border: 1px solid var(--ogm-border);
    border-radius: var(--ogm-radius);
    padding: 0;
}
.ogforum-notif.is-unread { background: var(--ogm-bg-soft); border-color: var(--ogm-accent); }
.ogforum-notif a {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    color: var(--ogm-text);
}
.ogforum-notif a:hover { text-decoration: none; }

/* ── Button compat — match OGM .ogm-btn if theme tokens are present ── */
.ogforum-shell .ogm-btn--sm { padding: 4px 10px; font-size: .85rem; }
.ogforum-shell .ogm-btn--lg { padding: 12px 22px; font-size: 1rem; font-weight: 700; }

/* ── Multi-emoji reaction picker ──
   Default: HIDDEN. Shows on hover (desktop with real pointer) or when JS adds
   .is-open (mobile long-press). NEVER use the [hidden] attribute alone here —
   `display: flex` would override it. Class-driven + media-query is robust. */
.ogforum-react-wrap {
    position: relative;
    display: inline-block;
}
.ogforum-react__emoji {
    font-size: 1.1rem;
    margin-right: 2px;
}
.ogforum-react--sm { padding: 4px 10px; font-size: .85rem; }
.ogforum-react-picker {
    /* hidden by default — show via :hover (desktop) or .is-open (mobile) below */
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
    background: var(--ogm-bg-elev);
    border: 1px solid var(--ogm-border-strong);
    border-radius: var(--ogm-radius-lg);
    box-shadow: var(--ogm-shadow-lg);
    z-index: 1100;             /* above OGM modals + Leaflet */
    width: 280px;              /* fixed width so 17 emojis wrap into 2 rows, not a vertical column */
    max-width: 90vw;
}
/* Bridge gap between heart button and picker so cursor can travel without closing */
.ogforum-react-picker::before {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 100%;
    height: 10px;
}
.ogforum-react-picker__btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--ogm-radius);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 4px 6px;
    flex: 0 0 auto;
    transition: background .12s, transform .08s;
}
.ogforum-react-picker__btn:hover {
    background: var(--ogm-bg-soft);
    transform: scale(1.18);
}

/* Show on hover only for devices with a real hover-capable pointer (desktop).
   This prevents touch devices from triggering "hover" on tap, which would
   reveal the picker on a quick tap instead of the intended quick-like action. */
@media (hover: hover) and (pointer: fine) {
    .ogforum-react-wrap:hover .ogforum-react-picker,
    .ogforum-react-wrap:focus-within .ogforum-react-picker {
        display: flex;
    }
}
/* Mobile (or JS-forced open via long-press): explicit class wins */
.ogforum-react-picker.is-open {
    display: flex;
}

/* ── Composer ── AION-style sleek pill input.
   Layout:
       ┌──────────────────────────────────── 😊 🖼 ┐  [Reply] [Cancel]
       └────────────────────────────────────────────┘
   The textarea is a rounded pill; emoji + image icons sit absolutely INSIDE
   the pill on the right; Reply/Cancel buttons sit OUTSIDE the pill, inline.
   Textarea auto-grows up to 6 lines (JS handles height). */
.ogforum-composer {
    margin-top: 10px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}
.ogforum-composer--top {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--ogm-border);
}
.ogforum-composer__row {
    display: flex;
    align-items: center;             /* button + icons + pill all vertically centered */
    gap: 8px;
}
.ogforum-composer__field {
    flex: 1 1 auto;
    position: relative;
    display: block;
    min-width: 0;
}
.ogforum-composer textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 80px 10px 18px;   /* right padding leaves room for icons */
    border: 1px solid var(--ogm-border);
    border-radius: 22px;
    background: var(--ogm-bg);
    color: var(--ogm-text);
    font: inherit;
    font-size: .95rem;
    line-height: 1.4;
    resize: none;
    min-height: 42px;
    max-height: 200px;
    overflow-y: auto;
    transition: border-color .12s, box-shadow .12s;
}
.ogforum-composer textarea::placeholder { color: var(--ogm-text-muted); }
.ogforum-composer textarea:focus {
    outline: none;
    border-color: var(--ogm-accent);
    box-shadow: 0 0 0 3px rgba(47, 122, 58, .12);
}

/* Icons floated inside the pill on the right edge — vertically centered */
.ogforum-composer__icons {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    gap: 2px;
}
.ogforum-composer__icon {
    background: transparent;
    border: 0;
    width: 30px; height: 30px;
    padding: 0;
    border-radius: 50%;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    color: var(--ogm-text-muted);
    transition: background .12s, color .12s;
}
.ogforum-composer__icon:hover { background: var(--ogm-bg-soft); color: var(--ogm-accent); }

/* Submit + cancel buttons live OUTSIDE the pill, inline */
.ogforum-composer__submit { flex: none; }
.ogforum-composer [data-reply-cancel] { flex: none; }

/* Status line — only shown when uploading / error */
.ogforum-composer__status {
    display: block;
    margin-top: 6px;
    margin-left: 18px;
    font-size: .8rem;
    min-height: 1em;
}

/* Image preview sits ABOVE the input row */
.ogforum-composer__preview {
    position: relative;
    display: inline-block;
    margin-bottom: 8px;
    max-width: 220px;
}
.ogforum-composer__preview[hidden] { display: none; }
.ogforum-composer__preview img {
    display: block;
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--ogm-border);
}
.ogforum-composer__preview-remove {
    position: absolute;
    top: 4px; right: 4px;
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 0;
    background: rgba(0,0,0,.65);
    color: #fff;
    cursor: pointer;
    line-height: 20px;
    font-size: 16px;
    text-align: center;
    padding: 0;
}
.ogforum-composer__preview-remove:hover { background: rgba(0,0,0,.85); }

/* Emoji picker popup (positioned by JS, fixed-grid layout) */
.ogforum-composer-emoji-pop {
    position: absolute;
    z-index: 1100;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    padding: 8px;
    background: var(--ogm-bg-elev);
    border: 1px solid var(--ogm-border-strong);
    border-radius: var(--ogm-radius-lg);
    box-shadow: var(--ogm-shadow-lg);
    width: 320px;
    max-width: calc(100vw - 16px);
}
.ogforum-composer-emoji-pop[hidden] { display: none; }
.ogforum-composer-emoji-pop__btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--ogm-radius);
    padding: 4px;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    transition: background .08s, transform .08s;
}
.ogforum-composer-emoji-pop__btn:hover {
    background: var(--ogm-bg-soft);
    transform: scale(1.18);
}

/* Image attached to a posted reply */
.ogforum-reply__image {
    display: block;
    margin: 8px 0;
    max-width: 360px;
}
.ogforum-reply__image img {
    width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: cover;
    border-radius: var(--ogm-radius);
    border: 1px solid var(--ogm-border);
    display: block;
}

/* Legacy class kept so old markup (if any cached) still styles sensibly */
.ogforum-inline-reply { display: none; }

/* ── Group manage: image upload previews ── */
.ogforum-imgfields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 14px;
}
@media (max-width: 600px) {
    .ogforum-imgfields { grid-template-columns: 1fr; }
}
.ogforum-imgfield__current { margin: 6px 0 8px; }
.ogforum-imgfield__preview {
    display: block;
    background: var(--ogm-bg-soft);
    border: 1px solid var(--ogm-border);
    border-radius: var(--ogm-radius);
    object-fit: cover;
}
.ogforum-imgfield__preview--avatar { width: 96px;  height: 96px;  border-radius: 50%; }
.ogforum-imgfield__preview--cover  { width: 100%;  height: 120px; }
.ogforum-imgfield input[type="file"] {
    display: block;
    width: 100%;
    margin-top: 4px;
    font: inherit;
}

/* ─────────────────────────────────────────────────────────────────────
   Reply/comment modal (native <dialog> element — auto-centered, escapes
   any parent stacking/transform context, native ::backdrop). The dialog
   is INVISIBLE until showModal() opens it.
   ───────────────────────────────────────────────────────────────────── */
.ogforum-modal {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--ogm-text);
    max-width: min(560px, calc(100vw - 32px));
    width: 100%;
    max-height: 90vh;
    overflow: visible;
}
.ogforum-modal::backdrop {
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(2px);
}
.ogforum-modal__panel {
    background: var(--ogm-bg-elev);
    color: var(--ogm-text);
    border-radius: 14px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
    margin: 0;
}
.ogforum-modal__head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--ogm-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ogforum-modal__head h3 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.ogforum-modal__close {
    border: 0; background: transparent;
    font-size: 1.6rem; line-height: 1;
    color: var(--ogm-text-muted);
    cursor: pointer; padding: 0 6px;
}
.ogforum-modal__close:hover { color: var(--ogm-text); }

.ogforum-modal__body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-height: 0;
    overflow: auto;
}
.ogforum-modal__body textarea {
    width: 100%;
    padding: 12px;
    font: inherit;
    font-size: 1rem;
    line-height: 1.5;
    border: 1px solid var(--ogm-border);
    border-radius: 8px;
    background: var(--ogm-bg);
    color: var(--ogm-text);
    resize: vertical;
    min-height: 140px;
    box-sizing: border-box;
}
.ogforum-modal__body textarea:focus {
    outline: none;
    border-color: var(--ogm-accent);
    box-shadow: 0 0 0 3px rgba(var(--ogm-accent-rgb), .18);
}
.ogforum-modal__body .ogforum-composer__preview {
    position: relative;
    max-width: 240px;
}
.ogforum-modal__body .ogforum-composer__preview img {
    width: 100%; border-radius: 8px; display: block;
}
.ogforum-modal__body .ogforum-composer__preview-remove {
    position: absolute; top: 4px; right: 4px;
    width: 24px; height: 24px; border-radius: 50%;
    border: 0; background: rgba(0,0,0,.6); color: #fff;
    font-size: 1rem; line-height: 1; cursor: pointer;
}

.ogforum-modal__foot {
    padding: 12px 18px;
    border-top: 1px solid var(--ogm-border);
    display: flex;
    gap: 8px;
    align-items: center;
}
.ogforum-modal__spacer { flex: 1; }
.ogforum-modal__iconbtn {
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--ogm-border);
    background: var(--ogm-bg);
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
}
.ogforum-modal__iconbtn:hover { border-color: var(--ogm-accent); }

/* Primary "Comment" trigger in the thread footer — matches the existing
   .ogforum-reply-link style on replies but with a bit more weight so it
   reads as the main "post your comment" CTA. */
.ogforum-reply-link--primary {
    background: rgba(var(--ogm-accent-rgb), .12);
    color: var(--ogm-accent);
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 8px;
    border: 0;
    cursor: pointer;
}
.ogforum-reply-link--primary:hover { background: rgba(var(--ogm-accent-rgb), .22); }

@media (max-width: 600px) {
    .ogforum-modal { max-width: 100%; max-height: 92vh; margin-bottom: 0; }
    .ogforum-modal[open] {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0 auto;
    }
    .ogforum-modal__panel {
        border-radius: 14px 14px 0 0;
    }
}
