/* ============================================================
   Groups pages (list, group page with room, create).
   Only the design tokens of variables.css; sale-type chips reuse the
   `.badge-fixed/.badge-negotiable/.badge-auction/.badge-donation`
   classes of components.css.
   ============================================================ */

.groups-page {
    max-width: 760px;
    margin: 0 auto;
    padding: var(--sp-md) 0 calc(var(--sp-3xl) + 100px);
}
@media (min-width: 769px) {
    .groups-page { padding-bottom: var(--sp-3xl); }
}

.groups-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: var(--sp-sm) 0 var(--sp-md);
    flex-wrap: wrap;
}
.groups-head__title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.groups-lead {
    font-size: 15px;
    color: var(--text-secondary-aa);
    margin: -6px 0 var(--sp-md);
    line-height: 1.45;
}

.groups-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: var(--r-pill);
    border: none;
    font-family: var(--font-system);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    background: var(--b-primary-fill-aa);
    color: #fff;
    transition: background var(--t-fast), opacity var(--t-fast);
}
.groups-btn:hover { background: var(--b-primary-hover); color: #fff; }
.groups-btn:disabled { opacity: 0.5; cursor: default; }
.groups-btn--secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--separator);
}
.groups-btn--secondary:hover { background: var(--system-gray-5); color: var(--text-primary); }
.groups-btn--danger { background: var(--b-danger-fill-aa); }
.groups-btn--danger:hover { background: var(--b-danger-fill-aa); opacity: 0.9; }
.groups-btn--small { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.groups-btn:focus-visible,
.groups-tab:focus-visible,
.groups-row:focus-visible,
.gmsg__menu-btn:focus-visible,
.gcard:focus-visible {
    outline: 3px solid var(--b-primary);
    outline-offset: 2px;
}

/* Search */
.groups-search {
    display: flex;
    gap: 8px;
    margin-bottom: var(--sp-lg);
}
.groups-search__input {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--separator-opaque);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-system);
    font-size: 16px;
}
.groups-search__input:focus { border-color: var(--b-primary); outline: 2px solid var(--b-primary); outline-offset: 0; }

.groups-section { margin-bottom: var(--sp-xl); }
.groups-section__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary-aa);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 8px;
}

/* Group rows */
.groups-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--separator);
    border-radius: var(--r-lg);
    overflow: hidden;
}
.groups-list > li + li { border-top: 1px solid var(--separator); }
/* Groups page: each group is its own squircle card, like the Profile
   rows on iOS and Android. */
.groups-list--cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: none;
    border: 0;
    border-radius: 0;
    overflow: visible;
}
.groups-list--cards > li + li { border-top: 0; }
.groups-list--cards .groups-row {
    background: var(--bg-tertiary);
    border: 1px solid var(--separator);
    border-radius: var(--r-xl);
    padding: 14px 16px;
}
@supports (corner-shape: squircle) {
    .groups-list--cards .groups-row { border-radius: 34px; corner-shape: squircle; }
}
.groups-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: var(--text-primary);
    text-decoration: none;
    min-height: 64px;
}
.groups-row:hover { background: var(--bg-secondary); }
.groups-avatar {
    flex: none;
    width: 44px;
    height: 44px;
    background: var(--b-primary-fill-aa);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}
