/* ═══════════════════════════════════════════════════════════════
   Emma Community — pagina forum (lista prompt stile Reddit)
   Dipende da app.css: usa gli stessi design token e i componenti
   .bar / .footer / .modal / .store-toast già definiti.
   ═══════════════════════════════════════════════════════════════ */

/* La chat blocca lo scroll di pagina (overflow:hidden su body):
   qui la pagina è un documento lungo e deve scorrere. */
body.forum-body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

body.is-forum-modal-open {
    overflow: hidden;
}

/* utility: testo per screen reader, invisibile a schermo.
   app.css non la definisce, quindi vive qui. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.forum-app {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 10px 22px;
}

/* ── Barra: stessa del sito, ma sticky mentre si scorre ───────── */
.forum-body .bar {
    position: sticky;
    top: 8px;
    z-index: 40;
    margin: 12px 0 0;
}

/* il menu è fatto di link di navigazione, non di pulsanti */
a.bar__icon-btn {
    text-decoration: none;
    color: inherit;
}

/* ── Immagine di apertura ─────────────────────────────────────── */
.forum-hero {
    position: relative;
    margin-top: 14px;
    border-radius: 26px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .65);
    background: #0b1514;
    box-shadow: 0 24px 60px rgba(7, 33, 30, .12), inset 0 1px 0 rgba(255, 255, 255, .18);
}

/* velo sfumato: dà profondità all'immagine e tiene leggibile il testo */
.forum-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(180deg,
            rgba(4, 26, 24, 0) 34%,
            rgba(4, 26, 24, .38) 68%,
            rgba(4, 26, 24, .82) 100%);
}

.forum-hero__img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1772 / 820;
    min-height: 230px;
    object-fit: cover;
    object-position: center;
}

/* ── Intestazione sovrapposta all'immagine ────────────────────── */
.forum-hero__overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: clamp(14px, 2.2vw, 22px) clamp(16px, 2.6vw, 26px) clamp(16px, 2.4vw, 24px);
}

.forum-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
}

.forum-head__text {
    min-width: 0;
}

.forum-head__title {
    font-size: clamp(20px, 2.6vw, 27px);
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.12;
    color: #fff;
    /* ombra sfumata proiettata sull'immagine: alone largo + bordo nitido */
    text-shadow:
        0 12px 34px rgba(2, 20, 18, .70),
        0 3px 10px rgba(2, 20, 18, .50);
}

.forum-head__sub {
    margin-top: 4px;
    font-size: 12.5px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .90);
    /* la riga statistiche ("22 prompt · 186 caramelle · … · 8872 utenti")
       sta su una riga sola da desktop: il vincolo di larghezza la spezzava
       inutilmente. Sotto i 720px torna a capo, dove lo spazio non basta. */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow:
        0 10px 26px rgba(2, 20, 18, .75),
        0 1px 4px rgba(2, 20, 18, .55);
}

.forum-cta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: -.01em;
    white-space: nowrap;
    box-shadow: 0 12px 26px rgba(11, 146, 133, .24);
    transition: background .16s var(--ease-premium), transform .16s var(--ease-premium), box-shadow .16s var(--ease-premium);
}

.forum-cta:hover {
    background: var(--brand-dark);
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(11, 146, 133, .28);
}

.forum-cta:active { transform: translateY(0) scale(.985); }
.forum-cta svg { width: 14px; height: 14px; }

/* ── Toolbar: ordinamento + ricerca ───────────────────────────── */
.forum-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 14px 0 12px;
    padding: 6px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .78);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow-soft);
}

.sort-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
    padding: 2px;
    border-radius: 999px;
    background: rgba(11, 146, 133, .06);
}

/* tab Utenti: la ricerca è nascosta, la barra si stringe sui tab */
.forum-toolbar:has(.forum-search[hidden]) {
    width: fit-content;
}

.sort-tab {
    padding: 7px 13px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--text-2);
    white-space: nowrap;
    transition: background .15s var(--ease-premium), color .15s var(--ease-premium), box-shadow .15s var(--ease-premium);
}

.sort-tab:hover { color: var(--brand-dark); }

.sort-tab[aria-pressed="true"] {
    background: #fff;
    color: var(--brand-dark);
    box-shadow: 0 4px 14px rgba(7, 33, 30, .10);
}

/* Tab con sola icona (Salvati): niente testo, il nome resta in
   aria-label/title. Il selettore è doppio per battere il padding
   ridotto del media query sotto i 420px senza duplicare regole. */
.sort-tab.sort-tab--icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 9px;
}

.sort-tab--icon svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* segnalibro "pieno" quando la vista salvati è attiva */
.sort-tab--icon[aria-pressed="true"] svg { fill: rgba(11, 146, 133, .16); }

.forum-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 220px;
    min-width: 0;
    margin-left: auto;
    height: 38px;
    padding: 0 8px 0 13px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    transition: border-color .16s var(--ease-premium), box-shadow .16s var(--ease-premium);
}

.forum-search:focus-within {
    border-color: rgba(11, 146, 133, .55);
    box-shadow: 0 0 0 4px rgba(11, 146, 133, .14);
}

.forum-search:focus-within > svg { color: var(--brand-dark); }

.forum-search > svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--text-3);
}

