/* =====================================================================
   ORBIX — reusable components
   Buttons, fields, avatars, badges, menus, modals, toasts, tooltips
   ===================================================================== */

/* ---------------------------------------------------------------- */
/* Buttons                                                           */
/* ---------------------------------------------------------------- */
.btn {
    --btn-bg: var(--surface-3);
    --btn-fg: var(--text);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: var(--r-sm);
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-size: .875rem;
    font-weight: 600;
    letter-spacing: .01em;
    white-space: nowrap;
    transition: transform var(--fast), filter var(--fast), box-shadow var(--mid), background var(--fast);
}
.btn:hover { filter: brightness(1.14); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: none; }
.btn svg { width: 16px; height: 16px; }

/* Flat colour and no halo: the primary button is already the only filled
   thing on most screens, which is as much emphasis as it needs. */
.btn--primary {
    --btn-fg: #fff;
    --btn-bg: var(--accent-deep);
}
.btn--primary:hover { --btn-bg: #60599F; filter: none; }

.btn--ghost {
    --btn-bg: transparent;
    --btn-fg: var(--text-dim);
    border: 1px solid var(--line-strong);
}
.btn--ghost:hover { --btn-fg: var(--text); background: var(--surface-2); filter: none; }

.btn--danger { --btn-bg: var(--danger-dim); --btn-fg: var(--danger); }
.btn--danger:hover { background: var(--danger); --btn-fg: #fff; filter: none; }

.btn--block { width: 100%; }
.btn--sm { padding: 6px 11px; font-size: .8125rem; }

.icon-btn {
    width: 32px; height: 32px;
    display: grid;
    place-items: center;
    border-radius: var(--r-sm);
    color: var(--text-dim);
    transition: background var(--fast), color var(--fast);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.is-active { color: var(--accent-2); background: var(--surface-3); }
.icon-btn svg { width: 17px; height: 17px; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 99px;
    background: var(--surface-3);
    border: 1px solid var(--line);
    color: var(--text-dim);
    font-size: .75rem;
    font-weight: 600;
    transition: background var(--fast), color var(--fast), border-color var(--fast);
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip--accent {
    background: rgb(var(--accent-rgb) / .18);
    border-color: rgb(var(--accent-rgb) / .45);
    color: var(--accent-soft);
}
.chip svg { width: 13px; height: 13px; }

/* ---------------------------------------------------------------- */
/* Fields                                                            */
/* ---------------------------------------------------------------- */
.field { display: block; margin-bottom: 16px; }
.field__label {
    display: block;
    margin-bottom: 6px;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.field__hint { margin-top: 6px; font-size: .75rem; color: var(--text-faint); line-height: 1.5; }
.field__error { margin-top: 6px; font-size: .75rem; color: var(--danger); }

.input, .textarea, .select {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    background: var(--surface-0);
    border: 1px solid var(--line-strong);
    color: var(--text);
    font-size: .875rem;
    transition: border-color var(--fast), box-shadow var(--mid), background var(--fast);
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:focus, .textarea:focus, .select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .18);
    background: var(--surface-2);
}
.input[aria-invalid="true"] { border-color: var(--danger); }
.textarea { resize: vertical; min-height: 84px; line-height: 1.55; }
.select { appearance: none; cursor: pointer; padding-right: 34px;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-faint) 50%),
                      linear-gradient(135deg, var(--text-faint) 50%, transparent 50%);
    background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}
.select option { background: var(--surface-2); }

.switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
}
.switch:last-child { border-bottom: 0; }
.switch__text { font-size: .875rem; }
.switch__sub { font-size: .75rem; color: var(--text-faint); margin-top: 2px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track {
    flex: none;
    position: relative;
    width: 40px; height: 22px;
    border-radius: 99px;
    background: var(--surface-4);
    transition: background var(--mid);
}
.switch__track::after {
    content: "";
    position: absolute;
    top: 3px; left: 3px;
    width: 16px; height: 16px;
    border-radius: 99px;
    background: var(--text-dim);
    transition: transform var(--mid), background var(--mid);
}
.switch input:checked + .switch__track { background: rgb(var(--accent-rgb) / .5); }
.switch input:checked + .switch__track::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 2px solid transparent;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
    transition: transform var(--fast), border-color var(--fast);
}
.swatch:hover { transform: scale(1.12); }
.swatch.is-active { border-color: #fff; transform: scale(1.12); }

/* The picker swatch wraps a same-size, fully transparent native colour
   input — clicking anywhere on the circle opens the OS colour dialog,
   and `overflow: hidden` keeps that input's own focus ring from poking
   out past the circle it's meant to be invisible inside. */
.swatch--picker {
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: var(--surface-3);
    color: var(--text-faint);
}
.swatch--picker.is-active { color: #fff; }
.swatch--picker svg { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- */
/* Avatars and presence                                              */
/* ---------------------------------------------------------------- */
.avatar {
    position: relative;
    flex: none;
    display: grid;
    place-items: center;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--surface-3);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .02em;
    overflow: hidden;
    user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.avatar--sm { width: 26px; height: 26px; font-size: .625rem; }
.avatar--lg { width: 46px; height: 46px; font-size: .9375rem; }
.avatar--xl { width: 84px; height: 84px; font-size: 1.5rem; }

.avatar-wrap { position: relative; flex: none; }
.dot {
    position: absolute;
    right: -1px; bottom: -1px;
    width: 12px; height: 12px;
    border-radius: 50%;
    border: 2.5px solid var(--surface-1s);
    background: var(--on-offline);
}
.dot--lg { width: 17px; height: 17px; border-width: 3.5px; }
.dot[data-presence="online"]  { background: var(--on-online); }
.dot[data-presence="idle"]    { background: var(--on-idle); }
.dot[data-presence="busy"]    { background: var(--on-busy); }
.dot[data-presence="offline"] { background: var(--on-offline); }

/* ---------------------------------------------------------------- */
/* Menus (right-click and dropdown)                                  */
/* ---------------------------------------------------------------- */
.menu {
    position: fixed;
    z-index: 120;
    min-width: 208px;
    max-width: 280px;
    padding: 6px;
    border-radius: var(--r-md);
    background: var(--glass);
    backdrop-filter: blur(18px);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-3);
    animation: menuIn 140ms var(--ease) both;
}
@keyframes menuIn {
    from { opacity: 0; transform: translateY(-6px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
.menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    color: var(--text-dim);
    font-size: .8125rem;
    text-align: left;
    transition: background var(--fast), color var(--fast);
}
.menu__item:hover { background: var(--surface-3); color: var(--text); }
.menu__item svg { width: 15px; height: 15px; flex: none; }
.menu__item--danger { color: var(--danger); }
.menu__item--danger:hover { background: var(--danger-dim); color: var(--danger); }
.menu__item[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.menu__sep { height: 1px; margin: 5px 8px; background: var(--line); }
.menu__label {
    padding: 8px 10px 5px;
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-faint);
}
.menu__shortcut { margin-left: auto; font-size: .6875rem; color: var(--text-faint); }

/* ---------------------------------------------------------------- */
/* Modals                                                            */
/* ---------------------------------------------------------------- */
.modal-scrim {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgb(0 0 0 / .74);
    backdrop-filter: blur(6px);
    animation: fadeIn var(--fast) both;
}
/* A column, not fixed grid rows: a dialog has a head, an optional tab
   strip, a body and an optional footer, so the row a section lands in
   depends on which ones are present. Sizing the body instead — the only
   part that ever scrolls — keeps every combination correct. */
.modal {
    position: relative;
    width: min(560px, 100%);
    max-height: min(86dvh, 780px);
    display: flex;
    flex-direction: column;
    border-radius: var(--r-lg);
    background: var(--surface-1s);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-3);
    overflow: hidden;
    animation: modalIn 240ms var(--ease) both;
}
.modal--wide { width: min(880px, 100%); }
.modal--tall { max-height: min(90dvh, 900px); }
@keyframes modalIn {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

/* The corner brackets that used to sit here are gone. A decoration
   drawn on every dialog is a decoration nobody reads twice, and it made
   the whole app look like a heads-up display. */

.modal__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--line);
}
.modal__title { font-size: 1.0625rem; }
.modal__sub { margin-top: 3px; font-size: .8125rem; color: var(--text-faint); }
.modal__close { margin-left: auto; }
.modal__head, .modal__foot, .modal > .tabs { flex: none; }
.modal__body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 20px 22px;
    overflow-y: auto;
    scrollbar-width: thin;
}
.modal__foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px 18px;
    border-top: 1px solid var(--line);
    background: rgb(0 0 0 / .5);
}
.modal__foot .grow { text-align: left; font-size: .8125rem; color: var(--text-faint); }

/* Tabbed settings dialogs */
.tabs {
    display: flex;
    gap: 4px;
    padding: 0 22px;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    position: relative;
    padding: 11px 12px;
    color: var(--text-faint);
    font-size: .8125rem;
    font-weight: 600;
    white-space: nowrap;
    transition: color var(--fast);
}
.tab:hover { color: var(--text-dim); }
.tab.is-active { color: var(--text); }
.tab.is-active::after {
    content: "";
    position: absolute;
    left: 8px; right: 8px; bottom: -1px;
    height: 2px;
    border-radius: 99px;
    background: var(--beam);
}

/* ---------------------------------------------------------------- */
/* Toasts                                                            */
/* ---------------------------------------------------------------- */
.toasts {
    position: fixed;
    right: 18px; bottom: 18px;
    z-index: 150;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(360px, calc(100vw - 36px));
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--r-md);
    background: var(--glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--accent);
    box-shadow: var(--shadow-2);
    font-size: .8125rem;
    animation: toastIn 260ms var(--ease) both;
}
.toast.is-leaving { animation: toastOut 200ms var(--ease) both; }
.toast--error { border-left-color: var(--danger); }
.toast--ok { border-left-color: var(--ok); }
.toast__icon { flex: none; margin-top: 1px; }
.toast__icon svg { width: 16px; height: 16px; }
.toast--error .toast__icon { color: var(--danger); }
.toast--ok .toast__icon { color: var(--ok); }
.toast__body { flex: 1 1 auto; min-width: 0; line-height: 1.5; }
.toast__title { font-weight: 650; margin-bottom: 2px; }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: none; }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateX(24px); }
}

