/* La messagerie. The list of threads and, beside it, the thread: shared by the page and
   its components, so global, all under the gm- prefix. The hat a thread is read under comes as
   --hat-color; every shade is derived from it. */

/* Full screen beside the menu, as a messaging app: the threads, the thread. */
.gi.gm {
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    height: 100%;
    min-height: 0;
}

/* ── The list ───────────────────────────────────────────── */

.gm-list {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    border-right: 1px solid var(--dark-border-1);
}

.gm-list__head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    min-height: 72px;
    padding: 12px 16px 0;
}

.gm-list__title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font: 800 32px/1 var(--font-condensed);
    text-transform: uppercase;
    color: #fff;
}

/* « Bêta »: the messaging is still being tried (docs/messaging.md). The title no longer takes the
   whole line, the pill does, so it sits right after the title and the button stays at the end. */
.gm-list__head:has(.gm-list__beta) .gm-list__title {
    flex: 0 1 auto;
}

.gm-list__beta {
    margin-right: auto;
}

/* The past seasons' list: a way back to the season under way, before its name. */
.gm-list__head--archives {
    gap: 4px;
    padding-left: 6px;
}

.gm-list__back,
.gm-head__back {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 4px;
    color: #fff;
}

.gm-list__back svg,
.gm-head__back svg {
    fill: currentColor;
}

.gm-list__back:focus-visible,
.gm-head__back:focus-visible,
.gm-row:focus-visible,
.gm-archives:focus-visible {
    outline: 2px solid var(--thonon-yellow);
    outline-offset: -2px;
}

/* The menu's badge says it on a desktop; a phone has no room for the menu. */
.gm-list__unread {
    display: none;
    font-size: 13px;
    line-height: 1.3;
    color: var(--dark-fg-3);
}

.gm-list__scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0 8px 12px;
}

.gm-list__state {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gm-retry {
    height: 44px;
}

.gm-group {
    margin: 0;
    padding: 14px 16px 6px;
    font: 700 12px/1.2 var(--font-condensed);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--dark-fg-3);
}

.gm-rows {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.gm-row {
    display: flex;
    align-items: center;
    gap: 11px;
    box-sizing: border-box;
    min-height: 76px;
    padding: 12px 16px;
    border-left: 2px solid transparent;
    border-radius: 4px;
    color: inherit;
    text-decoration: none;
    transition: background 120ms cubic-bezier(0.22, 1, 0.36, 1);
}

a.gm-row:hover {
    background: rgba(255, 255, 255, 0.035);
}

.gm-row--active,
a.gm-row--active:hover {
    background: rgba(255, 255, 255, 0.06);
    border-left-color: var(--hat-color, var(--thonon-yellow));
}

.gm-row__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    box-sizing: border-box;
    border-radius: 4px;
    border: 1px solid color-mix(in srgb, var(--hat-color, var(--thonon-yellow)) 42%, transparent);
    background: color-mix(in srgb, var(--hat-color, var(--thonon-yellow)) 13%, transparent);
    color: var(--hat-color, var(--thonon-yellow));
}

/* A conversation is someone, a thread is a group: round against square. */
.gm-row__icon--round {
    border-radius: 50%;
}

.gm-row__icon svg {
    fill: currentColor;
}

.gm-row__text {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1 1 auto;
    min-width: 0;
}

