/* Hallmark · shape: app screen · genre: editorial · theme: brand · nav: kept (TrailTrack header, avatar menu, phone tab bar) · signature: the account ledger, one column of labelled rows with the value or the switch on the right and one save bar · states: loading, empty, error, full
 * axes: light paper/grotesk display/orange signal · contrast: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E4 S4 R4 V3 · weakest: V, these are app screens inside a locked system, so they share the kit on purpose; the ledger rows, the thread and the photo grid carry the member's own data instead of stat cards */
/* Hallmark · answered F7 · the pill is the shape of every control and of the live state chips (unread, role, status) in the kit this group extends */
/* Hallmark · waive 72 · the thread and the chat list scroll in their own panes, so lines above the fold sit clipped by overflow and long chat previews end in an ellipsis · a messenger keeps its newest message in view and its list on one line per chat */
/* Hallmark · dismissed F4 · the round send button and the empty-state «Новый чат» never show together: one belongs to an open chat, the other to the window with no chat */
/* Hallmark · dismissed F25 · on a phone the messenger is two steps, the chat list and then one chat with a back button, so the list is one tap away and nothing is cut */
/* Hallmark · answered F19 · four weights are the owner's typography system: Inter 400 and 500 for text, 600 for buttons and titles, Manrope 700 for heads */

/* Account screens: settings, profile editing, messages, notifications, albums, one album, club settings.
   Built on the social.css tokens and kit; only the colours below are new. */

:root {
    --acc-danger: #b42318;
    --acc-danger-soft: #fdecea;
    --acc-bubble-in: #eef0ec;
    --acc-on-danger: var(--on-accent);
    --acc-danger-hover: #912018;
    --acc-nav-w: 248px;
    --acc-bar-h: 68px;
}
:root[data-theme="dark"] {
    --acc-danger: #ff8f80;
    --acc-danger-soft: #2e1a18;
    --acc-bubble-in: #1f282c;
    --acc-on-danger: var(--ink-fixed);
    --acc-danger-hover: #ffb0a5;
}

/* ---------- frame ---------- */
.acc { padding: 32px 0 96px; }
.acc .crumbs { margin-bottom: 12px; }
.acc .crumbs a { display: inline-flex; align-items: center; min-height: 32px; }
.acc-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 32px; }
.acc-head__titles { display: grid; gap: 4px; min-width: 0; }
.acc-title { font-size: var(--fs-h2); line-height: var(--lh-h2); overflow-wrap: break-word; min-width: 0; }
.acc-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; color: var(--copy); font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
.acc-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.acc-h2 { font-size: var(--fs-h3); line-height: var(--lh-h3); }
.acc-h3 { font: var(--fw-title) var(--fs-h4)/var(--lh-h4) var(--font-display); letter-spacing: var(--ls-heading); }
.acc-demo { margin-left: 8px; vertical-align: middle; }
.acc-sec { display: grid; gap: 16px; }
.acc-sec + .acc-sec { margin-top: 48px; }
.acc-sec__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.acc-sec__head > div { display: grid; gap: 4px; }
.acc-sec__head p { color: var(--copy); font-size: var(--fs-small); }
.acc-note { color: var(--copy); font-size: var(--fs-small); line-height: var(--lh-small); }
.acc .btn .icon { width: 18px; height: 18px; }

/* ---------- settings frame: a section list and one panel ---------- */
.acc-layout { display: grid; grid-template-columns: var(--acc-nav-w) minmax(0, 1fr); gap: 40px; align-items: start; }
.acc-main { display: grid; gap: 24px; width: 100%; min-width: 0; }
/* three container widths: wide 1240 (the wrap), medium 960, narrow 720 */
.acc-mid { width: min(100%, 960px); margin-inline: auto; }
.acc-narrow { width: min(100%, 720px); margin-inline: auto; }
.acc-nav { position: sticky; top: 92px; display: grid; gap: 4px; }
.acc-nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; color: var(--ink-2); font-size: var(--fs-small); font-weight: var(--fw-ui); }
.acc-nav a:hover { background: var(--bg-soft); color: var(--ink); }
.acc-nav a[aria-current="page"] { background: var(--bg-soft); color: var(--ink); font-weight: var(--fw-button); box-shadow: inset 2px 0 0 var(--orange); }
.acc-nav .icon { width: 18px; height: 18px; color: var(--quiet); }
.acc-nav a[aria-current="page"] .icon { color: var(--orange-ink); }
.acc-nav .count-badge { margin-left: auto; }
.acc-nav__sep { height: 1px; margin: 8px 12px; background: var(--line); }
.acc-nav__me { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 8px 12px 16px; border-bottom: 1px solid var(--line); border-radius: 0 !important; }
.acc-nav__me:hover b { text-decoration: underline; text-underline-offset: 3px; }
.acc-nav a.acc-nav__me:hover { background: none; }
.acc-nav__me img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.acc-nav__me b { display: block; font-size: var(--fs-small); font-weight: var(--fw-button); }
.acc-nav__me span span { display: block; color: var(--quiet); font-size: var(--fs-caption); }
.acc-back { display: none; }
.acc-panel { display: grid; gap: 24px; scroll-margin-top: 92px; }
.acc-panel:focus { outline: none; }
.acc-panel:focus-visible { outline: 2px solid var(--focus); outline-offset: 8px; }
.acc-panel__head { display: grid; gap: 4px; }
.acc-panel__head p { color: var(--copy); font-size: var(--fs-body); }