/* ---------------------------------------------------------------- */
/* Tooltips                                                          */
/* ---------------------------------------------------------------- */
.tip {
    position: fixed;
    z-index: 140;
    padding: 5px 9px;
    border-radius: 6px;
    background: #0B0C0F;
    border: 1px solid var(--line-strong);
    color: var(--text);
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: var(--shadow-2);
    animation: fadeIn 100ms var(--ease) both;
}

/* ---------------------------------------------------------------- */
/* Profile card                                                      */
/* ---------------------------------------------------------------- */
.profile__banner {
    height: 74px;
    margin: -20px -22px 0;
    background: var(--beam-dim);
    border-bottom: 1px solid var(--line);
}
.profile__top { display: flex; align-items: flex-end; gap: 14px; margin-top: -28px; padding: 0 2px; }
.profile__avatar {
    border: 4px solid var(--surface-1s);
    border-radius: 50%;
    /* A ring in the person's own accent, the way a Discord avatar's
       decoration reads against the card behind it — subtle since it is
       drawn as a shadow, not another border fighting the real one. */
    box-shadow: 0 0 0 2px var(--profile-accent, transparent);
}
.profile__name { display: flex; align-items: center; gap: 2px; font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; }
.profile__handle { font-size: .8125rem; color: var(--text-faint); }
/* Small badge tiles under the handle — a shelf, not a decoration stuck
   on the name itself, so a second badge later just takes its place in
   the row instead of crowding the title. */