.gm-row__line {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.gm-row__title {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.gm-row__sub {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.2;
    color: var(--dark-fg-3);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.gm-row__time {
    flex-shrink: 0;
    font: 400 12px/1 var(--font-mono);
    color: var(--dark-fg-3);
}

.gm-row__preview {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.3;
    color: var(--dark-fg-3);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.gm-row--unread .gm-row__title {
    font-weight: 700;
}

.gm-row--unread .gm-row__time {
    color: #fff;
}

.gm-row--unread .gm-row__preview {
    font-weight: 500;
    color: var(--dark-fg-1);
}

/* Under the season's threads, the way to the seasons that are over. */
.gm-archives {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    margin-top: 10px;
    padding: 0 12px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--dark-fg-3);
    text-decoration: none;
    transition: background 120ms cubic-bezier(0.22, 1, 0.36, 1), color 120ms cubic-bezier(0.22, 1, 0.36, 1);
}

.gm-archives:hover {
    background: rgba(255, 255, 255, 0.035);
    color: var(--dark-fg-1);
}

.gm-archives svg {
    fill: currentColor;
}

/* ── Loading ────────────────────────────────────────────── */

.gm-row--skel {
    margin-top: 2px;
}

.gm-skel__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
}

.gm-skel__icon--round {
    border-radius: 50%;
}

.gm-skel__line {
    width: 72%;
    height: 9px;
}

.gm-skel__line--title {
    width: 58%;
    height: 11px;
}

/* ── The thread, beside the list ────────────────────────── */

.gm-pane {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.gm-pane__state {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.gm-head {
    display: flex;
    align-items: center;
    gap: 11px;
    flex-shrink: 0;
    height: 60px;
    box-sizing: border-box;
    padding: 0 18px;
    border-bottom: 1px solid var(--dark-border-1);
}

/* The list is beside the thread on a desktop: nothing to go back to. */
.gm-head__back,
.gm-head--bare {
    display: none;
}

.gm-head__icon {
    width: 34px;
    height: 34px;
}

.gm-head__text {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1 1 auto;
    min-width: 0;
}

.gm-head__line {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.gm-head__title {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    font: 700 16px/1 var(--font-condensed);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.gm-head__line .hat-pill {
    flex-shrink: 0;
    height: 18px;
    padding: 0 7px;
    font-size: 12px;
}

.gm-head__info {
    margin: 0;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.3;
    color: var(--dark-fg-3);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.gm-head__bare {
    font: 700 13px/1 var(--font-condensed);
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: #fff;
}

/* A minor's conversation: who else sees it. */
.gm-minor {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    flex-shrink: 0;
    margin: 10px 16px 0;
    padding: 9px 11px;
    border: 1px solid rgba(16, 128, 192, 0.32);
    border-radius: 4px;
    background: rgba(16, 128, 192, 0.10);
    font-size: 12px;
    line-height: 1.45;
    color: #8FC4E8;
    text-wrap: pretty;
}

.gm-minor svg {
    flex-shrink: 0;
    margin-top: 2px;
    fill: currentColor;
}

.gm-minor strong {
    font-weight: 600;
    color: #fff;
}

/* Bottom-up: the scroller opens on the latest message, and a short thread sits at the bottom. */
.gm-scroll {
    display: flex;
    flex-direction: column-reverse;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 6px 16px 12px;
}

.gm-scroll:focus-visible {
    outline: 2px solid var(--thonon-yellow);
    outline-offset: -2px;
}

.gm-msgs {
    gap: 2px;
    display: flex;
    flex-direction: column;
}

.gm-earlier {
    display: flex;
    justify-content: center;
    padding: 10px 0 4px;
}

.gm-day,
.gm-new {
    display: flex;
    align-items: center;
    gap: 10px;
    font: 700 12px/1 var(--font-condensed);
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.gm-day {
    padding: 10px 0 4px;
    color: var(--dark-fg-3);
}

.gm-day::before,
.gm-day::after,
.gm-new::before {
    content: "";
    flex: 1 1 0;
    height: 1px;
    background: var(--dark-border-1);
}

.gm-new {
    padding: 6px 0;
    color: #F06A75;
}

.gm-new::before {
    background: rgba(240, 32, 48, 0.5);
}

.gm-msg {
    display: flex;
    gap: 11px;
    padding: 8px 10px;
    border-radius: 4px;
    position: relative;
    align-items: flex-start;
    max-width: min(720px, 86%);
}

/* The ring takes a hat's colour only where the reader wears that hat; anyone else stays neutral. */
.gm-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    box-sizing: border-box;
    border: 2px solid #8A93A1;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    font: 700 12px/1 var(--font-condensed);
    color: #fff;
}

.gm-avatar--hat {
    border-color: var(--hat-color, var(--thonon-yellow));
}

.gm-msg__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
}

.gm-msg__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
}

.gm-msg__who {
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
}

.gm-msg__role {
    font-size: 12px;
    line-height: 1.2;
    color: var(--dark-fg-3);
}

.gm-msg__time {
    font: 500 12px/1 var(--font-mono);
    color: var(--dark-fg-3);
}

.gm-msg__edited {
    font-size: 12px;
    font-style: italic;
    line-height: 1;
    color: var(--dark-fg-3);
}

/* Plain text, its line breaks kept. */
.gm-msg__text {
    max-width: 560px;
    margin: 0;
    color: var(--dark-fg-1);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    text-wrap: pretty;
    font-size: 16px;
    line-height: 1.45;
}

/* Aligned with the text of the messages around it: past the avatar. */
.gm-deleted {
    margin: 0;
    padding: 6px 10px 6px 53px;
    font-size: 12px;
    font-style: italic;
    line-height: 1.3;
    color: var(--dark-fg-3);
}

/* ── The card of a call: availability, convocation, session ─ */

.gm-card {
    width: 460px;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--dark-border-1);
    border-top: 3px solid var(--gm-card-color, var(--thonon-yellow));
    border-radius: 4px;
    background: var(--thonon-night);
}

.gm-card--availability {
    --gm-card-color: #34A4E0;
}

.gm-card--convocation {
    --gm-card-color: #F0C030;
}

.gm-card--session {
    --gm-card-color: #22C55E;
}

.gm-card--cancelled {
    --gm-card-color: #F02030;
    --gm-card-text: #F06A75;
    opacity: 0.92;
}

.gm-card__head {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 13px 15px;
}

.gm-card__eyebrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font: 800 12px/1 var(--font-condensed);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gm-card-text, var(--gm-card-color, var(--thonon-yellow)));
}

.gm-card__asked {
    font: 500 12px/1 var(--font-mono);
    letter-spacing: 0;
    text-transform: none;
    color: var(--dark-fg-3);
}

.gm-card__title {
    font: 700 19px/1.1 var(--font-condensed);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #fff;
}

.gm-card__title--cancelled {
    text-decoration: line-through;
    text-decoration-color: rgba(240, 32, 48, 0.7);
}

.gm-card__when {
    font: 500 12px/1.35 var(--font-mono);
    color: var(--dark-fg-2);
}

.gm-card__where {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    line-height: 1.3;
    color: var(--dark-fg-2);
}

.gm-card__where svg {
    flex-shrink: 0;
    fill: var(--dark-fg-3);
}

.gm-card__foot {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 13px 15px;
    border-top: 1px solid var(--dark-border-1);
}

/* The coach's figures: who comes, who does not, who has not said. */
.gm-card__counters {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.gm-card__counter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    line-height: 1;
    color: var(--dark-fg-2);
}

.gm-card__counter b {
    font: 700 12px/1 var(--font-mono);
    color: #fff;
}

.gm-card__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #8A93A1;
}

.gm-card__dot--yes {
    background: #22C55E;
}

.gm-card__dot--no {
    background: #F02030;
}

.gm-card__spacer {
    flex: 1 1 auto;
}

.gm-card__track,
.gm-card__change {
    flex-shrink: 0;
    height: 32px;
    text-decoration: none;
}

.gm-card__ask {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

/* A parent answers for a child: said in the family's blue. */
.gm-card__for {
    font: 700 12px/1 var(--font-condensed);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #34A4E0;
}

.gm-card__buttons {
    display: flex;
    gap: 8px;
}

.gm-card__buttons .gi-btn {
    flex: 1 1 0;
    min-width: 0;
    height: 38px;
}

.gm-card__buttons svg,
.gm-card__given svg,
.gm-card__line svg {
    flex-shrink: 0;
    fill: currentColor;
}

.gm-card__note {
    font-size: 12px;
    line-height: 1.4;
    color: var(--dark-fg-3);
}

.gm-card__given {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #34D26E;
}

.gm-card__given--no {
    color: #F06A75;
}

.gm-card__given-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1 1 auto;
    min-width: 0;
}

.gm-card__said {
    font: 700 12px/1.2 var(--font-condensed);
    letter-spacing: 0.10em;
    text-transform: uppercase;
}

.gm-card__line {
    flex-direction: row;
    align-items: flex-start;
    gap: 9px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--dark-fg-3);
}