.forum-search input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 13px;
    line-height: 1.25;
    color: var(--text);
    /* il campo di ricerca nativo di Safari/WebKit ignora i nostri stili:
       lo azzeriamo e ridisegniamo tutto da qui */
    appearance: none;
    -webkit-appearance: none;
}

.forum-search input:focus { outline: none; }
.forum-search input:focus-visible { box-shadow: none !important; }
.forum-search input::placeholder { color: var(--text-3); }

.forum-search input::-webkit-search-decoration,
.forum-search input::-webkit-search-cancel-button,
.forum-search input::-webkit-search-results-button,
.forum-search input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.forum-search__clear {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 50%;
    color: var(--text-3);
    transition: background .14s var(--ease-premium), color .14s var(--ease-premium);
}

.forum-search__clear[hidden] { display: none; }

.forum-search__clear:hover {
    background: rgba(11, 21, 20, .07);
    color: var(--text);
}

.forum-search__clear svg {
    width: 12px;
    height: 12px;
}

/* ── Elenco thread ────────────────────────────────────────────── */
.thread-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Caricamento progressivo ──────────────────────────────────── */
/* la sentinella sta in fondo alla lista: quando entra in vista arriva il
   blocco successivo, e il pulsante resta come alternativa accessibile */
.thread-more {
    display: flex;
    justify-content: center;
    padding: 14px 0 4px;
}

.thread-more[hidden] { display: none; }

.thread-more__btn {
    padding: 9px 18px;
    border-radius: 999px;
    border: 1px solid rgba(11, 146, 133, .24);
    background: rgba(255, 255, 255, .9);
    color: var(--brand-dark);
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: -.01em;
    box-shadow: 0 6px 18px rgba(7, 33, 30, .05);
    transition: background .16s var(--ease-premium), border-color .16s var(--ease-premium), transform .16s var(--ease-premium);
}

.thread-more__btn:hover {
    background: #fff;
    border-color: rgba(11, 146, 133, .40);
    transform: translateY(-1px);
}

.thread-more__btn:active { transform: translateY(0) scale(.98); }

.thread-list__end {
    margin: 14px 0 2px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-3);
    text-align: center;
}

.thread-list__end[hidden] { display: none; }

.thread {
    position: relative;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 4px;
    padding: 10px 14px 9px 6px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .93);
    box-shadow: 0 6px 22px rgba(7, 33, 30, .045);
    scroll-margin-top: 92px;
    transition: border-color .16s var(--ease-premium), box-shadow .16s var(--ease-premium), background .16s var(--ease-premium);
}

.thread:hover {
    border-color: rgba(11, 146, 133, .20);
    background: #fff;
    box-shadow: 0 14px 34px rgba(7, 33, 30, .075);
}

.thread.is-new { animation: threadIn .45s var(--ease-premium) both; }

@keyframes threadIn {
    from { opacity: 0; transform: translateY(-8px) scale(.99); }
    to { opacity: 1; transform: none; }
}

/* ── Colonna voti ─────────────────────────────────────────────── */
.thread__vote {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding-top: 5px;
}

.vote-btn {
    display: grid;
    place-items: center;
    width: 30px;
    height: 26px;
    border-radius: 8px;
    color: var(--text-3);
    transition: background .14s var(--ease-premium), color .14s var(--ease-premium), transform .14s var(--ease-premium);
}

.vote-btn svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linejoin: round;
}

.vote-btn:hover {
    background: rgba(11, 146, 133, .09);
    color: var(--brand-dark);
}

.vote-btn:active { transform: scale(.92); }

.vote-btn--down:hover {
    background: rgba(217, 86, 15, .09);
    color: #b8490b;
}

/* Voto positivo = verde Emma (brand): è il gesto di apprezzamento.
   Voto negativo = arancione: resta la convenzione "calda" del forum. */
.vote-btn--up[aria-pressed="true"] {
    color: var(--brand);
    background: var(--brand-10);
    box-shadow: inset 0 0 0 1px rgba(11, 146, 133, .18);
}

.vote-btn--down[aria-pressed="true"] {
    color: #d9560f;
    background: rgba(217, 86, 15, .10);
    box-shadow: inset 0 0 0 1px rgba(217, 86, 15, .16);
}

.vote-btn[aria-pressed="true"] svg path { fill: currentColor; }