.profile__badges { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.profile__meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px 18px;
    margin-top: 18px;
}
.profile__block { margin-top: 18px; }
.profile__meta-grid .profile__block { margin-top: 0; }
.profile__block h4 {
    margin-bottom: 6px;
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-faint);
}
.profile__bio { font-size: .875rem; color: var(--text-dim); line-height: 1.6; white-space: pre-wrap; }
.profile__stations { display: flex; flex-wrap: wrap; gap: 8px; }
.profile__station {
    display: flex; align-items: center; gap: 7px;
    padding: 5px 10px 5px 5px;
    border-radius: 99px;
    background: var(--surface-2);
    font-size: .75rem;
}
.profile__station-icon { width: 20px; height: 20px; border-radius: 6px; font-size: .5625rem; }
.profile__block h4 { display: flex; align-items: center; gap: 8px; }

/* ---------------------------------------------------------------- */
/* ORBIX staff                                                       */
/*                                                                   */
/* One emblem for moderators and admins alike, and only on a profile.*/
/* The chip below is the moderation console's own: there the tier is */
/* the thing being managed, so there it is spelled out.              */
/* ---------------------------------------------------------------- */
.staff-mark {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: var(--r-sm);
    background: linear-gradient(155deg, rgb(var(--accent-rgb) / .35), rgb(var(--accent-rgb) / .16));
    border: 1px solid rgb(var(--accent-rgb) / .5);
    color: var(--accent-soft);
    flex: none;
    transition: transform var(--fast);
}
.staff-mark:hover { transform: translateY(-1px); }
.staff-mark svg { width: 14px; height: 14px; }