/* ---------- the ledger: labelled rows, the value or control on the right ---------- */
.ledger { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.ledger__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 24px; align-items: center; padding: 20px 24px; border-top: 1px solid var(--line); }
.ledger__row:first-child { border-top: 0; }
.ledger__row--stack { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
.ledger__row--danger .ledger__label { color: var(--acc-danger); }
.ledger__text { display: grid; gap: 4px; min-width: 0; }
.ledger__label { font-size: var(--fs-body); font-weight: var(--fw-button); line-height: var(--lh-small); }
.ledger__hint { color: var(--copy); font-size: var(--fs-small); line-height: var(--lh-small); }
.ledger__value { color: var(--ink-2); font-size: var(--fs-small); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ledger__end { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.ledger__row .switch { margin-left: auto; }
.ledger__state { display: inline-flex; align-items: center; gap: 8px; color: var(--copy); font-size: var(--fs-small); }
.ledger__state .icon { width: 18px; height: 18px; }
.ledger__state--ok { color: var(--ok); }
.ledger__state--warn { color: var(--warn); }
.ledger__brand { display: grid; flex: none; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--bg-soft); color: var(--ink); font: var(--fw-heading) var(--fs-small)/1 var(--font-display); }
.ledger__who { display: flex; align-items: center; gap: 16px; min-width: 0; }

/* fields */
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
.fields--one { grid-template-columns: minmax(0, 1fr); }
.field { gap: 8px; min-width: 0; }
.field > span, .field > label:first-child, .acc-label { color: var(--ink-2); font-size: var(--fs-small); font-weight: var(--fw-ui); }
.field__help { min-height: 1lh; color: var(--quiet); font-size: var(--fs-caption); line-height: var(--lh-caption); }
.field__help.is-error { color: var(--acc-danger); }
.field__help.is-ok { color: var(--ok); }
.field__row { display: flex; gap: 8px; }
.field__row > .input { flex: 1; min-width: 0; }
.field__count { color: var(--quiet); font-size: var(--fs-caption); font-variant-numeric: tabular-nums; text-align: right; }
input[type="date"].input, input[type="datetime-local"].input { min-width: 0; font-variant-numeric: tabular-nums; }
.input::-webkit-calendar-picker-indicator { margin: 0; padding: 4px; border-radius: 6px; cursor: pointer; opacity: 0.7; }
.input::-webkit-calendar-picker-indicator:hover { opacity: 1; background: var(--bg-soft); }
input[type="number"].input { -moz-appearance: textfield; appearance: textfield; font-variant-numeric: tabular-nums; }
input[type="number"].input::-webkit-inner-spin-button, input[type="number"].input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
textarea.input { min-height: 96px; padding: 12px 16px; resize: vertical; line-height: var(--lh-small); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--acc-danger); }
.input:focus-visible, .select:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.input:disabled, .select:disabled { background: var(--bg-soft); color: var(--quiet); }
.input-pre { position: relative; }
.input-pre > span { position: absolute; left: 16px; top: 50%; color: var(--quiet); font-size: var(--fs-body); transform: translateY(-50%); pointer-events: none; }
.input-pre > .input { padding-left: 32px; }
.pw { position: relative; }
.pw .input { padding-right: 52px; }
.pw__eye { position: absolute; right: 4px; top: 50%; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: var(--quiet); transform: translateY(-50%); }
.pw__eye:hover { background: var(--bg-soft); color: var(--ink); }
.pw__eye:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }

/* small layout helpers */
.acc-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.acc-fieldset > legend { margin-bottom: 8px; padding: 0; }
.acc-fieldset + .acc-fieldset { margin-top: 20px; }
.acc-start { justify-self: start; }
.acc-wide { grid-column: 1 / -1; }
.acc-center { display: grid; justify-items: center; gap: 8px; font-size: var(--fs-small); font-weight: var(--fw-button); }
.acc-center .icon { width: 28px; height: 28px; color: var(--orange-ink); }
.acc-title-field { width: 100%; }
.acc-head__titles:has(.acc-title-field:not([hidden])) { flex: 1 1 480px; }
.acc-checks { display: grid; gap: 8px; margin-top: 8px; }
.acc-checks li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; align-items: start; color: var(--ink-2); font-size: var(--fs-small); line-height: var(--lh-small); }
.acc-checks .icon { width: 18px; height: 18px; margin-top: 1px; color: var(--ok); }
.acc-demo-note { color: var(--quiet); font-size: var(--fs-caption); }
.acc-more-albums { display: flex; justify-content: center; margin-top: 48px; }
.seg [aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px var(--shade-12); }
.seg button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.chats__find--flat { margin: 0; }
.stack--sm { gap: 8px; }

/* option chips that are checkboxes */
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { position: relative; }
.opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.opt span { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: var(--fs-small); font-weight: var(--fw-ui); white-space: nowrap; cursor: pointer; transition: background-color 160ms, border-color 160ms, color 160ms; }
.opt span:hover { border-color: var(--ink); color: var(--ink); }
.opt input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.opt input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.opt .icon { width: 16px; height: 16px; }
.opt--img span { min-height: 0; padding: 0; overflow: hidden; border-radius: 10px; }
.opt--img img { width: 64px; height: 48px; object-fit: cover; }
.opt--img input:checked + span { outline: 2px solid var(--orange); outline-offset: 2px; background: none; }

/* the save bar: appears once something changed */
.savebar { position: sticky; bottom: 16px; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 12px 12px 12px 20px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-lg); }
.savebar__text { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: var(--fs-small); font-weight: var(--fw-ui); }
.savebar__text .icon { width: 18px; height: 18px; color: var(--warn); }
.savebar.is-saved .savebar__text .icon { color: var(--ok); }
.savebar__end { display: flex; gap: 8px; margin-left: auto; }

/* buttons this group adds */
.btn--danger { border-color: var(--acc-danger); background: var(--surface); color: var(--acc-danger); }
.btn--danger:hover { background: var(--acc-danger-soft); }
.btn--quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn--quiet:hover { background: var(--bg-soft); color: var(--ink); }
.btn--fill-danger { background: var(--acc-danger); color: var(--acc-on-danger); }
.btn--fill-danger:hover { background: var(--acc-danger-hover); }
.btn:disabled, .btn[aria-disabled="true"] { border-color: var(--line); background: var(--bg-soft); color: var(--quiet); cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }
.btn .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; }
.icon-btn:focus-visible, .btn:focus-visible, .btn-follow:focus-visible, .chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.icon-btn:active { transform: scale(0.96); }

/* ---------- region states: loading, empty, error, full ---------- */
.skel { display: block; border-radius: 8px; background: var(--line-2); }
.skel--line { height: 12px; }
.skel--title { width: 60%; height: 16px; }
.skel--circle { width: 44px; height: 44px; border-radius: 50%; }
.skel--photo { aspect-ratio: 4 / 3; border-radius: var(--r); }
.skel-row { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; align-items: center; padding: 16px 0; }
.skel-row > span:last-child { display: grid; gap: 8px; }
.acc-error { display: grid; justify-items: center; gap: 12px; padding: 36px 20px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink-2); text-align: center; }
.acc-error .icon { width: 28px; height: 28px; color: var(--acc-danger); }
.acc-error b, .empty b { color: var(--ink); font-size: var(--fs-body); font-weight: var(--fw-button); }
.empty p, .acc-error p { color: var(--copy); font-size: var(--fs-body); }