.groups-avatar--lg { width: 64px; height: 64px; font-size: 28px; }
.groups-avatar--xl { width: 88px; height: 88px; font-size: 36px; }
.groups-avatar--sm { width: 36px; height: 36px; font-size: 15px; }
/* The group photo fills the tile; the shape comes from .avatar-shape. */
.groups-avatar { overflow: hidden; }
.groups-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.groups-btn--destructive { color: var(--text-danger); }
.groups-btn--destructive:hover { color: var(--text-danger); }
/* Edit group / create group: the photo on top of the form. */
.gphoto { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.gphoto__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.gphoto [hidden] { display: none !important; }
.groups-row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.groups-row__name {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.groups-row__meta {
    font-size: 13px;
    color: var(--text-secondary-aa);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.groups-row__side { flex: none; display: flex; align-items: center; gap: 6px; }
.groups-unread {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 11px;
    background: var(--b-danger-fill-aa);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
.groups-pill {
    display: inline-block;
    padding: 3px 9px;
    border-radius: var(--r-pill);
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-secondary);
    color: var(--text-secondary-aa);
    border: 1px solid var(--separator);
    white-space: nowrap;
}
.groups-pill--pending { background: rgba(255, 149, 0, 0.14); color: var(--text-warning); border-color: transparent; }
.groups-pill--rejected,
.groups-pill--closed { background: rgba(255, 59, 48, 0.12); color: var(--text-danger); border-color: transparent; }
.groups-pill--member { background: rgba(52, 199, 89, 0.14); color: var(--text-success); border-color: transparent; }

.groups-empty {
    text-align: center;
    padding: var(--sp-xl) var(--sp-md);
    color: var(--text-secondary-aa);
    background: var(--bg-tertiary);
    border: 1px solid var(--separator);
    border-radius: var(--r-lg);
}
.groups-empty__title { font-weight: 700; color: var(--text-primary); margin: 0 0 6px; font-size: 16px; }
.groups-empty p { margin: 0 0 12px; }

.groups-pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: var(--sp-md);
    font-size: 14px;
    color: var(--text-secondary-aa);
}

.groups-hint {
    font-size: 14px;
    color: var(--text-secondary-aa);
    margin: 0 0 var(--sp-md);
}
.groups-hint a { color: var(--b-primary-text-aa); font-weight: 600; }

/* Group page header */
.group-hero {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: var(--sp-md);
}
.group-hero__text { flex: 1; min-width: 0; }
.group-hero__name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
    overflow-wrap: anywhere;
}
.group-hero__meta { font-size: 14px; color: var(--text-secondary-aa); margin: 0; }
.group-hero__desc {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0 0 var(--sp-md);
    white-space: pre-line;
    overflow-wrap: anywhere;
}
.group-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: var(--sp-md); }

.group-notice {
    border-radius: var(--r-lg);
    padding: 14px 16px;
    margin-bottom: var(--sp-md);
    font-size: 15px;
    line-height: 1.45;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--separator);
}
.group-notice strong { display: block; margin-bottom: 2px; }
.group-notice--pending { background: rgba(255, 149, 0, 0.14); border-color: rgba(255, 149, 0, 0.35); }
.group-notice--rejected,
.group-notice--closed { background: rgba(255, 59, 48, 0.12); border-color: rgba(255, 59, 48, 0.3); }
.group-notice p { margin: 4px 0 0; }

/* Rules */
.group-rules {
    background: var(--bg-tertiary);
    border: 1px solid var(--separator);
    border-radius: var(--r-lg);
    padding: 4px 16px;
    margin-bottom: var(--sp-md);
}
.group-rules > summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    padding: 12px 0;
    color: var(--text-primary);
    min-height: 44px;
    list-style-position: inside;
}
.group-rules__list { margin: 0 0 12px; padding-inline-start: 22px; }
.group-rules__list li { font-size: 14px; line-height: 1.5; margin-bottom: 6px; color: var(--text-primary); }
.group-rules__extra-title { font-size: 14px; font-weight: 600; margin: 8px 0 4px; }
.group-rules__extra { font-size: 14px; line-height: 1.5; margin: 0 0 12px; white-space: pre-line; overflow-wrap: anywhere; }

/* Tabs */
.groups-tabs {
    display: flex;
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 2px;
    margin-bottom: var(--sp-md);
}
.groups-tab {
    flex: 1;
    min-height: 40px;
    padding: 7px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-family: var(--font-system);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary-aa);
    cursor: pointer;
}
.groups-tab[aria-selected="true"] {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.08);
}
.groups-tab__badge { margin-inline-start: 6px; }