.staff-note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    background: rgb(var(--accent-rgb) / .12);
    border: 1px solid rgb(var(--accent-rgb) / .3);
    font-size: .8125rem;
    color: #D2CFE6;
}
.staff-note svg { width: 18px; height: 18px; flex: none; }
.staff-note strong { display: block; font-size: .8125rem; }
.staff-note__sub { display: block; color: var(--text-dim); font-size: .75rem; margin-top: 1px; }

/* The banner over a staff removal form, so nobody fills one in
   thinking it is an ordinary station delete. */
.staff-callout {
    display: flex;
    gap: 11px;
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: var(--r-sm);
    background: rgb(var(--danger-rgb) / .1);
    border: 1px solid rgb(var(--danger-rgb) / .32);
}
.staff-callout svg { width: 19px; height: 19px; flex: none; color: var(--danger); }
.staff-callout__title { font-size: .8125rem; font-weight: 700; color: #E7B9C1; }
.staff-callout__text { font-size: .75rem; color: var(--text-dim); line-height: 1.6; margin-top: 3px; }

/* A copy of reported or removed content, shown verbatim. Both the
   moderation console and the chat app's removal form use it. */
.snapshot {
    padding: 12px 14px;
    border-radius: var(--r-sm);
    background: var(--surface-0);
    border: 1px solid var(--line-strong);
    font-family: var(--font-mono);
    font-size: .75rem;
    line-height: 1.65;
    color: #C4C7D0;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 220px;
    overflow-y: auto;
}
.snapshot__label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.staff-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 99px;
    background: rgb(var(--accent-rgb) / .2);
    border: 1px solid rgb(var(--accent-rgb) / .45);
    color: var(--accent-soft);
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    vertical-align: 1px;
    white-space: nowrap;
    flex: none;
}
.staff-chip--moderator {
    background: rgb(var(--accent-2-rgb) / .14);
    border-color: rgb(var(--accent-2-rgb) / .36);
    color: var(--accent-2);
}
.staff-chip svg { width: 10px; height: 10px; }

/* ---------------------------------------------------------------- */
/* Station tags and role styling                                     */
/* ---------------------------------------------------------------- */
.station-tag {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 5px;
    background: color-mix(in srgb, var(--tag-color, var(--accent)) 26%, transparent);
    border: 1px solid color-mix(in srgb, var(--tag-color, var(--accent)) 55%, transparent);
    color: var(--tag-color, var(--accent-soft));
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: 1px;
    flex: none;
}

/* Browsers without color-mix() still get a readable tag. */
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
    .station-tag { background: var(--surface-3); border-color: var(--line-strong); }
}

.role-icon { font-size: .875rem; line-height: 1; flex: none; }
.role-icon--lg { font-size: 1.125rem; }