/* ---------- toast and dialogs ---------- */
.acc-toast { position: fixed; left: 50%; bottom: 24px; z-index: 95; display: flex; align-items: center; gap: 12px; max-width: min(560px, calc(100% - 32px)); min-height: 48px; padding: 8px 8px 8px 20px; border-radius: 14px; background: var(--ink); color: var(--bg); font-size: var(--fs-small); box-shadow: var(--shadow-lg); opacity: 0; transform: translate(-50%, 16px); transition: opacity 200ms, transform 260ms var(--ease-out); pointer-events: none; }
.acc-toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.acc-toast button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--bg); font-weight: var(--fw-button); text-decoration: underline; text-underline-offset: 3px; }
.acc-toast button:hover { background: var(--scrim-30); }
.acc-toast button:focus-visible { outline: 2px solid var(--bg); outline-offset: 0; }
.acc-toast > span { padding-block: 4px; }

.acc-dialog { width: min(520px, calc(100% - 32px)); max-height: min(88dvh, 760px); padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
.acc-dialog--wide { width: min(680px, calc(100% - 32px)); }
.acc-dialog::backdrop { background: var(--scrim-50); }
.acc-dialog[open] { display: flex; flex-direction: column; }
.acc-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 20px 12px 24px; }
.acc-dialog__head h2 { font-size: var(--fs-h4); font-weight: var(--fw-title); line-height: var(--lh-h4); }
.acc-dialog__body { display: grid; gap: 16px; padding: 4px 24px 20px; overflow: auto; }
.acc-dialog__body > p { color: var(--copy); font-size: var(--fs-body); }
.acc-dialog__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 16px 24px 20px; border-top: 1px solid var(--line); }
@media (prefers-reduced-motion: no-preference) {
    .acc-dialog[open] { animation: acc-in 220ms var(--ease-out); }
    @keyframes acc-in { from { opacity: 0; transform: translateY(8px); } }
}