.thread__score {
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.thread.is-upvoted .thread__score { color: var(--brand-dark); }
.thread.is-downvoted .thread__score { color: #b8490b; }

/* ── Avatar utenti ────────────────────────────────────────────── */
/* Quattro profili (maschio, femmina, robot, azienda): immagini circolari
   ricavate dalle miniature 128px in /img/avatar (script: make_avatars.py).
   L'anello sottile stacca l'avatar dallo sfondo chiaro della card. */
.avatar {
    display: block;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    background: #eef4f3;
    box-shadow: 0 0 0 1px rgba(11, 146, 133, .18), 0 1px 3px rgba(7, 33, 30, .07);
}

.avatar--xs { width: 18px; height: 18px; }
.avatar--sm { width: 20px; height: 20px; }
.avatar--md { width: 26px; height: 26px; }
.avatar--lg { width: 48px; height: 48px; }

/* l'utente di questa sessione si riconosce dall'anello verde del brand */
.avatar--self {
    box-shadow: 0 0 0 2px rgba(11, 146, 133, .45), 0 1px 3px rgba(7, 33, 30, .07);
}

/* ── Contenuto thread ─────────────────────────────────────────── */
.thread__main { min-width: 0; padding: 4px 0 2px; }

.thread__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11.5px;
    color: var(--text-3);
}

.thread__flair {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(11, 146, 133, .18);
    background: rgba(11, 146, 133, .09);
    color: var(--brand-dark);
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

/* avatar + handle: restano un blocco unico anche quando il meta va a capo */
.thread__who {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.thread__author { color: var(--text-2); font-weight: 700; }
.thread__sep { opacity: .6; }

/* gruppo di etichette di stato, spinto a destra nella riga del meta:
   Tendenza in rosso, Meme in giallo, Nuovo in blu.
   Può contenerne due (sezione + natura del post) */
.thread__badges {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 4px;
}

.thread__badge {
    padding: 2px 9px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    white-space: nowrap;
}

.thread__badge--hot {
    border-color: rgba(192, 57, 43, .24);
    background: rgba(192, 57, 43, .12);
    color: #b03a2e;
}

.thread__badge--meme {
    border-color: rgba(214, 158, 24, .30);
    background: rgba(240, 190, 60, .20);
    color: #8a6106;
}

.thread__badge--new {
    border-color: rgba(47, 95, 174, .24);
    background: rgba(47, 95, 174, .12);
    color: #2f5fae;
}

.thread__title {
    margin: 6px 0 4px;
    font-size: clamp(15px, 1.75vw, 17px);
    font-weight: 800;
    line-height: 1.33;
    letter-spacing: -.024em;
}

.thread__title-btn {
    display: inline;
    text-align: left;
    font: inherit;
    color: var(--ink);
    transition: color .14s var(--ease-premium);
}

.thread__title-btn:hover { color: var(--brand-dark); }

/* risposta di Emma: mascotte a sinistra, allineata alla prima riga */
.thread__answer-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
}

.thread__answer-logo {
    height: 14.7px;        /* 14px + 5% */
    width: auto;
    max-width: 24px;
    flex-shrink: 0;
    margin-top: 3px;
    object-fit: contain;
}

.thread__answer {
    min-width: 0;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-2);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.thread.is-open .thread__answer {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
}

/* il commento di chi ha condiviso il prompt */
.thread__note {
    position: relative;
    margin-top: 9px;
    padding-left: 11px;
    border-left: 3px solid rgba(11, 146, 133, .30);
    font-size: 13px;
    line-height: 1.58;
    color: #33413f;
}

/* ── Azioni ───────────────────────────────────────────────────── */
/* categorie del prompt: riga propria, subito sopra le azioni.
   Sono solo quelle scelte nella modale "Condividi un prompt". */
.thread__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

/* con le etichette sopra, le azioni non hanno bisogno del distacco pieno */
.thread__tags + .thread__actions { margin-top: 6px; }

.thread__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    margin-top: 10px;
    margin-left: -6px;
}

.thread-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    /* altezza fissa: tutti i riquadri di hover (commenti, condividi,
       salva, caramella, elimina) devono risultare identici */
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    white-space: nowrap;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--text-2);
    transition: background .14s var(--ease-premium), color .14s var(--ease-premium);
}

.thread-action svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* icona caramella: PNG ufficiale con trasparenza.
   Una volta e mezzo la dimensione base (18px → 27px): più presente
   delle icone a tratto senza dominare la riga azioni. Il disegno ha
   ~10% di aria interna, quindi il percepito è leggermente minore. */
.thread-action img.candy-icon {
    width: 27px;
    height: 27px;
    flex-shrink: 0;
    object-fit: contain;
}

/* icona commenti: PNG ufficiale (/img/forum/commenti.png, 50×50) usato come
   maschera alpha. Così prende il colore del testo — grigio a riposo,
   brand-dark quando il tab è attivo — invece di restare nera come il
   file originale. Dimensioni base -5% rispetto alle altre icone a tratto
   della riga azioni: 14px → 13.3px. */
.comment-icon {
    display: inline-block;
    flex-shrink: 0;
    width: 13.3px;
    height: 13.3px;
    background-color: currentColor;
    -webkit-mask: url("/img/forum/commenti.png") center / contain no-repeat;
    mask: url("/img/forum/commenti.png") center / contain no-repeat;
}

.thread-action:hover {
    background: rgba(11, 21, 20, .05);
    color: var(--text);
}

.thread-action[aria-pressed="true"] {
    background: rgba(11, 146, 133, .09);
    color: var(--brand-dark);
}

/* il contatore delle caramelle usa il verde chiaro del brand: si distingue
   dalle etichette grigie delle altre azioni senza pesare come il verde
   scuro dei titoli */
.thread-action--award { color: var(--brand); }

.thread-action--award:hover {
    background: rgba(11, 146, 133, .10);
    color: var(--brand);
}

.thread-action--award[aria-pressed="true"] {
    background: rgba(11, 146, 133, .12);
    color: var(--brand);
    cursor: default;
}

.thread-action--award.is-popping { animation: awardPop .42s var(--ease-premium); }

@keyframes awardPop {
    0% { transform: scale(1); }
    38% { transform: scale(1.14) rotate(-3deg); }
    70% { transform: scale(.97); }
    100% { transform: scale(1); }
}