/* A gradient name. The flat colour stays set underneath, so anything
   that cannot clip a background to text still shows the role colour. */
.is-gradient {
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.role-sample {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: -6px 0 18px;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    background: var(--surface-0);
    border: 1px solid var(--line);
}
.role-sample__name { font-size: .9375rem; font-weight: 650; }
.role-sample__msg { font-size: .75rem; color: var(--text-faint); }

.perk-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 28px 0 12px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}
.perk-head__free {
    padding: 2px 8px;
    border-radius: 99px;
    background: rgb(var(--ok-rgb) / .14);
    border: 1px solid rgb(var(--ok-rgb) / .3);
    color: var(--ok);
    font-size: .625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.field__prefix {
    font-family: var(--font-mono);
    font-size: .8125rem;
    color: var(--text-faint);
    white-space: nowrap;
}

/* ---------------------------------------------------------------- */
/* Toolbars, filter chips and pagers                                 */
/*                                                                   */
/* Shared by the moderation console and the station directory, so    */
/* they belong here rather than in admin.css.                        */
/* ---------------------------------------------------------------- */
.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.toolbar .input, .toolbar .select { width: auto; min-width: 160px; }
.toolbar__search { flex: 1 1 240px; min-width: 0; }
.toolbar__search .input { width: 100%; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter {
    padding: 6px 13px;
    border-radius: 99px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text-faint);
    font-size: .75rem;
    font-weight: 650;
    transition: background var(--fast), color var(--fast), border-color var(--fast);
}
.filter:hover { color: var(--text-dim); border-color: var(--line-strong); }
.filter.is-active {
    background: rgb(var(--accent-rgb) / .2);
    border-color: rgb(var(--accent-rgb) / .5);
    color: var(--accent-soft);
}

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
    font-size: .8125rem;
    color: var(--text-faint);
}

/* ---------------------------------------------------------------- */
/* Station directory                                                 */
/* ---------------------------------------------------------------- */
.discover__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}
.discover__card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-radius: var(--r-md);
    background: var(--surface-2);
    border: 1px solid var(--line);
    transition: border-color var(--fast);
}
.discover__card:hover { border-color: var(--line-strong); }
.discover__head { display: flex; align-items: center; gap: 11px; min-width: 0; }
/* The name wraps rather than truncating: a card is wide enough for two
   lines, and half a station's name is no use to anyone browsing. */
.discover__name {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    min-width: 0;
    font-weight: 650;
    line-height: 1.3;
}
.discover__meta { font-size: .75rem; color: var(--text-faint); margin-top: 2px; }
.discover__blurb {
    flex: 1 1 auto;
    font-size: .8125rem;
    color: var(--text-dim);
    line-height: 1.55;
    /* Descriptions vary wildly in length; clamping keeps the grid even. */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.discover__foot { display: flex; justify-content: flex-end; }

/* Progress toward the directory threshold. */
.progress {
    height: 6px;
    margin-top: 10px;
    border-radius: 99px;
    background: var(--surface-3);
    overflow: hidden;
}
.progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width var(--mid);
}

.list-row--feature {
    background: rgb(var(--accent-rgb) / .09);
    border: 1px solid rgb(var(--accent-rgb) / .3);
}

/* Instance-wide notice set by an administrator. */
.instance-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgb(var(--accent-rgb) / .1);
    border-bottom: 1px solid var(--line-strong);
    color: #D2CFE6;
    font-size: .8125rem;
    animation: fadeIn var(--mid) both;
}
.instance-notice svg { flex: none; }