.gm-card__line svg {
    margin-top: 1px;
}

.gm-card__line strong {
    font-weight: 600;
    color: var(--dark-fg-1);
}

.gm-card__line .gm-card__cancelled {
    font-weight: 700;
    color: #F06A75;
}

/* A parent of two children asked: one card each, one under the other. */
.gm-card + .gm-card {
    margin-top: 2px;
}

/* Where the composer would be, for who only reads. */
.gm-readonly {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
    margin: 0;
    padding: 13px 18px;
    border-top: 1px solid var(--dark-border-1);
    font-size: 12px;
    line-height: 1.4;
    color: var(--dark-fg-3);
}

.gm-readonly svg {
    flex-shrink: 0;
    fill: currentColor;
}

.gm-skel__icon--head {
    width: 34px;
    height: 34px;
}

.gm-skel__line--head {
    width: 140px;
    height: 13px;
}

.gm-skel__line--info {
    width: 260px;
    max-width: 70%;
    height: 9px;
}

.gm-skel__avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* ── A message's link to a match or a session ───────────── */

.gm-link {
    display: flex;
    align-items: center;
    gap: 11px;
    max-width: 380px;
    box-sizing: border-box;
    padding: 9px 11px;
    border: 1px solid var(--dark-border-1);
    border-radius: 4px;
    background: var(--thonon-night);
    color: var(--dark-fg-2);
    text-decoration: none;
    transition: border-color 120ms cubic-bezier(0.22, 1, 0.36, 1);
}