.thread-action--danger { color: var(--text-3); }
.thread-action--danger:hover { background: rgba(192, 57, 43, .08); color: #c0392b; }

/* "Segnala": sempre in fondo a destra della riga azioni, discreto a riposo
   e più marcato solo al passaggio del mouse */
.thread-action--report {
    margin-left: auto;
    color: var(--text-3);
}

.thread-action--report:hover { background: rgba(192, 57, 43, .08); color: #c0392b; }

.thread-action--report[aria-pressed="true"] {
    background: rgba(192, 57, 43, .07);
    color: #a8382c;
    cursor: default;
}

/* ── Commenti ─────────────────────────────────────────────────── */
.thread__comments {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(11, 21, 20, .10);
    animation: commentsIn .22s var(--ease-premium) both;
}

.thread__comments[hidden] { display: none; }

@keyframes commentsIn {
    from { opacity: 0; transform: translateY(-3px); }
    to { opacity: 1; transform: none; }
}

.comment-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 11px;
    margin: 0 0 12px;
}

.comment {
    position: relative;
    padding-left: 15px;
}

.comment::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 3px;
    bottom: 3px;
    width: 2px;
    border-radius: 2px;
    background: rgba(11, 146, 133, .16);
}

.comment__meta {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
    color: var(--text-3);
}

/* il testo del meta è allineato al baseline, l'avatar al centro ottico */
.comment__meta .avatar { align-self: center; }

.comment__author { color: var(--text-2); font-weight: 800; }
.comment__author--you { color: var(--brand-dark); }

/* handle cliccabile: apre il profilo utente. Colore e peso arrivano dal
   contesto (.thread__author / .comment__author), qui cambiano solo hover
   e focus, così l'aspetto del testo resta identico a prima. */
.user-link {
    padding: 0;
    border: 0;
    background: none;
    border-radius: 6px;
    cursor: pointer;
    transition: color .14s var(--ease-premium);
}

.user-link:hover {
    color: var(--brand-dark);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.user-link:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.comment__text {
    margin-top: 1px;
    font-size: 13px;
    line-height: 1.58;
    color: #2c3a38;
    white-space: pre-wrap;
    word-break: break-word;
}

/* riga azioni del commento: rispondi/segnala sugli altrui,
   modifica/elimina sui propri */
.comment__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 2px;
}

.comment__action {
    padding: 2px 0;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-3);
    transition: color .14s var(--ease-premium);
}

.comment__action:hover { color: var(--brand-dark); }

/* segnalazione: rossa solo al passaggio, muta quando è già inviata */
.comment__action--report:hover,
.comment__action--danger:hover { color: #c0392b; }

.comment__action--report[aria-pressed="true"] {
    color: #a8382c;
    cursor: default;
}

/* editor inline quando si modifica il proprio commento */
.comment__edit {
    margin-top: 3px;
    padding: 7px 10px;
    border-radius: 10px;
    border: 1px solid rgba(11, 146, 133, .30);
    background: #fff;
    font-size: 13px;
    line-height: 1.5;
    color: #2c3a38;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 34px;
}

.comment__edit:focus {
    outline: none;
    border-color: var(--brand-30);
    box-shadow: 0 0 0 3px rgba(11, 146, 133, .08);
}


.comments__empty {
    margin-bottom: 12px;
    font-size: 12.5px;
    color: var(--text-3);
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.comment-form__label {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--text-3);
}

.comment-form__row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.comment-form__input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 38px;
    max-height: 120px;
    padding: 9px 13px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fbfdfd;
    font: inherit;
    font-size: 13px;
    line-height: 1.45;
    /* è un div contenteditable: cresce da solo fino al tetto, poi scorre */
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    transition: border-color .16s var(--ease-premium), box-shadow .16s var(--ease-premium), background .16s var(--ease-premium);
}

/* placeholder simulato: un div vuoto non ha ::placeholder */
.comment-form__input:empty::before {
    content: attr(data-placeholder);
    color: var(--text-3);
    pointer-events: none;
}

.comment-form__input.is-over-limit {
    border-color: rgba(192, 57, 43, .55);
    box-shadow: 0 0 0 3px rgba(192, 57, 43, .10);
}

/* menzione di Emma: chip verde dentro il testo, non editabile.
   Verde su verde e forma a bottone: si capisce che è un elemento speciale
   e che a quel commento risponde il modello */
.comment-form__input .mention {
    display: inline-block;
    padding: 1px 7px;
    margin: 0 1px;
    border-radius: 999px;
    background: rgba(11, 146, 133, .16);
    color: var(--brand-dark);
    font-weight: 800;
    line-height: 1.32;
    user-select: all;
    cursor: default;
}

.comment-form__input:focus {
    outline: none;
    background: #fff;
    border-color: var(--brand-30);
    box-shadow: 0 0 0 4px rgba(11, 146, 133, .09);
}

.comment-form__send {
    flex-shrink: 0;
    min-height: 38px;
    padding: 0 15px;
    border-radius: 12px;
    background: var(--brand);
    color: #fff;
    font-size: 12.5px;
    font-weight: 800;
    transition: background .16s var(--ease-premium), opacity .16s var(--ease-premium);
}

.comment-form__send:hover { background: var(--brand-dark); }
.comment-form__send:disabled { opacity: .42; background: var(--brand); cursor: not-allowed; }

/* ── Classifica settimanale (tab Utenti) ──────────────────────── */
.users-board {
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 8px 26px rgba(7, 33, 30, .05);
    overflow: hidden;
}