/* Room */
.groom {
    background: var(--bg-secondary);
    border: 1px solid var(--separator);
    border-radius: var(--r-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.groom__scroll {
    height: min(62vh, 640px);
    height: min(62dvh, 640px);
    min-height: 320px;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overscroll-behavior: contain;
}
.groom__older { align-self: center; }
.groom__status { text-align: center; font-size: 14px; color: var(--text-secondary-aa); padding: 24px 8px; }

.gmsg { display: flex; gap: 8px; align-items: flex-start; max-width: 100%; }
.gmsg--mine { flex-direction: row-reverse; }
.gmsg__avatar {
    flex: none;
    width: 32px;
    height: 32px;
    background: var(--system-gray-4);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.gmsg__avatar img { width: 100%; height: 100%; object-fit: cover; }
.gmsg__body { min-width: 0; max-width: min(78%, 460px); display: flex; flex-direction: column; gap: 4px; }
.gmsg--mine .gmsg__body { align-items: flex-end; }
.gmsg__head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary-aa); flex-wrap: wrap; }
.gmsg__name { font-weight: 600; color: var(--text-primary); }
.gmsg__role { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: var(--r-pill); background: var(--b-primary-fill-aa); color: #fff; }
.gmsg__bubble {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 16px;
    padding: 8px 12px;
    font-size: 15px;
    line-height: 1.4;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    box-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.08);
}
.gmsg--mine .gmsg__bubble { background: var(--b-primary-fill-aa); color: #fff; }
.gmsg__bubble a { color: inherit; text-decoration: underline; }
.gmsg__placeholder {
    font-size: 14px;
    font-style: italic;
    color: var(--text-secondary-aa);
    background: transparent;
    border: 1px dashed var(--separator-opaque);
    border-radius: 14px;
    padding: 6px 12px;
}
.gmsg--review .gmsg__bubble,
.gmsg--review .gcard { opacity: 0.6; }
.gmsg__review-label { font-size: 12px; font-weight: 600; color: var(--text-warning); }
.gmsg__scam {
    font-size: 13px;
    color: var(--text-danger);
    background: rgba(255, 59, 48, 0.12);
    border-radius: 10px;
    padding: 6px 10px;
}
.gmsg__reports { font-size: 12px; font-weight: 600; color: var(--text-danger); }
.gmsg__menu { position: relative; align-self: center; }
.gmsg__menu-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary-aa);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}
.gmsg__menu-btn:hover { background: var(--system-gray-5); }

/* Listing card inside a message / showcase */
.gcard {
    display: flex;
    gap: 10px;
    align-items: stretch;
    width: min(320px, 100%);
    background: var(--bg-primary);
    border: 1px solid var(--separator);
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
}
.gcard:hover { border-color: var(--b-primary); }
.gcard__img {
    flex: none;
    width: 96px;
    height: 96px;
    object-fit: cover;
    background: var(--bg-secondary);
}
.gcard__img--empty { display: flex; align-items: center; justify-content: center; background: var(--system-gray-6); }
.gcard__info { flex: 1; min-width: 0; padding: 8px 10px 8px 0; display: flex; flex-direction: column; gap: 4px; }
.gcard__title { font-size: 14px; font-weight: 600; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.gcard__price { font-size: 15px; font-weight: 700; }
.gcard__chip {
    display: inline-block;
    width: fit-content;
    padding: 3px 8px;
    border-radius: var(--r-pill);
    font-size: 11px;
    font-weight: 600;
}
.gcard__gone { font-size: 12px; font-weight: 600; color: var(--text-danger); }
.gcard--gone .gcard__img { filter: grayscale(1); opacity: 0.6; }

.groups-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
}
.groups-showcase .gcard { width: 100%; }