/* ---------- people rows (blocked, members, new chat) ---------- */
.prow { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px 16px; align-items: center; padding: 16px 24px; border-top: 1px solid var(--line); }
.prow:first-child { border-top: 0; }
.prow > .avatar, .prow > img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.prow__who { display: grid; min-width: 0; }
.prow__name { overflow: hidden; font-size: var(--fs-body); font-weight: var(--fw-button); text-overflow: ellipsis; white-space: nowrap; }
a.prow__name:hover { text-decoration: underline; text-underline-offset: 3px; }
.prow__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; overflow: hidden; color: var(--quiet); font-size: var(--fs-caption); font-variant-numeric: tabular-nums; }
.prow__end { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.prow .select { width: auto; min-width: 180px; min-height: 40px; }

/* ---------- messages ---------- */
.msgr-page .acc { padding: 16px 0 16px; }
.msgr-page .ftr { margin-top: 0; }
.msgr { display: grid; grid-template-columns: 360px minmax(0, 1fr); height: max(560px, calc(100dvh - var(--acc-bar-h) - 48px)); min-height: 560px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.chats { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); min-height: 0; border-right: 1px solid var(--line); }
.chats__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 16px 8px 20px; }
.chats__head h1 { font-size: var(--fs-h3); line-height: var(--lh-h3); }
.chats__head .row { gap: 4px; }
.chats__find { display: flex; align-items: center; gap: 8px; margin: 4px 16px 8px; padding: 0 12px; border-radius: 999px; background: var(--bg-soft); box-shadow: inset 0 0 0 1px var(--field-edge); color: var(--quiet); }
.chats__find:focus-within { box-shadow: inset 0 0 0 1px var(--field-edge), 0 0 0 2px var(--focus); }
.chats__find .icon { width: 18px; height: 18px; }
.chats__find input { flex: 1; min-width: 0; min-height: 40px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: var(--fs-small); }
.chats__find input::placeholder { color: var(--quiet); }
.chats__folders { padding: 0 8px; }
.chats__folders { gap: 0; padding: 0 4px; scroll-snap-type: x proximity; }
.chats__folders button { flex: 1 0 auto; justify-content: center; gap: 4px; min-height: 40px; padding: 0 4px; font-size: var(--fs-caption); scroll-snap-align: start; }
.chats__folders .count { min-width: 18px; padding: 0 4px; background: var(--orange-soft); color: var(--orange-ink); font-size: var(--fs-caption-tight); font-weight: var(--fw-button); line-height: 18px; text-align: center; }
.chats__folders .count:empty { display: none; }
.chats__scroll { min-height: 0; overflow-y: auto; padding: 8px; overscroll-behavior: contain; }
.chats__group { margin: 12px 12px 4px; color: var(--quiet); font-size: var(--fs-caption); font-weight: var(--fw-ui); }
.chat { position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; align-items: center; width: 100%; min-height: 72px; padding: 12px; border: 0; border-radius: 14px; background: none; color: var(--ink); text-align: left; }
.chat:hover { background: var(--bg-soft); }
.chat[aria-current="true"] { background: var(--orange-soft); }
.chat__pic { position: relative; width: 48px; height: 48px; }
.chat__pic img, .chat__pic .avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.chat__pic .club-pic { border-radius: 14px; }
.chat__lvl { position: absolute; right: -4px; bottom: -4px; min-width: 20px; padding: 0 4px; border: 2px solid var(--surface); border-radius: 8px; background: var(--ink); color: var(--bg); font-size: var(--fs-caption-tight); font-weight: var(--fw-button); line-height: 16px; text-align: center; font-variant-numeric: tabular-nums; }
.chat__body { display: grid; gap: 4px; min-width: 0; }
.chat__top, .chat__bottom { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chat__name { overflow: hidden; font-size: var(--fs-small); font-weight: var(--fw-button); text-overflow: ellipsis; white-space: nowrap; }
.chat__pin { width: 14px; height: 14px; flex: none; color: var(--quiet); }
.chat__time { flex: none; margin-left: auto; color: var(--quiet); font-size: var(--fs-caption); font-variant-numeric: tabular-nums; }
.chat__kind { flex: none; padding: 0 8px; border-radius: 999px; background: var(--bg-soft); color: var(--ink-2); font-size: var(--fs-caption-tight); font-weight: var(--fw-ui); line-height: 20px; }
.chat[aria-current="true"] .chat__kind { background: var(--surface); }
.chat__prev { overflow: hidden; color: var(--copy); font-size: var(--fs-small); text-overflow: ellipsis; white-space: nowrap; }
.chat__prev b { color: var(--quiet); font-weight: var(--fw-ui); }
.chat__unread { flex: none; min-width: 20px; margin-left: auto; padding: 0 8px; border-radius: 999px; background: var(--cta); color: var(--on-accent); font-size: var(--fs-caption-tight); font-weight: var(--fw-button); line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.chat.is-unread .chat__prev { color: var(--ink); font-weight: var(--fw-ui); }
.chats__state { padding: 8px 12px; }
.chats__state .empty { margin-top: 8px; }

.thread { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.thread__live { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.thread__head { position: sticky; z-index: 4; display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 12px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.thread__who { display: flex; align-items: center; gap: 12px; min-width: 0; color: inherit; }
.thread__who img, .thread__who .avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.thread__who > span { min-width: 0; }
#t-pic { display: grid; flex: none; }
.thread__who .club-pic { border-radius: 12px; }
.thread__who b { display: block; overflow: hidden; font-size: var(--fs-body); font-weight: var(--fw-button); text-overflow: ellipsis; white-space: nowrap; }
.thread__who small { display: block; color: var(--quiet); font-size: var(--fs-caption); }
a.thread__who:hover b { text-decoration: underline; text-underline-offset: 3px; }
.thread__tools { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.thread__back { display: none; }
.thread__find { position: sticky; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.thread__find .input { flex: 1 1 200px; min-height: 40px; }
.thread__find input[type="date"] { flex: 0 1 180px; }
.thread__find small { color: var(--copy); font-size: var(--fs-caption); }
.pinbar { position: sticky; z-index: 2; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 4px 16px 4px 20px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--ink); text-align: left; }
.pinbar:hover { background: var(--bg-soft); }
.pinbar .icon { width: 18px; height: 18px; color: var(--orange-ink); }
.pinbar span { display: grid; min-width: 0; }
.pinbar b { font-size: var(--fs-caption); font-weight: var(--fw-button); color: var(--orange-ink); }
.pinbar small { overflow: hidden; color: var(--ink-2); font-size: var(--fs-small); text-overflow: ellipsis; white-space: nowrap; }
.thread__scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px 24px; overscroll-behavior: contain; }
.thread__scroll { -webkit-mask-image: linear-gradient(180deg, transparent 0, var(--ink-fixed) 20px); mask-image: linear-gradient(180deg, transparent 0, var(--ink-fixed) 20px); }
.thread__scroll:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.thread__list { display: grid; gap: 8px; max-width: 760px; margin-inline: auto; }
.thread__demo { display: flex; justify-content: center; margin-bottom: 8px; }
.day { justify-self: center; margin: 12px 0 4px; padding: 4px 12px; border-radius: 999px; background: var(--bg-soft); color: var(--copy); font-size: var(--fs-caption); font-weight: var(--fw-ui); }
.msg { position: relative; display: grid; justify-items: start; gap: 4px; max-width: min(78%, 520px); }
.msg--out { justify-self: end; justify-items: end; }
.msg__bubble { padding: 8px 16px; border-radius: 4px 18px 18px 18px; background: var(--acc-bubble-in); color: var(--ink); font-size: var(--fs-body); line-height: var(--lh-small); overflow-wrap: anywhere; }
.msg--out .msg__bubble { border-radius: 18px 4px 18px 18px; background: var(--ink); color: var(--bg); }
.msg__reply { display: grid; margin-bottom: 4px; padding: 4px 12px; border-left: 2px solid var(--orange); border-radius: 4px; background: var(--scrim-10); font-size: var(--fs-caption); }
.msg--out .msg__reply { background: var(--glass-60); color: var(--ink-fixed); }
:root[data-theme="dark"] .msg--out .msg__reply { background: var(--bg-soft); color: var(--ink); }
.msg__meta { display: flex; align-items: center; gap: 8px; padding-inline: 4px; color: var(--quiet); font-size: var(--fs-caption); font-variant-numeric: tabular-nums; }
.msg__meta .icon { width: 16px; height: 16px; }
.msg__more { position: absolute; top: 4px; right: -44px; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: var(--quiet); opacity: 0; transition: opacity 160ms; }
.msg--out .msg__more { right: auto; left: -44px; }
.msg:hover .msg__more, .msg__more:focus-visible, .msg__more[aria-expanded="true"] { opacity: 1; }
.msg__more:hover { background: var(--bg-soft); color: var(--ink); }
.msg__photo { display: block; width: min(280px, 100%); overflow: hidden; border-radius: 18px; background: var(--bg-soft); }
.msg__photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.msg__photo:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.msg.is-hit .msg__bubble { box-shadow: 0 0 0 2px var(--orange); }
.att { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; align-items: center; width: min(360px, 100%); padding: 8px 16px 8px 8px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink); }
.att:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.att img { width: 88px; aspect-ratio: 1; border-radius: 12px; object-fit: cover; }
.att__map { display: grid; place-items: center; width: 88px; aspect-ratio: 1; border-radius: 12px; background: var(--map-paper); color: var(--orange-ink); }
.att__map .icon { width: 28px; height: 28px; }
.att__body { display: grid; gap: 4px; min-width: 0; }
.att__kind { color: var(--quiet); font-size: var(--fs-caption); font-weight: var(--fw-ui); }
.att__title { font: var(--fw-title) var(--fs-small)/var(--lh-small) var(--font-display); letter-spacing: var(--ls-heading); }
.att__spec { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--ink-2); font-size: var(--fs-caption); font-variant-numeric: tabular-nums; }
.voice { display: flex; align-items: center; gap: 12px; }
.voice .icon { width: 18px; height: 18px; }
.voice i { display: block; width: 120px; height: 4px; border-radius: 999px; background: currentColor; opacity: 0.4; }

.compose { position: sticky; bottom: 0; z-index: 2; display: grid; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--line); background: var(--surface); }
.compose__row { display: flex; align-items: flex-end; gap: 8px; }
.compose__field { flex: 1; min-width: 0; }
.compose__field textarea { display: block; width: 100%; min-height: 44px; max-height: 160px; padding: 12px 16px; border: 1px solid var(--field-edge); border-radius: 22px; background: var(--bg-soft); color: var(--ink); font: var(--fw-text) var(--fs-body)/var(--lh-small) var(--font-text); resize: none; }
.compose__field textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; background: var(--surface); }
.compose__field textarea::placeholder { color: var(--quiet); }
.compose .icon-btn { width: 44px; height: 44px; }
.compose__send { display: grid; flex: none; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--cta); color: var(--on-accent); }
.compose__send:hover { background: var(--cta-hover); }
.compose__send:disabled { background: var(--bg-soft); color: var(--quiet); cursor: not-allowed; }
.compose__send:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.compose__chip { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-left: 2px solid var(--orange); border-radius: 12px; background: var(--bg-soft); font-size: var(--fs-small); }
.compose__chip span { display: grid; flex: 1; min-width: 0; }
.compose__chip b { color: var(--orange-ink); font-size: var(--fs-caption); font-weight: var(--fw-button); }
.compose__chip small { overflow: hidden; color: var(--ink-2); font-size: var(--fs-small); text-overflow: ellipsis; white-space: nowrap; }
.compose__rec { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 8px 0 16px; border-radius: 22px; background: var(--acc-danger-soft); color: var(--acc-danger); font-size: var(--fs-small); font-weight: var(--fw-button); font-variant-numeric: tabular-nums; }
.compose__rec .grow { flex: 1; }
.attach .menu__list { top: auto; bottom: calc(100% + 8px); left: 0; right: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 320px; }
.attach > summary { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--ink-2); }
.attach > summary:hover, .attach[open] > summary { background: var(--bg-soft); color: var(--ink); }
.attach > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.menu__list .is-danger { color: var(--acc-danger); }
.thread__empty { display: grid; flex: 1; place-content: center; justify-items: center; gap: 16px; padding: 24px; color: var(--copy); text-align: center; }
.thread__empty b { color: var(--ink); font-size: var(--fs-body); font-weight: var(--fw-button); }
.thread__empty p { font-size: var(--fs-body); }
.msg__from { display: block; color: var(--orange-ink); font-size: var(--fs-caption); font-weight: var(--fw-button); }
.msg-menu.menu__list { top: 0; left: 0; right: auto; z-index: 40; }
.thread__list > .thread__empty { padding: 48px 16px; }
.thread__empty .icon { width: 32px; height: 32px; color: var(--quiet); }
.pick-list { display: grid; max-height: 360px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r); }
.pick-list .prow { padding: 12px 16px; }
.pick-list label.prow { cursor: pointer; }
.pick-list label.prow:hover { background: var(--bg-soft); }
.pick-list input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--cta); }