.users-board[hidden] { display: none; }

.users-board__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 18px 13px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(11, 146, 133, .06), rgba(11, 146, 133, 0));
}

.users-board__title {
    font-size: 16.5px;
    font-weight: 800;
    letter-spacing: -.028em;
    line-height: 1.2;
    color: var(--ink);
}

.users-board__sub {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-2);
    max-width: 56ch;
}

.users-board__range {
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(11, 146, 133, .18);
    background: rgba(11, 146, 133, .08);
    color: var(--brand-dark);
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* sotto il badge della finestra temporale: la classifica si ricalcola
   una volta al giorno, non a ogni visita */
.users-board__time {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.users-board__refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-3);
    white-space: nowrap;
}

.users-board__refresh svg {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
    opacity: .8;
}

/* i tre puntini si formano e spariscono a turno: danno l'idea del
   ricalcolo in corso senza muovere il layout */
.users-board__dots {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 3px;
}

.users-board__dots span {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    opacity: .22;
    animation: refreshDot 1.35s var(--ease-premium) infinite;
}

.users-board__dots span:nth-child(2) { animation-delay: .18s; }
.users-board__dots span:nth-child(3) { animation-delay: .36s; }

@keyframes refreshDot {
    0%, 60%, 100% { opacity: .22; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-1px); }
}

.users-list {
    list-style: none;
    margin: 0;
    padding: 6px;
    display: flex;
    flex-direction: column;
}

.user-row {
    position: relative;
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 13px;
    transition: background .14s var(--ease-premium);
}

.user-row:hover { background: rgba(11, 146, 133, .055); }
.user-row--self { background: rgba(11, 146, 133, .07); }

.user-row__rank {
    font-size: 11.5px;
    font-weight: 800;
    text-align: center;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}

.user-row--top .user-row__rank { color: var(--brand-dark); }

/* tutta la riga apre il profilo: bottone trasparente sopra la card.
   I link social restano cliccabili perché stanno sopra (z-index 2). */
.user-row__open {
    position: absolute;
    inset: 0;
    z-index: 1;
    padding: 0;
    border-radius: inherit;
    background: none;
    cursor: pointer;
}

.user-row__open:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: -2px;
}

.user-row:has(.user-row__open:hover) { background: rgba(11, 146, 133, .075); }