.gm-link:hover {
    border-color: var(--dark-border-2);
}

.gm-link:focus-visible {
    outline: 2px solid var(--thonon-yellow);
    outline-offset: 2px;
}

.gm-link svg {
    flex-shrink: 0;
    fill: currentColor;
}

.gm-link__text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1 1 auto;
    min-width: 0;
}

.gm-link__kind {
    font: 700 12px/1 var(--font-condensed);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--dark-fg-3);
}

.gm-link__title,
.gm-link__when {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.gm-link__title {
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.25;
    color: #fff;
}

.gm-link__when {
    font: 500 12px/1.3 var(--font-mono);
    color: var(--dark-fg-2);
}

/* ── One's own message: rewrite it, delete it ───────────── */

.gm-msg--mine:hover,
.gm-msg--mine:focus-within,
.gm-msg--menu {
    background: rgba(255, 255, 255, 0.035);
}

/* The bar floats over the message's top edge. Out of sight until the message is hovered or
   something in it is focused — so the keyboard reaches it too. */
.gm-actions {
    position: absolute;
    top: -12px;
    right: 10px;
    display: flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--dark-border-2);
    border-radius: 4px;
    background: var(--thonon-graphite);
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms cubic-bezier(0.22, 1, 0.36, 1);
}

.gm-msg:hover .gm-actions,
.gm-msg:focus-within .gm-actions,
.gm-msg--menu .gm-actions {
    opacity: 1;
    pointer-events: auto;
}

.gm-actions__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 12px;
    border: 0;
    border-radius: 3px;
    background: transparent;
    font: 500 14px/1 var(--font-body);
    color: var(--dark-fg-1);
    cursor: pointer;
}

.gm-actions__btn:hover {
    background: rgba(255, 255, 255, 0.06);
}

.gm-actions__btn svg {
    fill: var(--dark-fg-2);
}

.gm-actions__btn--danger,
.gm-actions__btn--danger svg {
    color: #F06A75;
    fill: #F06A75;
}

.gm-actions__btn:focus-visible,
.gm-msg__more:focus-visible {
    outline: 2px solid var(--thonon-yellow);
    outline-offset: 1px;
}

/* « ⋯ » stands for the bar where nothing hovers: a phone, a tablet. */
.gm-msg__more {
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 32px;
    margin: -4px -6px 0 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--dark-fg-3);
    cursor: pointer;
}

.gm-msg__more svg {
    fill: currentColor;
}

/* Where nothing hovers, a long press opens the selection bar: no « ⋯ » under the messages. */
@media (hover: none) {
    .gm-msg__more {
        display: none;
    }

    .gm-msg:hover .gm-actions,
    .gm-msg:focus-within .gm-actions {
        opacity: 0;
        pointer-events: none;
    }

    .gm-msg--mine:hover,
    .gm-msg--mine:focus-within {
        background: transparent;
    }

    .gm-msg--mine:hover .gm-actions,
    .gm-msg--mine:focus-within .gm-actions {
        opacity: 0;
        pointer-events: none;
    }

    .gm-msg.gm-msg--menu {
        background: rgba(255, 255, 255, 0.035);
    }

    .gm-msg.gm-msg--menu .gm-actions {
        top: 34px;
        right: 6px;
        z-index: 2;
        opacity: 1;
        pointer-events: auto;
    }

    .gm-actions__btn {
        height: 40px;
        padding: 0 12px;
    }
}