/* ---------- notifications ---------- */
.ncol { width: min(100%, 720px); margin-inline: auto; }
.nbar { position: sticky; top: var(--acc-bar-h); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; background: var(--bg); }
.nbar .tabs { flex: 1 1 auto; min-width: 0; }
.nlist { display: grid; }
.ngroup { margin: 24px 0 8px; color: var(--quiet); font-size: var(--fs-small); font-weight: var(--fw-ui); }
.ngroup:first-child { margin-top: 0; }
.nrow { position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 16px; border-radius: var(--r); color: var(--ink); }
.nrow + .nrow { margin-top: 4px; }
.nrow:hover { background: var(--bg-soft); }
.nrow.is-unread::before { content: ''; position: absolute; left: 4px; top: 36px; width: 8px; height: 8px; border-radius: 50%; background: var(--cta); }
.nrow__pic { position: relative; width: 48px; height: 48px; }
.nrow__pic > img, .nrow__pic > .avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.nrow__type { position: absolute; right: -4px; bottom: -4px; display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid var(--surface); border-radius: 50%; background: var(--ink); color: var(--bg); }
.nrow__type .icon { width: 12px; height: 12px; stroke-width: 2.5; }
.nrow__body { display: grid; gap: 4px; min-width: 0; }
.nrow__line { font-size: var(--fs-body); line-height: var(--lh-small); }
.nrow__line b { font-weight: var(--fw-button); }
.nrow__link { color: inherit; }
.nrow__link::after { content: ''; position: absolute; inset: 0; border-radius: var(--r); }
.nrow__link:focus-visible { outline: none; }
.nrow__link:focus-visible::after { outline: 2px solid var(--focus); outline-offset: 0; }
.nrow__obj { color: var(--ink-2); font-size: var(--fs-small); font-weight: var(--fw-ui); line-height: var(--lh-small); }
.nrow__quote { overflow: hidden; color: var(--copy); font-size: var(--fs-small); line-height: var(--lh-small); text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nrow__time { color: var(--quiet); font-size: var(--fs-caption); font-variant-numeric: tabular-nums; }
.nrow__thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
.nrow__end { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; }
.nrow .btn-follow { position: relative; z-index: 1; }

/* the bell dropdown (account.js: TTNotify) */
.notif-wrap { position: relative; display: inline-grid; }
.notif-pop { position: absolute; right: -48px; top: calc(100% + 8px); z-index: 70; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: 380px; max-height: min(560px, calc(100dvh - 96px)); overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); text-align: left; }
.notif-pop__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 8px 8px 16px; border-bottom: 1px solid var(--line); }
.notif-pop__head b { font: var(--fw-title) var(--fs-body)/var(--lh-h4) var(--font-display); letter-spacing: var(--ls-heading); }
.notif-pop__head .row { gap: 4px; }
.notif-pop__all-read { min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--link); font-size: var(--fs-small); font-weight: var(--fw-button); }
.notif-pop__all-read:hover { background: var(--bg-soft); }
.notif-pop__all-read:disabled { background: none; color: var(--quiet); cursor: not-allowed; }
.notif-pop__all-read:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.notif-pop__list { overflow-y: auto; padding: 8px; overscroll-behavior: contain; }
.notif-pop .nrow { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 12px; }
.notif-pop .nrow__pic, .notif-pop .nrow__pic > img, .notif-pop .nrow__pic > .avatar { width: 40px; height: 40px; }
.notif-pop .nrow.is-unread::before { left: 2px; top: 28px; }
.notif-pop .nrow__line { font-size: var(--fs-small); }
.notif-pop .nrow__obj { color: var(--ink-2); font-size: var(--fs-small); font-weight: var(--fw-ui); line-height: var(--lh-small); }
.nrow__quote { -webkit-line-clamp: 1; }
.notif-pop .empty, .notif-pop .acc-error { margin: 8px; padding: 28px 16px; }
.notif-pop__foot { display: flex; justify-content: center; padding: 8px; border-top: 1px solid var(--line); }
.notif-pop__foot a { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; border-radius: 12px; color: var(--ink); font-size: var(--fs-small); font-weight: var(--fw-button); }
.notif-pop__foot a:hover { background: var(--bg-soft); }
@media (prefers-reduced-motion: no-preference) {
    .notif-pop:not([hidden]) { animation: acc-in 180ms var(--ease-out); }
}