/* Composer */
.gcomposer {
    border-top: 1px solid var(--separator);
    background: var(--bg-primary);
    padding: 10px;
}
.gcomposer__attached {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}
.gcomposer__attached .gcard { flex: 1; }
.gcomposer__row { display: flex; gap: 8px; align-items: flex-end; }
.gcomposer__share {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--separator-opaque);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.gcomposer__share:hover { background: var(--system-gray-5); }
.gcomposer__field {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    max-height: 140px;
    resize: none;
    padding: 10px 14px;
    border-radius: 22px;
    border: 1px solid var(--separator-opaque);
    font-family: var(--font-system);
    font-size: 16px;
    line-height: 1.35;
    background: var(--bg-primary);
    color: var(--text-primary);
}
.gcomposer__field:focus { border-color: var(--b-primary); outline: 2px solid var(--b-primary); outline-offset: 0; }
.gcomposer__send { flex: none; }
.gcomposer__error {
    margin: 8px 2px 0;
    font-size: 14px;
    color: var(--text-danger);
}
.gcomposer__blocked {
    padding: 12px;
    border-top: 1px solid var(--separator);
    background: var(--bg-primary);
    font-size: 14px;
    color: var(--text-secondary-aa);
    text-align: center;
}
.gcomposer__blocked a,
.gcomposer__blocked button { margin-top: 8px; }