/* colonna identità: avatar tondo + handle, tronca il nome se serve */
.user-row__who {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.user-row__name {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -.012em;
    color: var(--text);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* icone social accanto al nome: solo qui, nella classifica settimanale.
   Sono 48–50 px negli asset, qui si vedono a 13 px: dimensioni fisse per
   non far ballare la riga e opacità morbida finché non si passa sopra. */
.user-socials {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
    /* sopra l'overlay della riga: i profili restano cliccabili */
    position: relative;
    z-index: 2;
    /* il gap di .user-row__who è 9px: qui lo riduco per legare le icone
       al nome invece di staccarle come un blocco a sé */
    margin-left: -4px;
}

/* ogni icona è un link: manina, micro-sollevamento e focus visibile */
.user-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: transform .14s var(--ease-premium);
}

.user-social-link:hover { transform: translateY(-1px); }

.user-social-link:hover .user-social { opacity: 1; }

.user-social-link:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.user-social {
    width: 13px;
    height: 13px;
    object-fit: contain;
    opacity: .72;
    transition: opacity .14s var(--ease-premium);
}

.user-row:hover .user-social { opacity: 1; }

.user-row__metrics {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.user-metric {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(11, 21, 20, .045);
    font-size: 11.5px;
    font-weight: 800;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.user-metric svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

/* nella classifica l'icona commenti sta sulla scala delle altre metriche */
.user-metric .comment-icon { width: 12.35px; height: 12.35px; }

.user-metric__label {
    font-weight: 700;
    color: var(--text-3);
}

.user-metric__value {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.user-metric--candy {
    /* stesso verde del contatore sulle card: il numero è un dato, non un
       richiamo al colore della caramella */
    background: rgba(11, 146, 133, .10);
    color: var(--brand);
}

.user-metric--candy .user-metric__label { color: rgba(11, 146, 133, .78); }

.user-metric__candy {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    object-fit: contain;
}

.users-board__empty {
    padding: 22px 18px 26px;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text-3);
    text-align: center;
}

.users-board__empty[hidden] { display: none; }

/* ── Stato vuoto ──────────────────────────────────────────────── */
.forum-empty {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 44px 24px;
    border-radius: 18px;
    border: 1px dashed rgba(11, 146, 133, .24);
    background: rgba(255, 255, 255, .62);
    text-align: center;
}

.forum-empty[hidden] { display: none; }
.forum-empty svg { width: 32px; height: 32px; color: var(--brand); opacity: .5; }
.forum-empty h2 { font-size: 14.5px; font-weight: 800; letter-spacing: -.02em; }
.forum-empty p { font-size: 12.5px; color: var(--text-2); max-width: 40ch; }

/* ── Footer: qui è in fondo al documento, non incollato ───────── */
.forum-body .footer {
    margin-top: 26px;
    border-top: 1px solid var(--line);
}

/* ── Modale profilo utente (classifica) ───────────────────────── */
.modal--user {
    width: min(430px, calc(100vw - 28px));
}

body.is-user-open { overflow: hidden; }

.user-card {
    display: grid;
    gap: 14px;
}

.user-card__head {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.user-card__identity {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.user-card__name {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* chi non ha social non lascia un buco nell'intestazione */
.user-card__socials:empty { display: none; }

.user-card__stats {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
}

.user-stat {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    grid-template-areas:
        "icon value"
        "icon label";
    align-items: center;
    column-gap: 9px;
    padding: 9px 12px;
    border-radius: 14px;
    border: 1px solid rgba(11, 146, 133, .14);
    background: rgba(255, 255, 255, .82);
}

/* cinque statistiche: l'ultima occupa tutta la riga */
.user-stat:last-child:nth-child(odd) { grid-column: 1 / -1; }

.user-stat__icon {
    grid-area: icon;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    color: var(--brand);
}

.user-stat__icon svg { width: 18px; height: 18px; }
.user-stat__icon img { width: 20px; height: 20px; object-fit: contain; }
.user-stat__icon .comment-icon { width: 17.1px; height: 17.1px; }

.user-stat__value {
    grid-area: value;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.user-stat__label {
    grid-area: label;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-3);
}

/* ── Modale "nuovo prompt" ────────────────────────────────────── */
.modal--prompt {
    width: min(560px, calc(100vw - 28px));
}

.prompt-form {
    display: grid;
    gap: 12px;
}

.prompt-form__intro {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-2);
}

.prompt-form__field {
    display: grid;
    gap: 5px;
}

.prompt-form__textarea {
    height: 80px;
    min-height: 80px;
    resize: none;
    overflow: hidden;
}

.prompt-form__count {
    justify-self: end;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}

.prompt-form__hint {
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-3);
}

/* ── Risposta di Emma: generata dal modello, non editabile ────── */
.emma-answer {
    display: grid;
    min-height: 80px;
    align-content: start;
    gap: 8px;
    padding: 11px 13px 12px;
    border-radius: 16px;
    border: 1px dashed rgba(11, 146, 133, .30);
    background: rgba(11, 146, 133, .035);
    transition:
        border-color .16s var(--ease-premium),
        background .16s var(--ease-premium),
        box-shadow .16s var(--ease-premium);
}

.emma-answer__head {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.emma-answer__logo {
    height: 14px;
    width: auto;
    max-width: 24px;
    flex-shrink: 0;
    object-fit: contain;
}

.emma-answer__name {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--brand-dark);
}

/* lucchetto: segnala che il testo è del modello e non si tocca */
.emma-answer__lock {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(11, 146, 133, .10);
    color: var(--brand-dark);
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.emma-answer__lock[hidden] { display: none; }
.emma-answer__lock svg { width: 11px; height: 11px; flex-shrink: 0; }

.emma-answer__text {
    margin: 0;
    font-size: 14px;
    line-height: 1.58;
    color: var(--text-2);
    white-space: pre-wrap;
    word-break: break-word;
}

/* messaggio di stato: vuoto quando non c'è nulla da dire */
.emma-answer__meta {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-3);
}

.emma-answer__meta:empty { display: none; }

/* — stati — */
.emma-answer[data-state="generating"] {
    border-style: solid;
    border-color: rgba(11, 146, 133, .42);
    background: rgba(11, 146, 133, .06);
}

.emma-answer[data-state="generating"] .emma-answer__meta {
    color: var(--brand-dark);
    animation: answerPulse 1.2s ease-in-out infinite;
}

.emma-answer[data-state="ready"] {
    border-style: solid;
    border-color: rgba(11, 146, 133, .26);
    background: rgba(255, 255, 255, .72);
}

.emma-answer[data-state="stale"] {
    border-color: rgba(217, 86, 15, .40);
    background: rgba(255, 249, 244, .9);
}

.emma-answer[data-state="stale"] .emma-answer__meta { color: #b8490b; }

.emma-answer[data-state="error"] {
    border-color: rgba(155, 47, 47, .36);
    background: rgba(255, 246, 246, .9);
}

.emma-answer[data-state="error"] .emma-answer__meta { color: #9b2f2f; }

@keyframes answerPulse {
    0%, 100% { opacity: .5; }
    50% { opacity: 1; }
}

.category-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.category-chip {
    padding: 6px 11px;
    border-radius: 999px;
    border: 1px solid rgba(11, 146, 133, .22);
    background: rgba(255, 255, 255, .88);
    color: var(--brand-dark);
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: -.01em;
    transition:
        background .14s var(--ease-premium),
        border-color .14s var(--ease-premium),
        color .14s var(--ease-premium),
        transform .14s var(--ease-premium),
        box-shadow .14s var(--ease-premium);
}

.category-chip:hover {
    background: rgba(11, 146, 133, .10);
    border-color: rgba(11, 146, 133, .36);
}

.category-chip:active { transform: scale(.97); }

.category-chip[aria-pressed="true"] {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    box-shadow: 0 8px 18px rgba(11, 146, 133, .22);
}

.prompt-form__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 2px;
}

#promptPublishBtn:disabled,
#promptPublishBtn:disabled:hover {
    background: rgba(11, 146, 133, .18);
    color: rgba(6, 79, 72, .42);
    box-shadow: none;
    cursor: not-allowed;
    filter: none;
    transform: none;
}

.prompt-form__cancel {
    padding: 10px 16px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-2);
    transition: background .16s var(--ease-premium), color .16s var(--ease-premium);
}

.prompt-form__cancel:hover { background: rgba(11, 21, 20, .05); color: var(--text); }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 720px) {
    .forum-app { padding: 0 8px 18px; }

    /* su schermi stretti il testo occupa più righe: il velo parte
       prima e sale di densità, così il bianco resta leggibile */
    .forum-hero::after {
        background:
            linear-gradient(180deg,
                rgba(4, 26, 24, .14) 0%,
                rgba(4, 26, 24, .52) 40%,
                rgba(4, 26, 24, .90) 100%);
    }

    .forum-hero__overlay { padding: 14px 14px 16px; }
    .forum-head__title { font-size: 20px; }
    .forum-head__sub { white-space: normal; }
    .forum-cta { width: 100%; justify-content: center; }

    .thread {
        grid-template-columns: 38px minmax(0, 1fr);
        padding: 9px 11px 9px 4px;
    }

    .vote-btn { width: 28px; }

    .thread__title { font-size: 15px; }

    .thread__actions { margin-left: -4px; }
    .thread-action { padding: 0 7px; }
    .thread-action--danger { margin-left: 0; }

    .forum-toolbar { border-radius: 18px; }
    .forum-search { margin-left: 0; flex: 1 1 100%; }

    .comment-form__row { flex-direction: column; align-items: stretch; }
    .comment-form__send { width: 100%; }
}

@media (max-width: 640px) {
    /* classifica: metriche su una riga dedicata sotto il nome */
    .user-row {
        grid-template-columns: 22px minmax(0, 1fr);
        row-gap: 7px;
    }

    .user-row__metrics {
        grid-column: 1 / -1;
        padding-left: 2px;
    }

    /* su schermo l'etichetta sparisce, ma resta nel DOM per gli
       screen reader: la metrica continua a essere "3 caramelle" */
    .user-metric__label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
        border: 0;
    }

    .users-board__head { padding: 14px 14px 12px; }
}

@media (max-width: 420px) {
    .thread { grid-template-columns: 32px minmax(0, 1fr); }
    .thread__score { font-size: 11px; }
    .sort-tab { padding: 7px 10px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .thread,
    .thread__comments,
    .thread-action--award,
    .emma-answer__meta { animation: none !important; }
    /* i puntini restano visibili ma fermi */
    .users-board__dots span {
        animation: none !important;
        opacity: .55;
        transform: none;
    }
    .thread:hover,
    .forum-cta:hover { transform: none; }
    .user-social-link:hover { transform: none; }
}

.forum-noscript {
    margin-top: 16px;
    font-size: 13px;
    color: #536260;
}

.thread__answer.message__content--md {
    display: block;
    -webkit-line-clamp: unset;
    max-height: calc(1.6em * 3);
    overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent);
    mask-image: linear-gradient(180deg, #000 55%, transparent);
}

.thread.is-open .thread__answer.message__content--md {
    max-height: none;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
}

.thread__answer .md-paragraph,
.comment__text .md-paragraph,
.emma-answer__text .md-paragraph {
    margin-bottom: .45em;
    line-height: inherit;
}

.thread__answer .md-heading,
.comment__text .md-heading,
.emma-answer__text .md-heading {
    margin: .5em 0 .3em;
    font-size: 1em;
}

.emma-answer__text.message__content--md {
    white-space: normal;
}

.avatar--emma {
    object-fit: contain;
    padding: 2px;
    background: #fff;
}

.comment--emma .comment__author {
    color: var(--brand-dark);
}

.comment--emma .comment__text {
    white-space: normal;
}

.prompt-ask {
    position: relative;
}

.prompt-ask .prompt-ask__input {
    padding-right: 56px;
}

.prompt-ask__btn {
    position: absolute;
    top: 50%;
    right: 7px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    box-shadow: 0 10px 22px rgba(11, 146, 133, .24);
    transform: translateY(-50%);
    transition: background .16s var(--ease-premium), opacity .16s var(--ease-premium), box-shadow .16s var(--ease-premium);
}

.prompt-ask__btn:hover:not(:disabled) { background: var(--brand-dark); }

.prompt-ask__btn:disabled {
    opacity: .3;
    box-shadow: none;
    cursor: not-allowed;
}

.prompt-ask__btn svg { width: 16px; height: 16px; }
.prompt-ask__icon { display: grid; place-items: center; }
.prompt-ask__icon--stop { display: none; }

.prompt-ask__btn.is-generating {
    border: 1px solid rgba(11, 146, 133, .18);
    background: rgba(11, 146, 133, .12);
    color: var(--brand-dark);
    box-shadow: none;
}

.prompt-ask__btn.is-generating:hover:not(:disabled) { background: rgba(11, 146, 133, .2); }
.prompt-ask__btn.is-generating .prompt-ask__icon--send { display: none; }
.prompt-ask__btn.is-generating .prompt-ask__icon--stop { display: grid; }

.thread-action img.lollipop-icon {
    width: 22px;
    height: 24px;
    flex-shrink: 0;
    object-fit: contain;
}

.thread-action--lollipop[aria-disabled="true"] {
    position: relative;
    cursor: not-allowed;
}

.thread-action--lollipop[aria-disabled="true"] > * {
    opacity: .45;
}

.thread-action--lollipop[aria-disabled="true"]:hover {
    background: transparent;
}

.thread-action[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    z-index: 5;
    padding: 7px 11px;
    border-radius: 10px;
    width: max-content;
    max-width: min(280px, calc(100vw - 16px));
    background: var(--ink);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
    box-shadow: 0 10px 24px rgba(7, 33, 30, .18);
    opacity: 0;
    pointer-events: none;
    transform: translate(calc(-50% + var(--tip-shift, 0px)), 4px);
    transition: opacity .15s var(--ease-premium), transform .15s var(--ease-premium);
}

.thread-action[data-tooltip]:hover::after,
.thread-action[data-tooltip]:focus-visible::after,
.thread-action[data-tooltip].is-tip-visible::after {
    opacity: 1;
    transform: translate(calc(-50% + var(--tip-shift, 0px)), 0);
}

.thread {
    cursor: pointer;
}

.thread__comments {
    cursor: auto;
}

.comment-form__login {
    margin: 0;
    font-size: 12.5px;
    color: var(--text-2);
}

.comment-form__login a {
    color: var(--brand-dark);
    font-weight: 800;
}

.comment--pending .comment__text {
    color: var(--text-3);
    animation: answerPulse 1.2s ease-in-out infinite;
}

.thread.is-linked {
    border-color: rgba(11, 146, 133, .45);
    box-shadow: 0 0 0 4px rgba(11, 146, 133, .10), 0 14px 34px rgba(7, 33, 30, .075);
}

@media (prefers-reduced-motion: reduce) {
    .comment--pending .comment__text { animation: none !important; }
}

.forum-body em,
.forum-body i,
.forum-body cite,
.forum-body .md-quote {
    font-style: normal;
}

.verified-badge {
    width: 14px;
    height: 14px;
    flex: none;
    object-fit: contain;
    vertical-align: middle;
}

.verified-badge--lg {
    width: 16px;
    height: 16px;
}

.verified-badge[hidden] {
    display: none;
}

.user-card__nameline {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    margin: 0;
}

.user-card__nameline .user-card__name {
    display: block;
    min-width: 0;
}

.forum-back {
    margin: 16px 0 10px;
}

.forum-back__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px 6px 8px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .78);
    color: var(--brand-dark);
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    transition: background .14s var(--ease-premium), color .14s var(--ease-premium);
}