/* ---------- albums ---------- */
.albums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 24px; }
.album { position: relative; display: grid; align-content: start; gap: 12px; color: var(--ink); }
.album__link { display: grid; gap: 12px; color: inherit; }
.album__cover { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--r); background: var(--bg-soft); }
.album__cover img { width: 100%; height: 100%; object-fit: cover; }
.album__link:hover .album__cover { box-shadow: var(--shadow-lg); }
.album__link:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: var(--r); }
.album__count { position: absolute; left: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px 4px 8px; border-radius: 999px; background: var(--scrim-66); color: var(--on-accent); font-size: var(--fs-caption); font-weight: var(--fw-button); font-variant-numeric: tabular-nums; }
.album__count .icon { width: 16px; height: 16px; }
.album__title { font: var(--fw-title) var(--fs-h4)/var(--lh-h4) var(--font-display); letter-spacing: var(--ls-heading); display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.album__link:hover .album__title { text-decoration: underline; text-decoration-color: var(--orange); text-underline-offset: 3px; }
.album__empty-cover { display: grid; place-items: center; height: 100%; color: var(--quiet); }
.album__empty-cover .icon { width: 36px; height: 36px; }
.album__new { display: grid; place-content: center; justify-items: center; gap: 8px; width: 100%; aspect-ratio: 4 / 3; border: 1px dashed var(--field-edge); border-radius: var(--r); background: var(--surface); color: var(--ink-2); font-size: var(--fs-small); font-weight: var(--fw-button); }
.album__new:hover { border-color: var(--ink); color: var(--ink); }
.album__new .icon { width: 28px; height: 28px; }

/* reorder mode, shared by albums and photos */
.acc-edit { margin-bottom: 24px; }
.sort-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 24px; padding: 12px 12px 12px 20px; border: 1px solid var(--orange); border-radius: var(--r); background: var(--orange-soft); }
.sort-bar p { color: var(--ink-2); font-size: var(--fs-small); font-weight: var(--fw-ui); }
.sort-bar .row { gap: 8px; }
.grab { display: none; }
.is-sorting .grab { position: absolute; top: 8px; right: 8px; z-index: 2; display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: var(--scrim-66); }
.grab button { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--glass-94); color: var(--ink-fixed); box-shadow: var(--shadow); touch-action: none; }
.grab button:hover { background: var(--on-accent); }
.grab button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.grab .icon { width: 18px; height: 18px; }
.grab [data-grip] { cursor: grab; }
.is-sorting [data-sort-item] { cursor: grab; }
.is-sorting [data-sort-item] a { pointer-events: none; }
.is-sorting [data-sort-item].is-dragging { opacity: 0.5; }
.is-sorting [data-sort-item].is-picked .album__cover, .is-sorting [data-sort-item].is-picked .photo__img { outline: 2px solid var(--orange); outline-offset: 2px; }

/* one album */
.photos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.photo { position: relative; }
.photo__link { display: block; color: inherit; }
.photo__img { position: relative; display: block; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 12px; background: var(--bg-soft); }
.photo__img img { width: 100%; height: 100%; object-fit: cover; }
.photo__img::after, .album__cover::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line-2); pointer-events: none; }
.photo__link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 12px; }
.photo__link:hover .photo__img { box-shadow: var(--shadow-lg); }
.photo__del { position: absolute; top: 8px; right: 8px; z-index: 1; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--glass-94); color: var(--ink-fixed); box-shadow: var(--shadow); opacity: 0; transition: opacity 160ms; }
.photo:hover .photo__del, .photo__del:focus-visible { opacity: 1; }
.photo__del:hover { color: var(--acc-danger); }
.photo__del:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.photo__del .icon { width: 18px; height: 18px; }
.is-sorting .photo__del { display: none; }
.photo.is-new .photo__img { outline: 2px solid var(--ok); outline-offset: 2px; }
.photo__cover-tag { position: absolute; left: 8px; bottom: 8px; padding: 0 8px; border-radius: 999px; background: var(--scrim-66); color: var(--on-accent); font-size: var(--fs-caption-tight); font-weight: var(--fw-button); line-height: 20px; }

/* upload */
.drop { position: relative; display: grid; place-content: center; justify-items: center; gap: 8px; min-height: 180px; padding: 24px; border: 2px dashed var(--field-edge); border-radius: var(--r); background: var(--bg-soft); color: var(--ink-2); text-align: center; cursor: pointer; }
.drop:hover, .drop.is-over { border-color: var(--orange); background: var(--orange-soft); }
.drop:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop .icon { width: 32px; height: 32px; color: var(--orange-ink); }
.drop b { font-size: var(--fs-body); font-weight: var(--fw-button); }
.drop small { color: var(--copy); font-size: var(--fs-small); }
.uplist { display: grid; gap: 8px; }
.upitem { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.upitem img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }
.upitem__body { display: grid; gap: 4px; min-width: 0; }
.upitem__name { overflow: hidden; font-size: var(--fs-small); font-weight: var(--fw-ui); text-overflow: ellipsis; white-space: nowrap; }
.upitem .bar { height: 6px; }
.upitem .bar > i { transform-origin: left center; transform: scaleX(0); transition: transform 240ms linear; }
.upitem__state { color: var(--quiet); font-size: var(--fs-caption); font-variant-numeric: tabular-nums; }
.upitem__state.is-ok { color: var(--ok); }
.cover-pick { position: relative; display: grid; place-items: center; overflow: hidden; aspect-ratio: 16 / 10; border: 2px dashed var(--field-edge); border-radius: var(--r); background: var(--bg-soft); color: var(--ink-2); }
.cover-pick img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-pick__busy { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; background: var(--scrim-55); color: var(--on-accent); font-size: var(--fs-small); font-weight: var(--fw-button); }

/* lightbox */
.acc-lb { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; background: transparent; color: var(--on-accent); }
.acc-lb::backdrop { background: var(--scrim-80); }
.acc-lb[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--scrim-80); }
.acc-lb__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; font-size: var(--fs-small); font-weight: var(--fw-title); font-variant-numeric: tabular-nums; }
.acc-lb__top .row { gap: 8px; }
.acc-lb__stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 76px; }
.acc-lb__stage img { max-width: 100%; max-height: 100%; border-radius: 8px; object-fit: contain; }
.acc-lb__btn { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: var(--glass-90); color: var(--ink-fixed); }
.acc-lb__btn:hover { background: var(--on-accent); }
.acc-lb__btn:focus-visible { outline: 2px solid var(--on-accent); outline-offset: 2px; }
.acc-lb__btn:disabled { background: var(--scrim-50); color: var(--glass-60); cursor: not-allowed; }
.acc-lb__btn--danger:hover { color: var(--acc-danger); }
.acc-lb__nav { position: absolute; top: 50%; transform: translateY(-50%); }
.acc-lb__nav--prev { left: 16px; }
.acc-lb__nav--next { right: 16px; }
.acc-lb__nav--prev .icon { transform: rotate(180deg); }
.acc-lb__cap { padding: 12px 16px 20px; color: var(--glass-90); font-size: var(--fs-small); text-align: center; }