.gm-edit,
.gm-confirm {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 560px;
}

.gm-edit__actions {
    display: flex;
    gap: 8px;
}

.gm-confirm {
    padding: 10px 12px;
    border: 1px solid rgba(240, 32, 48, 0.38);
    border-radius: 4px;
    background: rgba(240, 32, 48, 0.08);
}

.gm-confirm__text {
    font-size: 12px;
    line-height: 1.4;
    color: var(--dark-fg-1);
}

/* ── The composer: only for who may write ───────────────── */

.gm-compose {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    padding: 12px 18px;
    border-top: 1px solid var(--dark-border-1);
    background: var(--thonon-black);
}

.gm-compose__row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.gm-compose__event {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border: 1px solid var(--dark-border-2);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--dark-fg-2);
    cursor: pointer;
}

.gm-compose__event:hover {
    color: #fff;
}

.gm-compose__event--on {
    border-color: var(--thonon-yellow);
    color: var(--thonon-yellow);
}

.gm-compose__event svg,
.gm-compose__send svg,
.gm-compose__link svg,
.gm-pick__close svg,
.gm-choice svg {
    flex-shrink: 0;
    fill: currentColor;
}

/* Grows with what is typed, up to a few lines; beyond, it scrolls. */
.gm-compose__input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 38px;
    max-height: 168px;
    box-sizing: border-box;
    padding: 8px 12px;
    border: 1px solid var(--dark-border-2);
    border-radius: 4px;
    background: var(--thonon-night);
    font: 400 13px/1.5 var(--font-body);
    color: var(--dark-fg-1);
    resize: none;
    field-sizing: content;
}

.gm-compose__input::placeholder {
    color: var(--dark-fg-3);
}

.gm-compose__input:focus {
    border-color: var(--thonon-yellow);
    outline: none;
}

.gm-compose__event:focus-visible,
.gm-compose__unlink:focus-visible,
.gm-pick__close:focus-visible,
.gm-choice:focus-visible {
    outline: 2px solid var(--thonon-yellow);
    outline-offset: 1px;
}

.gm-compose__send {
    flex-shrink: 0;
    height: 38px;
}

.gm-compose__error {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    color: #F06A75;
}

/* The link chosen, above the field until the message leaves. */
.gm-compose__link {
    display: flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    max-width: 100%;
    min-height: 30px;
    box-sizing: border-box;
    padding: 0 4px 0 10px;
    border: 1px solid var(--dark-border-2);
    border-radius: 4px;
    background: var(--thonon-night);
    font-size: 12px;
    color: var(--dark-fg-2);
}

.gm-compose__link-text {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.gm-compose__link strong {
    font-weight: 600;
    color: #fff;
}

.gm-compose__unlink,
.gm-pick__close {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: var(--dark-fg-2);
    cursor: pointer;
}

.gm-compose__unlink:hover,
.gm-pick__close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

/* The matches and the sessions to link, over the composer. */
.gm-pick {
    position: absolute;
    left: 18px;
    bottom: calc(100% + 6px);
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 420px;
    max-width: calc(100% - 36px);
    max-height: min(420px, 60vh);
    box-sizing: border-box;
    padding: 14px;
    border: 1px solid var(--dark-border-2);
    border-radius: 4px;
    background: var(--thonon-graphite);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}

.gm-pick__head {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.gm-pick__label {
    font: 700 12px/1 var(--font-condensed);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--dark-fg-2);
}

.gm-pick__hint {
    flex: 1 1 auto;
    font-size: 12px;
    line-height: 1;
    color: var(--dark-fg-3);
}

.gm-pick__close {
    align-self: center;
    margin: -6px -6px -6px 0;
}

.gm-pick__note {
    margin: 0;
    font-size: 12px;
    line-height: 1.55;
    color: var(--dark-fg-2);
}

.gm-pick__list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.gm-choice {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-height: 46px;
    box-sizing: border-box;
    padding: 6px 11px;
    border: 1px solid var(--dark-border-1);
    border-radius: 4px;
    background: transparent;
    color: var(--dark-fg-3);
    text-align: left;
    cursor: pointer;
}

.gm-choice:hover {
    border-color: var(--dark-border-2);
}

.gm-choice--on {
    border-color: var(--thonon-yellow);
    background: rgba(240, 192, 48, 0.08);
}

.gm-choice__radio {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    box-sizing: border-box;
    border: 2px solid var(--dark-border-2);
    border-radius: 50%;
}

.gm-choice--on .gm-choice__radio {
    border-color: var(--thonon-yellow);
}

.gm-choice--on .gm-choice__radio::after {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--thonon-yellow);
}