.forum-back__link:hover { background: #fff; color: var(--ink); }

.forum-back__link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(11, 146, 133, .45);
}

.forum-back__link svg { width: 15px; height: 15px; }

.forum-body--post .thread {
    cursor: auto;
}

.forum-body--post .thread__title {
    margin: 8px 0 6px;
    font-size: clamp(18px, 2.4vw, 22px);
    line-height: 1.28;
    color: var(--ink);
}

.thread__answer--plain {
    white-space: pre-line;
}

.thread__permalink {
    color: inherit;
    text-decoration: none;
}

.thread__permalink:hover {
    color: var(--brand-dark);
    text-decoration: underline;
}

.thread__permalink:focus-visible {
    outline: none;
    border-radius: 4px;
    box-shadow: 0 0 0 2px rgba(11, 146, 133, .45);
}

.user-card__friend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: -4px;
}

.user-card__friend[hidden] { display: none; }

.friend-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 6px;
    border-radius: 999px;
    color: var(--brand-dark);
    font-size: 13px;
    font-weight: 800;
    transition: background .14s var(--ease-premium);
}

.friend-link:hover { background: rgba(11, 146, 133, .08); }

.friend-link:focus-visible,
.friend-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(11, 146, 133, .45);
}

.friend-link:disabled,
.friend-btn:disabled { opacity: .5; cursor: default; }