/* ---------- profile editing ---------- */
.pe { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 48px; align-items: start; }
.pe__form { display: grid; gap: 48px; min-width: 0; }
.pe__aside { position: sticky; top: 92px; display: grid; gap: 12px; }
.pe__aside > p { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--quiet); font-size: var(--fs-small); font-weight: var(--fw-ui); }
.pe-media { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px 24px; align-items: center; }
.pe-avatar { position: relative; width: 112px; height: 112px; overflow: hidden; border-radius: 50%; background: var(--bg-soft); }
.pe-avatar img, .pe-cover img { width: 100%; height: 100%; object-fit: cover; }
.pe-cover { position: relative; height: 160px; overflow: hidden; border-radius: var(--r); background: var(--bg-soft); }
.pick { position: relative; overflow: hidden; }
.pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pick:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.pe-cover .pick { position: absolute; right: 12px; bottom: 12px; }
.socials { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.social-field { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 4px 12px; align-items: center; }
.social-field .field__help { grid-column: 2; }
.social-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--bg-soft); color: var(--ink-2); font: var(--fw-heading) var(--fs-caption)/1 var(--font-display); }

/* the live preview of the profile head */
.pv { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.pv__cover { height: 132px; background: var(--bg-soft); }
.pv__cover img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 38%; }
.pv__body { display: grid; gap: 8px; padding: 0 20px 24px; }
.pv__avatar { width: 88px; height: 88px; margin-top: -44px; overflow: hidden; border: 4px solid var(--surface); border-radius: 50%; background: var(--bg-soft); }
.pv__avatar img { width: 100%; height: 100%; object-fit: cover; }
.pv__name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: var(--fs-h3); line-height: var(--lh-h3); overflow-wrap: anywhere; }
.pv__name .verified { width: 20px; height: 20px; }
.pv__handle { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--copy); font-size: var(--fs-body); }
.pv__handle span { display: inline-flex; align-items: center; gap: 4px; }
.pv__at { font-size: var(--fs-body); }
.pv__handle .icon { width: 16px; height: 16px; color: var(--quiet); }
.pv__bio { color: var(--ink-2); font-size: var(--fs-body); overflow-wrap: anywhere; }
.pv__bio:empty { display: none; }
.pv__socials { display: flex; flex-wrap: wrap; gap: 8px; }
.pv__socials:empty { display: none; }
.pv__socials span { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px; background: var(--bg-soft); color: var(--ink-2); font-size: var(--fs-caption); font-weight: var(--fw-ui); }
.pv__acts { display: flex; flex-wrap: wrap; gap: 8px; }
.pv__private { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: var(--fs-small); font-weight: var(--fw-ui); }
.pv__private .icon { width: 18px; height: 18px; }