.gm-choice__text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1 1 auto;
    min-width: 0;
}

.gm-choice__title {
    font: 600 12.5px/1.2 var(--font-body);
    color: #fff;
}

.gm-choice__sub {
    font: 400 12px/1.3 var(--font-body);
    color: var(--dark-fg-3);
}

/* ── An announcement's audience, above its field ────────── */

.gm-compose__audience {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.gm-audience {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    height: 30px;
    padding: 0 9px 0 10px;
    border: 1px solid color-mix(in srgb, var(--hat-color, var(--thonon-yellow)) 42%, transparent);
    border-radius: 4px;
    background: color-mix(in srgb, var(--hat-color, var(--thonon-yellow)) 13%, transparent);
    font: 600 12px/1 var(--font-body);
    color: #fff;
    cursor: pointer;
}

.gm-audience svg,
.gm-chip svg {
    flex-shrink: 0;
    fill: var(--hat-color, var(--thonon-yellow));
}

.gm-audience:hover {
    background: color-mix(in srgb, var(--hat-color, var(--thonon-yellow)) 20%, transparent);
}

.gm-audience:focus-visible,
.gm-chip:focus-visible,
.gm-new-btn:focus-visible {
    outline: 2px solid var(--thonon-yellow);
    outline-offset: 1px;
}

.gm-compose__audience-names {
    min-width: 0;
    overflow: hidden;
    font-size: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--dark-fg-3);
}

.gm-pick--audience {
    gap: 6px;
}

.gm-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 0;
    padding-top: 6px;
    overflow-y: auto;
}

.gm-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--dark-border-2);
    border-radius: 999px;
    background: transparent;
    font: 700 12px/1 var(--font-condensed);
    letter-spacing: 0.06em;
    color: var(--dark-fg-2);
    cursor: pointer;
}

.gm-chip:hover {
    color: #fff;
}

.gm-chip--on {
    border-color: color-mix(in srgb, var(--hat-color, var(--thonon-yellow)) 60%, transparent);
    background: color-mix(in srgb, var(--hat-color, var(--thonon-yellow)) 16%, transparent);
    color: #fff;
}

/* A choice that takes its hat's tint once chosen: who is written to, who an announcement is for. */
.gm-choice--hat.gm-choice--on {
    border-color: color-mix(in srgb, var(--hat-color, var(--thonon-yellow)) 55%, transparent);
    background: color-mix(in srgb, var(--hat-color, var(--thonon-yellow)) 12%, transparent);
}

.gm-choice--hat.gm-choice--on .gm-choice__radio {
    border-color: var(--hat-color, var(--thonon-yellow));
}

.gm-choice--hat.gm-choice--on .gm-choice__radio::after {
    background: var(--hat-color, var(--thonon-yellow));
}

.gm-choice:disabled {
    cursor: default;
    opacity: 0.55;
}

/* ── « Nouveau message »: a direct message, in a drawer ──── */

.gm-new-btn {
    flex-shrink: 0;
    gap: 6px;
    height: 34px;
    margin-left: auto;
    padding: 0 12px;
}

.gm-new-btn svg,
.gm-search svg,
.gm-drawer__foot svg {
    flex-shrink: 0;
    fill: currentColor;
}

.gl-drawer.gm-drawer {
    width: min(420px, 100vw);
    border-left-color: var(--dark-border-2);
    background: var(--thonon-night);
}

.gm-drawer__head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    height: 60px;
    padding: 0 12px 0 18px;
    border-bottom: 1px solid var(--dark-border-1);
}

.gm-drawer__title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font: 700 16px/1 var(--font-condensed);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
}

.gm-drawer__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1 1 auto;
    min-height: 0;
    padding: 16px 18px;
    overflow-y: auto;
}

.gm-drawer__field,
.gm-drawer__group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gm-drawer__label {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0;
    font: 700 12px/1.2 var(--font-condensed);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--dark-fg-2);
}

.gm-drawer__scope {
    font: 400 12px/1.2 var(--font-body);
    letter-spacing: 0;
    text-transform: none;
    color: var(--dark-fg-3);
}