/* Members */
.gmember { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.gmember + .gmember { border-top: 1px solid var(--separator); }
.gmember__text { flex: 1; min-width: 0; }
.gmember__name { font-weight: 600; font-size: 15px; }
.gmember__meta { font-size: 13px; color: var(--text-secondary-aa); }

/* Dialogs (rules acceptance, report reason, listing picker) */
.gdialog {
    border: none;
    border-radius: 18px;
    padding: 0;
    width: min(480px, calc(100vw - 32px));
    max-height: calc(100dvh - 48px);
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin: auto;
}
.gdialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.gdialog__inner { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.gdialog__title { font-size: 19px; font-weight: 700; margin: 0; }
.gdialog__text { font-size: 15px; line-height: 1.45; margin: 0; color: var(--text-secondary-aa); }
.gdialog__actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.gdialog__choices { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow-y: auto; }
.gdialog__choice {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 8px;
    border-radius: 10px;
    font-size: 15px;
    cursor: pointer;
    min-height: 44px;
}
.gdialog__choice:hover { background: var(--bg-secondary); }
.gdialog__choice input { width: 18px; height: 18px; accent-color: var(--b-primary-fill-aa); }
.gdialog__picker { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow-y: auto; }
.gdialog__pick {
    border: none;
    background: none;
    padding: 0;
    text-align: start;
    cursor: pointer;
    font: inherit;
    border-radius: 14px;
}
.gdialog__pick .gcard { width: 100%; }
.gdialog__pick:hover .gcard { border-color: var(--b-primary); }
/* The list scrolls, so an outer ring would be cut off: draw it inside the card. */
.gdialog__pick:focus-visible { outline: none; }
.gdialog__pick:focus-visible .gcard { border-color: var(--b-primary); box-shadow: inset 0 0 0 2px var(--b-primary); }
.gdialog__title:focus { outline: none; }

.gmenu {
    position: absolute;
    z-index: 30;
    inset-inline-end: 0;
    top: 34px;
    min-width: 220px;
    background: var(--bg-primary);
    border: 1px solid var(--separator);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    padding: 4px;
    display: flex;
    flex-direction: column;
}
.gmsg--mine .gmenu { inset-inline-end: auto; inset-inline-start: 0; }
.gmenu__item {
    border: none;
    background: none;
    text-align: start;
    padding: 10px 12px;
    border-radius: 8px;
    font-family: var(--font-system);
    font-size: 15px;
    color: var(--text-primary);
    cursor: pointer;
    min-height: 40px;
}
.gmenu__item:hover,
.gmenu__item:focus-visible { background: var(--bg-secondary); outline: none; }
.gmenu__item--danger { color: var(--text-danger); }

.gtoast {
    position: fixed;
    left: 50%;
    bottom: 100px;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 12px 18px;
    border-radius: 22px;
    font-size: 14px;
    font-weight: 600;
    z-index: 2000;
    max-width: calc(100vw - 32px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.gtoast--error { background: var(--b-danger-fill-aa); color: #fff; }

/* Create */
.gcheck { list-style: none; margin: 0 0 var(--sp-md); padding: 0; background: var(--bg-tertiary); border: 1px solid var(--separator); border-radius: var(--r-lg); }
.gcheck li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; font-size: 15px; line-height: 1.4; }
.gcheck li + li { border-top: 1px solid var(--separator); }
.gcheck__icon { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 700; }
.gcheck__icon--met { background: var(--b-success-fill-aa); }
.gcheck__icon--unmet { background: #6B6B70; }
.gcheck__now { display: block; font-size: 13px; color: var(--text-secondary-aa); }
.gcheck__status { font-size: 13px; font-weight: 600; }
.gcheck__status--met { color: var(--text-success); }
.gcheck__status--unmet { color: var(--text-secondary-aa); }

.gform { display: flex; flex-direction: column; gap: 14px; }
.gform__field { display: flex; flex-direction: column; gap: 6px; }
.gform__label { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.gform__help { font-size: 13px; color: var(--text-secondary-aa); }
.gform__input {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--separator-opaque);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-system);
    font-size: 16px;
    width: 100%;
}
.gform__input:focus { border-color: var(--b-primary); outline: 2px solid var(--b-primary); outline-offset: 0; }
textarea.gform__input { min-height: 96px; resize: vertical; }
.gform__row { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 600px) {
    .gform__row { grid-template-columns: 1fr 1fr; }
}
.gform__error { font-size: 14px; color: var(--text-danger); margin: 0; }
.gform__similar {
    background: rgba(255, 149, 0, 0.14);
    border: 1px solid rgba(255, 149, 0, 0.35);
    border-radius: var(--r-lg);
    padding: 14px;
}
.gform__similar h2 { font-size: 16px; margin: 0 0 4px; }
.gform__similar p { font-size: 14px; margin: 0 0 10px; color: var(--text-primary); }
.gform__similar .groups-list { margin-bottom: 10px; }
.gform__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.sr-only-focusable:not(:focus) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.gdialog__fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.greports { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--bg-secondary); border: 1px solid var(--separator); border-radius: var(--r-lg); }
.greports:empty { display: none; }
.gmember__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.gcard-link { display: block; width: min(320px, 100%); text-decoration: none; color: inherit; border-radius: 14px; }
.gcard-link .gcard { width: 100%; }
.gcard-link:hover .gcard { border-color: var(--b-primary); }
.gcard-link:focus-visible { outline: 3px solid var(--b-primary); outline-offset: 2px; }
.groups-showcase .gcard-link { width: 100%; }

/* `hidden` must win over the display of buttons and flex boxes. */
.groups-page [hidden],
.gdialog [hidden] { display: none !important; }
.groups-row__status { margin-top: 2px; }
/* Member rows: actions wrap on their own line under the name. */
.gmember { flex-wrap: wrap; }
.gmember__actions { flex-basis: 100%; padding-inline-start: 42px; }
.gmember__actions .groups-btn--small { min-height: 32px; padding: 4px 12px; font-size: 13px; }

/* "Share in your groups" (after publishing and on my own listing) */
.gshare { display: flex; flex-direction: column; gap: 12px; }
/* On the listing form the panel is outside .groups-page and .gdialog. */
.gshare [hidden] { display: none !important; }
.gshare__form { display: flex; flex-direction: column; gap: 10px; }
.gshare__list {
    display: flex;
    flex-direction: column;
    max-height: min(46vh, 420px);
    overflow-y: auto;
    background: var(--bg-tertiary);
    border: 1px solid var(--separator);
    border-radius: var(--r-lg);
}
.gshare__row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    min-height: 44px;
    cursor: pointer;
}
.gshare__row + .gshare__row { border-top: 1px solid var(--separator); }
.gshare__row input {
    flex: none;
    width: 20px;
    height: 20px;
    margin: 2px 0 0;
    accent-color: var(--b-primary-fill-aa);
}
.gshare__row--off { cursor: default; }
.gshare__row--off .gshare__name { color: var(--text-secondary-aa); }
.gshare__info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gshare__name { font-size: 15px; font-weight: 600; color: var(--text-primary); overflow-wrap: anywhere; }
.gshare__meta { font-size: 13px; color: var(--text-secondary-aa); }
.gshare__note { font-size: 13px; line-height: 1.4; color: var(--text-secondary-aa); }
.gshare__note--ok { font-weight: 600; color: var(--text-success); }
.gshare__note--error { color: var(--text-danger); }
textarea.gshare__text { min-height: 64px; }
.gshare__summary { font-size: 15px; font-weight: 600; color: var(--text-primary); margin: 0; }
.gshare__summary:focus { outline: none; }
.gshare__retry { display: flex; justify-content: center; }
.gshare .groom__status { padding: 16px 8px; }

/* Replies: the quote above a message and above the composer */
.gquote {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 100%;
    padding: 6px 10px;
    border: none;
    border-inline-start: 3px solid var(--b-primary);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-system);
    font-size: 13px;
    line-height: 1.35;
    text-align: start;
}
button.gquote { cursor: pointer; }
button.gquote:hover { background: var(--system-gray-5); }
.gquote--gone { border-inline-start-color: var(--separator); color: var(--text-secondary-aa); font-style: italic; }
.gquote__name { font-weight: 600; }
.gquote__text {
    color: var(--text-secondary-aa);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow-wrap: anywhere;
}
.gcomposer__reply {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 6px 6px 6px 10px;
    border-inline-start: 3px solid var(--b-primary);
    border-radius: 8px;
    background: var(--bg-secondary);
    font-size: 13px;
    line-height: 1.35;
}
.gcomposer__reply[hidden] { display: none; }
.gcomposer__reply-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

/* A message someone was sent to (a quote, or a link with ?message=) */
.gmsg--flash { border-radius: 12px; animation: gmsg-flash 2.4s ease-out 1; }
@keyframes gmsg-flash {
    0%, 60% { background: var(--system-gray-5); box-shadow: 0 0 0 6px var(--system-gray-5); }
    100% { background: transparent; box-shadow: 0 0 0 6px transparent; }
}
@media (prefers-reduced-motion: reduce) {
    .gmsg--flash { animation-timing-function: step-end; }
}

/* The member's own notifications switch */
.gswitch { margin-bottom: var(--sp-md); }
.gswitch__row { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.gswitch__input {
    appearance: none;
    -webkit-appearance: none;
    flex: none;
    width: 51px;
    height: 31px;
    margin: 0;
    border-radius: 31px;
    background: #6B6B70;   /* off: same grey as an unmet requirement; 3:1 against the page */
    position: relative;
    cursor: pointer;
    transition: background var(--t-fast);
}
.gswitch__input::after {
    content: "";
    position: absolute;
    top: 2px;
    inset-inline-start: 2px;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform var(--t-fast);
}
.gswitch__input:checked { background: var(--b-primary-fill-aa); }
.gswitch__input:checked::after { transform: translateX(20px); }
[dir="rtl"] .gswitch__input:checked::after { transform: translateX(-20px); }
.gswitch__input:focus-visible { outline: 2px solid var(--b-primary); outline-offset: 2px; }
.gswitch__input[aria-busy="true"] { opacity: 0.6; }
.gswitch__label { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.gswitch__hint { font-size: 13px; color: var(--text-secondary-aa); margin: 2px 0 0; line-height: 1.4; }
@media (prefers-reduced-motion: reduce) {
    .gswitch__input, .gswitch__input::after { transition: none; }
}

/* Join requests (groups that approve each person) */
.groups-hint--status { margin: 0; align-self: center; }
textarea.gform__input--short { min-height: 64px; }
.gjoin-policy { border: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.gjoin-policy legend { margin-bottom: 4px; padding: 0; }
.gjoin-questions { display: flex; flex-direction: column; gap: 8px; }
.gjoin-questions .gform__label,
.gjoin-questions .gform__help { margin: 0; }
.greq-list { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; }
.greq {
    border: 1px solid var(--separator);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-primary);
}
.greq__head { display: flex; align-items: center; gap: 10px; }
.greq__who { flex: 1; min-width: 0; }
.greq__name { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.greq__meta { font-size: 13px; color: var(--text-secondary-aa); }
.greq__answers { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.greq__question { font-size: 13px; font-weight: 600; color: var(--text-secondary-aa); margin: 0; }
.greq__answer { font-size: 15px; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.greq__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