/* ---------- club settings ---------- */
.cs-cover { position: relative; height: clamp(160px, 18vw, 220px); overflow: hidden; border-radius: var(--r); background: var(--bg-soft); }
.cs-cover > img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 64%; }
.cs-cover .pick { position: absolute; right: 12px; bottom: 12px; }
.cs-id { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 16px; align-items: end; }
.cs-logo { position: relative; width: 72px; height: 72px; overflow: hidden; border-radius: 18px; background: var(--orange-soft); }
.cs-logo img { width: 100%; height: 100%; object-fit: cover; }
.cs-logo .pick { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 18px; background: var(--scrim-38); color: var(--on-accent); opacity: 0; transition: opacity 160ms; }
.cs-logo:hover .pick, .cs-logo .pick:focus-within { opacity: 1; }
.cs-logo .pick .icon { width: 20px; height: 20px; }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.tbl th { padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--quiet); font-size: var(--fs-caption); font-weight: var(--fw-ui); text-align: left; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .select { min-height: 40px; }
.tbl__who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tbl__who b { display: block; font-weight: var(--fw-button); }
.tbl__who small { display: block; color: var(--quiet); font-size: var(--fs-caption); }
.tbl__end { text-align: right; white-space: nowrap; }
.invite { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 16px 24px; border-top: 1px solid var(--line); }
.invite:first-child { border-top: 0; }
.invite__url { overflow: hidden; color: var(--ink-2); font-size: var(--fs-small); text-overflow: ellipsis; white-space: nowrap; }
.ride { display: grid; gap: 16px; padding: 20px 24px; border-top: 1px solid var(--line); }
.ride:first-child { border-top: 0; }
.ride__head { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 16px; align-items: center; }
.ride__head img { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; }
.ride__head b { font: var(--fw-title) var(--fs-body)/var(--lh-small) var(--font-display); letter-spacing: var(--ls-heading); }
.ride__head small { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--quiet); font-size: var(--fs-caption); }
.ride details > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--link); font-size: var(--fs-small); font-weight: var(--fw-button); cursor: pointer; list-style: none; }
.ride details > summary::-webkit-details-marker { display: none; }
.ride details > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ride details[open] > summary .icon { transform: rotate(180deg); }
.ride details .fields { margin-top: 8px; }
.cal { display: grid; gap: 12px; padding: 20px 24px; }
.cal__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal__head b { font: var(--fw-title) var(--fs-body)/var(--lh-h4) var(--font-display); }
.cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; font-variant-numeric: tabular-nums; }
.cal__dow { padding: 4px 0; color: var(--quiet); font-size: var(--fs-caption); }
.cal__day { display: grid; place-items: center; min-height: 40px; border-radius: 10px; color: var(--ink-2); font-size: var(--fs-small); }
.cal__day.is-out { color: var(--quiet); opacity: 0.5; }
.cal__day.is-ride { background: var(--orange-soft); color: var(--orange-ink); font-weight: var(--fw-button); box-shadow: inset 0 0 0 1px var(--orange); }
.cal__day.is-today { box-shadow: inset 0 0 0 1px var(--ink); }
.cal__list { display: grid; gap: 8px; font-size: var(--fs-small); }
.cal__list li { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.cal__list time { min-width: 96px; color: var(--orange-ink); font-weight: var(--fw-button); font-variant-numeric: tabular-nums; }

/* ---------- responsive ---------- */
@media (pointer: coarse) {
    .acc .crumbs a, .prow__name, .opt span, .notif-pop__all-read, .ride details > summary { min-height: 44px; }
    .acc .crumbs a { min-width: 44px; justify-content: center; }
    .switch { width: 52px; height: 44px; }
    .switch span { inset: 10px 6px; }
    .switch input { z-index: 1; }
    .nrow__link { padding-block: 12px; margin-block: -12px; }
    .grab button, .photo__del, .pw__eye { width: 44px; height: 44px; }
    .msg__more { opacity: 1; }
    .photo__del { display: none; }
    .tbl .select, .prow .select { min-height: 48px; }
    .chats__find input { min-height: 44px; }
    .chats__folders button { min-height: 44px; }
    .acc-nav__me { min-height: 44px; }
}
@media (max-width: 1180px) {
    .pe { grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; }
    .msgr { grid-template-columns: 320px minmax(0, 1fr); }
}
@media (max-width: 1023px) {
    .acc-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .acc-nav { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .acc-nav__me, .acc-nav__sep { grid-column: 1 / -1; }
    .acc-main { width: 100%; }
    .pe { grid-template-columns: minmax(0, 1fr); }
    .pe__aside { position: static; }
    .albums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .photos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    :root { --acc-bar-h: 60px; }
    .acc p, .acc-dialog p, .notif-pop p { font-size: var(--fs-body); }
    .acc { padding: 20px 0 64px; }
    .acc-head { margin-bottom: 24px; }
    .acc-sec + .acc-sec { margin-top: 40px; }
    /* settings and club settings: the section list first, then one section with a back link */
    .acc-layout[data-view="list"] .acc-main { display: none; }
    .acc-layout[data-view="panel"] .acc-nav { display: none; }
    .acc-layout[data-view="panel"] .acc-back { display: inline-flex; justify-self: start; }
    .acc-layout[data-view="list"] + .acc-hide-list { display: none; }
    .acc-nav { grid-template-columns: minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
    .acc-nav a { min-height: 56px; padding: 0 16px; border-top: 1px solid var(--line); border-radius: 0; font-size: var(--fs-body); }
    .acc-nav a:first-of-type { border-top: 0; }
    .acc-nav a::after { content: ''; width: 8px; height: 8px; margin-left: auto; border-top: 2px solid var(--quiet); border-right: 2px solid var(--quiet); transform: rotate(45deg); }
    .acc-nav .count-badge { margin-left: auto; }
    .acc-nav .count-badge + * { margin-left: 0; }
    .acc-nav a[aria-current="page"] { box-shadow: none; }
    .acc-nav__me { margin: 0; padding: 16px; }
    .acc-nav__sep { margin: 0; }
    .ledger__row { padding: 16px; }
    .ledger__row:not(.ledger__row--inline) { grid-template-columns: minmax(0, 1fr); }
    .ledger__row:not(.ledger__row--inline) .ledger__end { justify-content: flex-start; }
    .ledger__row--inline .ledger__end { justify-content: flex-end; }
    .fields, .socials { grid-template-columns: minmax(0, 1fr); }
    .prow { grid-template-columns: 44px minmax(0, 1fr); padding: 16px; }
    .prow__end { grid-column: 2; justify-content: flex-start; }
    .prow .select { width: 100%; }
    .savebar { bottom: calc(76px + env(safe-area-inset-bottom)); padding: 12px; }
    .savebar__end { width: 100%; }
    .savebar__end .btn { flex: 1; }
    .acc-toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
    .acc-dialog { width: 100%; max-width: none; max-height: 92dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
    .acc-dialog__foot { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
    .acc-dialog__foot .btn { flex: 1; }

    .msgr-page .acc { padding: 0; }
    .msgr-page .acc > .wrap { padding-inline: 0; }
    .msgr { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - var(--acc-bar-h) - 66px - env(safe-area-inset-bottom)); min-height: 480px; border: 0; border-radius: 0; }
    .msgr[data-view="list"] .thread, .msgr[data-view="chat"] .chats { display: none; }
    .chats { border-right: 0; }
    .thread__back { display: inline-grid; }
    .thread__head { padding: 8px 8px 8px 4px; gap: 8px; }
    .thread__tools [data-hide-sm] { display: none; }
    .thread__scroll { padding: 12px 12px 16px; }
    .msg { max-width: 86%; }
    .msg__more { position: static; order: 2; opacity: 1; width: 44px; height: 44px; }
    .msg__more { display: none; }
    .attach .menu__list { position: fixed; left: 8px; right: 8px; bottom: calc(132px + env(safe-area-inset-bottom)); min-width: 0; }
    .compose { padding: 8px 8px 12px; }

    .nbar { top: var(--acc-bar-h); }
    .nrow { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 12px; }
    .nrow__pic, .nrow__pic > img, .nrow__pic > .avatar { width: 44px; height: 44px; }
    .nrow__end { grid-column: 2; }
    .nrow__thumb { display: none; }
    .notif-pop { position: fixed; left: 8px; right: 8px; top: calc(var(--acc-bar-h) + 8px); width: auto; }

    .albums { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
    .album__title { font-size: var(--fs-small); line-height: var(--lh-small); }
    .album__count { left: 8px; bottom: 8px; }
    .photos { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
    .photos.is-sorting { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .photo__img { border-radius: 8px; }
    .acc-lb__stage { padding: 0 8px; }
    .acc-lb__nav { top: auto; bottom: -64px; transform: none; }
    .acc-lb__nav--prev { left: calc(50% - 60px); }
    .acc-lb__nav--next { right: calc(50% - 60px); }
    .acc-lb__cap { padding-top: 76px; }

    .pe-media { grid-template-columns: 88px minmax(0, 1fr); }
    .pe-avatar { width: 88px; height: 88px; }
    .pe-cover { height: 120px; }
    .tbl thead { display: none; }
    .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
    .tbl tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
    .tbl tr:last-child { border-bottom: 0; }
    .tbl td { padding: 4px 0; border: 0; }
    .tbl__end { text-align: left; }
    .invite, .ride { padding: 16px; }
    .invite { grid-template-columns: minmax(0, 1fr); }
    .cal { padding: 16px; }
    .sort-bar { padding: 12px; }
    .sort-bar .row { width: 100%; }
    .sort-bar .row .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .acc-toast, .opt span, .photo__del, .msg__more, .upitem .bar > i, .cs-logo .pick { transition: none; }
    .acc-dialog[open], .notif-pop:not([hidden]) { animation: none; }
    .icon-btn:active { transform: none; }
}