.gm-search {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--dark-border-2);
    border-radius: 4px;
    background: var(--thonon-black);
    color: var(--dark-fg-2);
}

.gm-search:focus-within {
    border-color: var(--thonon-yellow);
}

.gm-search__input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    font: 400 13px/1 var(--font-body);
    color: var(--dark-fg-1);
    outline: none;
}

.gm-search__input::placeholder {
    color: var(--dark-fg-3);
}

.gm-search__input::-webkit-search-cancel-button {
    filter: invert(1) opacity(0.6);
}

.gm-drawer__choices {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.gm-choice__tag {
    flex-shrink: 0;
    padding: 4px 8px;
    border: 1px solid var(--dark-border-2);
    border-radius: 999px;
    font: 700 12px/1 var(--font-condensed);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--dark-fg-2);
}

.gm-drawer__note {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--dark-fg-2);
    text-wrap: pretty;
}

.gm-minor.gm-drawer__minor {
    margin: 0;
}

.gm-compose__input.gm-drawer__text {
    flex: none;
    min-height: 104px;
    max-height: 260px;
    background: var(--thonon-black);
}

.gm-drawer__skel {
    display: block;
    height: 46px;
    margin-bottom: 5px;
    border-radius: 4px;
}

.gm-drawer__foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--dark-border-1);
}

.gm-drawer__foot .gi-btn {
    gap: 7px;
    height: 38px;
}

/* ── Phone: one column, the page itself scrolls ─────────── */

@media (max-width: 1099px) {
    .gi.gm {
        display: block;
        height: auto;
    }

    .gm-list {
        border-right: 0;
    }

    /* The top bar already names the page. */
    .gm-list__head {
        height: auto;
        padding: 0 16px;
    }

    /* The past seasons are not what the top bar names. */
    .gm-list__head--archives {
        height: 48px;
        padding: 0 12px 0 4px;
    }

    .gm-list__title--shown {
        display: block;
        font-size: 13px;
        letter-spacing: 0.10em;
    }

    .gm-list__unread {
        display: block;
        padding: 10px 0 0;
        flex: 1 1 auto;
    }

    .gm-list__scroll {
        overflow: visible;
        padding: 0 12px 12px;
    }

    .gm-list__state {
        min-height: 60vh;
    }

    .gm-row {
        height: 68px;
    }

    .gm-pane {
        display: none;
    }

    /* A thread takes the list's place, and the whole height between the top bar and the dock:
       its messages scroll inside, so the latest stays in sight above what stands at its foot. */
    .gm--open .gm-list {
        display: none;
    }

    .gm-head {
        gap: 5px;
        height: 56px;
        padding: 0 12px 0 4px;
    }

    .gm-head__back,
    .gm-head--bare {
        display: flex;
    }

    /* The back arrow stands where the icon was; the hat is told by its pill, at the far end. */
    .gm-head__icon {
        display: none;
    }

    .gm-head__text {
        gap: 3px;
    }

    .gm-head__line {
        justify-content: space-between;
    }

    .gm-head__title {
        font-size: 13px;
        letter-spacing: 0.10em;
    }

    .gm-head__info {
        font-size: 12px;
    }

    .gm-minor {
        margin: 8px 10px 0;
    }

    .gm-scroll {
        padding: 6px 10px 8px;
    }

    .gm-msg {
        padding: 8px 6px;
    }

    .gm-deleted {
        padding-left: 49px;
    }

    .gm-readonly {
        padding: 12px 14px;
    }

    .gm-card {
        width: 100%;
    }

    .gm-card__head,
    .gm-card__foot {
        padding: 12px 13px;
    }

    .gm-card__title {
        font-size: 17px;
    }

    /* Stacked and full width: each answer is a thumb's target. */
    .gm-card__buttons {
        flex-direction: column;
    }

    .gm-card__buttons .gi-btn {
        flex: none;
        width: 100%;
        height: 44px;
    }

    .gm-card__change {
        height: 44px;
    }

    .gm-compose {
        padding: 10px 12px;
    }

    .gm-compose__event {
        width: 44px;
        height: 44px;
    }

    /* 16 px: below, a phone zooms in on the field it focuses. */
    .gm-compose__input {
        min-height: 44px;
        padding: 9px 12px;
        font-size: 16px;
        line-height: 1.5;
    }

    /* A square arrow: the label would take the field's room. */
    .gm-compose__send {
        width: 44px;
        height: 44px;
        padding: 0;
        justify-content: center;
    }

    .gm-compose__send-label {
        display: none;
    }

    .gm-pick {
        left: 12px;
        max-width: calc(100% - 24px);
    }

    /* A square « + » beside what is unread: the top bar already names the page. */
    .gm-new-btn {
        width: 44px;
        height: 44px;
        margin-top: 8px;
        padding: 0;
        justify-content: center;
    }

    .gm-new-btn__label {
        display: none;
    }

    .gm-compose__audience {
        flex-wrap: wrap;
        gap: 6px 10px;
    }

    .gm-audience {
        height: 36px;
    }

    .gm-chip {
        height: 36px;
    }

    .gm-search {
        height: 44px;
    }

    /* 16 px: below, a phone zooms in on the field it focuses. */
    .gm-search__input {
        font-size: 16px;
    }

    .gm-drawer__foot .gi-btn {
        flex: 1 1 0;
        height: 46px;
        justify-content: center;
    }
}