.friend-link--pending { color: var(--text-2); }

.friend-link--remove { color: #b23b30; }

.friend-link--remove:hover { background: rgba(192, 57, 43, .07); }

.friends-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.friend-note {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-right: auto;
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 700;
}

.friend-actions {
    display: inline-flex;
    gap: 6px;
}

.friend-btn {
    padding: 6px 13px;
    border: 1px solid rgba(7, 33, 30, .14);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 700;
}

.friend-btn--primary {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.user-metric__lollipop {
    width: 14px;
    height: 16px;
    object-fit: contain;
}

.user-metric--lollipop {
    background: rgba(11, 146, 133, .10);
    color: var(--brand);
}

.user-metric--lollipop .user-metric__label { color: rgba(11, 146, 133, .78); }

.users-board + .users-board--premium {
    margin-top: 14px;
}

.user-row.user-row--premium {
    grid-template-columns: minmax(0, 1fr);
}

.comment-replies {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0 0;
    padding: 0 0 0 14px;
}

.comment__replying {
    color: var(--text-3);
    font-weight: 600;
}

.comment-form__reply {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    max-width: 100%;
    margin: 2px 0 6px;
    padding: 4px 6px 4px 11px;
    border-radius: 999px;
    background: rgba(11, 146, 133, .09);
    color: var(--text-2);
    font-size: 12px;
}

.comment-form__reply[hidden] { display: none; }

.comment-form__reply strong {
    color: var(--brand-dark);
    font-weight: 800;
}

.comment-form__reply-cancel {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: var(--text-2);
    font-size: 15px;
    line-height: 1;
}

.comment-form__reply-cancel:hover { background: rgba(7, 33, 30, .08); }

.comment-form__reply-cancel:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(11, 146, 133, .45);
}