/* ---------------------------------------------------------------- */
/* Member tag — a station's tag, worn on a person                   */
/*                                                                   */
/* Deliberately neutral chrome rather than tinted by the station's   */
/* colour: this sits right next to a name in dense places (the       */
/* message list, the crew list), and a second splash of colour there */
/* would compete with the name colour a role already provides.       */
/* ---------------------------------------------------------------- */
.member-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 6px 1px 3px;
    border-radius: 5px;
    background: var(--surface-3);
    border: 1px solid var(--line-strong);
    color: var(--text-dim);
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .01em;
    white-space: nowrap;
    vertical-align: 1px;
    flex: none;
}
.member-tag__icon, .member-tag__icon-fallback {
    width: 12px; height: 12px;
    border-radius: 3px;
    flex: none;
}
.member-tag__icon { object-fit: cover; }
.member-tag__icon-fallback {
    display: grid;
    place-items: center;
    font-size: .5rem;
    font-weight: 800;
    color: #fff;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 99px;
    background: var(--surface-3);
    font-size: .6875rem;
    font-weight: 650;
}
.tag__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* A role, the way it appears on a profile card — a tinted pill rather
   than flat chrome with only the text coloured, closer to how a role's
   colour actually reads on Discord. */
.role-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px 4px 8px;
    border-radius: 99px;
    background: color-mix(in srgb, var(--role-color, var(--text-faint)) 18%, var(--surface-2));
    border: 1px solid color-mix(in srgb, var(--role-color, var(--text-faint)) 40%, var(--line));
    color: var(--text);
    font-size: .75rem;
    font-weight: 650;
}
.role-pill__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.role-pill__icon { font-size: .8125rem; line-height: 1; flex: none; }
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
    .role-pill { background: var(--surface-3); border-color: var(--line-strong); }
}

/* ---------------------------------------------------------------- */
/* Lists used in settings dialogs                                    */
/* ---------------------------------------------------------------- */
.list-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px;
    border-radius: var(--r-sm);
    background: var(--surface-2);
    margin-bottom: 8px;
}
.list-row__title { font-size: .875rem; font-weight: 600; }
.list-row__sub { font-size: .75rem; color: var(--text-faint); margin-top: 1px; }
.list-row__actions { margin-left: auto; display: flex; gap: 6px; flex: none; }
.list-row.is-clickable { cursor: pointer; transition: background var(--fast); }
.list-row.is-clickable:hover { background: var(--surface-3); }

.empty {
    padding: 34px 20px;
    text-align: center;
    color: var(--text-faint);
    font-size: .875rem;
    line-height: 1.6;
}
.empty svg { width: 34px; height: 34px; margin-bottom: 12px; opacity: .5; }

.perm-grid { display: grid; gap: 2px; }
.perm-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    transition: background var(--fast);
}
.perm-row:hover { background: var(--surface-2); }
.perm-row__name { font-size: .875rem; font-weight: 550; }
.perm-row__desc { font-size: .75rem; color: var(--text-faint); margin-top: 2px; }
.perm-row.is-disabled { opacity: .5; }
.perm-row.is-disabled:hover { background: none; }
.perm-row.is-disabled .perm-row__name { color: var(--text-faint); }
/* The row's own checkbox isn't wrapped in a .switch label the way every
   other toggle in the app is, so it needs the same three declarations
   .switch normally gives it for free — otherwise the browser's native
   box renders on top of the styled track instead of driving it. */
.perm-row input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
.perm-row input:checked + .switch__track { background: rgb(var(--accent-rgb) / .5); }
.perm-row input:checked + .switch__track::after { transform: translateX(18px); background: #fff; }
.perm-row input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }

.code-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: var(--r-sm);
    background: var(--surface-0);
    border: 1px solid var(--line-strong);
    font-family: var(--font-mono);
    font-size: .8125rem;
    color: var(--accent-2);
    word-break: break-all;
}

/* ---------------------------------------------------------------- */
/* Lightbox                                                          */
/* ---------------------------------------------------------------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 160;
    display: grid;
    place-items: center;
    gap: 14px;
    padding: 40px;
    background: rgb(0 0 0 / .9);
    backdrop-filter: blur(8px);
    animation: fadeIn var(--fast) both;
}
.lightbox img {
    max-width: 100%;
    max-height: 78dvh;
    border-radius: var(--r-md);
    box-shadow: var(--shadow-3);
}
.lightbox__close {
    position: absolute;
    top: 18px; right: 22px;
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text);
    font-size: 1.5rem;
    line-height: 1;
}
.lightbox__close:hover { background: var(--surface-3); }
.lightbox__download { font-size: .8125rem; }