/* ── Search, filters and the selection bar ── */

.gm-find {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px 14px;
    border-bottom: 1px solid var(--dark-border-1);
}

.gm-listsearch {
    position: relative;
    display: block;
}

.gm-listsearch svg {
    position: absolute;
    left: 12px;
    top: 12px;
    fill: var(--dark-fg-3);
    pointer-events: none;
}

.gm-listsearch input {
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none;
    outline-offset: 0;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px 10px 42px;
    border: 1px solid var(--dark-border-2);
    border-radius: var(--radius-control);
    background: var(--thonon-field);
    color: #fff;
    font: 400 16px/1.2 var(--font-body);
}

.gm-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.gm-filter {
    flex: none;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--dark-border-2);
    border-radius: 999px;
    background: transparent;
    color: var(--dark-fg-2);
    font: 700 14px/1 var(--font-condensed);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
}

.gm-filter--on {
    border-color: #fff;
    background: #fff;
    color: var(--thonon-black);
}

.gm-none {
    margin: 0;
    padding: 24px 16px;
    font-size: 15px;
    color: var(--dark-fg-2);
}

/* A message selected by a long press, and the bar that takes the thread's head. */
.gm-msg--selected {
    border-radius: var(--radius-card);
    box-shadow: 0 0 0 3px rgba(52, 164, 224, 0.55);
}

.gm-head--hidden { display: none; }

.gm-selbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    height: var(--top-height);
    padding: 0 8px;
    border-bottom: 1px solid var(--dark-border-1);
    background: var(--thonon-graphite);
}

.gm-selbar__count {
    flex: 1;
    font: 700 15px/1 var(--font-condensed);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.gm-selbar__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    cursor: pointer;
}

.gm-selbar__btn svg { fill: currentColor; }
.gm-selbar__btn--danger { color: #FF8A93; }

/* Under 1100 px an open thread takes the whole screen: no top bar, no dock, a way back. */
@media (max-width: 1099px) {
    body:has(.gm--open) .app-topbar,
    body:has(.gm--open) .mob-dock {
        display: none;
    }

    body:has(.gm--open) .app-body {
        padding-bottom: 0;
    }

    .gm--open .gm-pane {
        display: flex;
        height: calc(100dvh - env(safe-area-inset-top, 0px));
    }

    .gm-list__title {
        display: block;
    }
}

/* Messages as bubbles: others' on the left in graphite, mine on the right in the club's deep blue,
   without my own avatar; nothing under a bubble. A call's card keeps its width. */
.gm-msg .gm-msg__body {
    flex: 0 1 auto;
    padding: 10px 14px;
    border: 1px solid var(--dark-border-2);
    border-radius: var(--radius-card);
    background: var(--thonon-graphite);
}

.gm-msg--mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.gm-msg--mine > .gm-avatar { display: none; }

.gm-msg--mine .gm-msg__body {
    border-color: #1A77AD;
    background: #0B5F8F;
}

.gm-msg--mine:hover,
.gm-msg--mine:focus-within,
.gm-msg--menu { background: transparent; }

.gm-msg .gm-card { min-width: min(420px, 70vw); }

@media (max-width: 1099px) {
    body:has(.env-banner) .gm--open .gm-pane {
        height: calc(100dvh - 32px - env(safe-area-inset-top, 0px));
    }
}
