/* Friends: Home card + sheet (public/friends-ui.js). */
.fr-card svg, .fr-sheet svg, .fr-empty svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.fr-card { padding: 14px 16px; }
.fr-card-sub { margin: 0 2px 8px; font-weight: 600; }
.fr-av { width: 34px; height: 34px; font-size: 12px; position: relative; overflow: hidden; }
.fr-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* leaderboard */
.fr-brow { cursor: default; }
.fr-brow.is-me { background: rgba(var(--acc-500-rgb), 0.08); }
.fr-rank { width: 16px; text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.fr-brow .u-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.fr-bar { display: block; height: 6px; border-radius: 999px; background: var(--u-hair); overflow: hidden; }
.fr-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.fr-bval { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; white-space: nowrap; }
.fr-bval b { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fr-bval small { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); }
.fr-bval small svg { width: 11px; height: 11px; color: #f97316; fill: #f97316; stroke: none; margin-left: 2px; }

/* feed */
.fr-card-items { margin-top: 10px; padding-top: 4px; border-top: 1px dotted var(--u-hair); }
.fr-feed { display: flex; flex-direction: column; background: var(--u-tile); border-radius: 16px; padding: 0 12px; }
.fr-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0; }
.fr-item + .fr-item { border-top: 1px solid var(--u-hair); }
.fr-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fr-item-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fr-item-top b { font-size: 14px; flex: none; }
.fr-sport { display: inline-flex; align-items: center; gap: 5px; min-width: 0; font-size: 14px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fr-sport svg { color: var(--accent-dark); }
.fr-pr { display: inline-flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 12px; font-weight: 600; color: #b45309; }
.fr-pr svg { width: 12px; height: 12px; }
:root[data-theme="dark"] .fr-pr { color: #fcd34d; }
.fr-by { margin-top: 2px; }
.fr-fist { flex: none; align-self: center; min-width: 44px; height: 34px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel); font: inherit; font-size: 14px; font-weight: 700; color: var(--text); cursor: pointer; transition: transform .12s ease, background .12s ease; }
.fr-fist:active { transform: scale(0.92); }
.fr-fist.on { background: rgba(var(--acc-500-rgb), 0.14); border-color: rgba(var(--acc-500-rgb), 0.5); }
.fr-fist.is-mine-post { display: inline-flex; align-items: center; cursor: default; border-style: dashed; }
.fr-quiet { margin: 10px 2px 0; }

/* empty card */
.fr-empty { display: flex; gap: 12px; padding: 16px; }
.fr-empty-ico { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(var(--acc-500-rgb), 0.14); color: var(--accent-dark); }
.fr-empty-ico svg { width: 18px; height: 18px; }
.fr-empty b { font-size: 15px; }
.fr-empty p { margin: 4px 0 10px; line-height: 1.45; }
.fr-empty .btn, .fr-actions .btn { display: inline-flex; align-items: center; gap: 6px; }

/* sheet */
.view-sheet-body > .vs-content > .fr-sheet:first-child { padding-right: 0; }
.fr-sheet .ef-sec { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 22px 2px 10px; }
.fr-sheet .ef-sec h3 { margin: 0; font-size: 15px; font-weight: 700; }
.fr-sheet .ef-sec > span { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.fr-rm { font-size: 13px; color: var(--muted); }
.fr-actions { margin-top: 16px; }
.fr-actions .btn { width: 100%; justify-content: center; }
.fr-note { margin: 8px 2px 0; line-height: 1.45; }
.fr-share { margin-top: 18px; }

/* Account page panel */
.fr-acct { display: flex; align-items: center; gap: 12px; width: 100%; padding: 2px 0; border: 0; background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.fr-acct svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.fr-acct-avs { display: flex; flex: none; }
.fr-acct-avs .fr-av { width: 32px; height: 32px; border: 2px solid var(--panel); }
.fr-acct-avs .fr-av + .fr-av { margin-left: -10px; }
.fr-acct-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fr-acct-main b { font-size: 15px; }
.fr-acct-main .small { line-height: 1.4; }
.fr-acct-go { color: var(--muted); }
#friendsPanel .fr-actions { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--u-hair, var(--line)); }
/* Account page: Friends sits in its own section, padded like the other cards. */
#view-members .ac-friends .panel.ac-set { padding: 16px; }
#friendsPanel .fr-actions svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* friend requests + people */
.fr-reqs .u-row, .fr-people .u-row { gap: 10px; }
.fr-reqs .u-main, .fr-people .u-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fr-reqs .btn, .fr-people .btn { flex: none; display: inline-flex; align-items: center; gap: 4px; }
.fr-people .btn svg, .fr-reqs .btn svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.fr-req-card { margin-bottom: 10px; }
.fr-empty .btn + .btn { margin-left: 6px; }

/* ================= Community page (#/community) + bell ================= */
/* Unread badge: Home header button, desktop tab, page bell. */
.dash-head { grid-template-columns: 88px 1fr 88px; }
.dash-rights { display: flex; justify-content: flex-end; gap: 8px; }
.dash-comm, .cm-bell, .tab[data-view="community"] .tab-icon { position: relative; }
.cm-badge { position: absolute; top: -3px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--bg); font-variant-numeric: tabular-nums; pointer-events: none; }
.cm-badge[hidden] { display: none; }
.cm-tab-badge { top: -6px; right: -9px; box-shadow: 0 0 0 2px var(--tile-dark); }
.cm-bell svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ph-head .ph-rb > svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Phone nav stays Home, 75 Hard | + | Workouts, Health: Community is the Home header button. */
@media (max-width: 600px) { .tabs .tab[data-view="community"] { display: none; } }

#communityRoot { max-width: 720px; margin: 0 auto; }
#communityRoot svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
#communityRoot .ph-rb svg { width: 18px; height: 18px; }
#communityRoot .ef-sec { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 2px 10px; }
#communityRoot .ef-sec h3 { margin: 0; font-size: 15px; font-weight: 700; }
#communityRoot .ef-sec > span { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.cm-tabs { display: flex; width: 100%; margin: 0 0 14px; }
.cm-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.cm-dot { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; }
.cm-chips button { padding: 5px 10px; }
.cm-empty { margin-bottom: 4px; }
.cm-none { margin: 4px 2px; }

/* hero: this week's XP race, the one dark card on the page. Each row shows
   what that person is chasing; bars split effort XP from quest XP. */
.cm-hero { background: var(--tile-dark); color: #fff; border-radius: 22px; padding: 16px; }
:root[data-theme="dark"] .cm-hero { background: #202328; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); }
.cm-hero-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.cm-kick { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--acc-400); }
.cm-rank { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; margin-top: 2px; }
.cm-rank small { font-size: 13px; font-weight: 600; color: #a7acb4; letter-spacing: 0; }
.cm-hero-stats { display: flex; gap: 14px; text-align: right; }
.cm-hero-stats span { display: flex; flex-direction: column; }
.cm-hero-stats b { font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cm-hero-stats small { font-size: 11px; font-weight: 500; color: #a7acb4; white-space: nowrap; }
.cm-lb { margin-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.cm-lrow { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 14px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.cm-lrow.is-me { background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.cm-lrow:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cm-lrow .fr-av { width: 32px; height: 32px; font-size: 11px; }
.cm-lrow .xp-lv { box-shadow: 0 0 0 2px var(--tile-dark); }
.cm-lrow.is-me .xp-lv { box-shadow: 0 0 0 2px #2b2e33; }
.cm-lmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cm-lname { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13.5px; font-weight: 600; }
.cm-lname b { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cm-lq { font-size: 11px; font-weight: 500; color: #a7acb4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-split, .xp-split { display: flex; gap: 2px; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.cm-split i, .xp-split i { display: block; height: 100%; }
.cm-split i.e, .xp-split i.e, .cm-keys i.e { background: var(--accent); }
.cm-split i.q, .xp-split i.q, .cm-keys i.q { background: #fb923c; }
.cm-keys { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 11px; font-weight: 500; color: #a7acb4; }
.cm-keys > span { display: inline-flex; align-items: center; gap: 5px; }
.cm-keys i { width: 8px; height: 8px; border-radius: 2px; }
.cm-more { margin-left: auto; border: 0; background: none; padding: 4px 0; font: inherit; font-size: 11.5px; font-weight: 700; color: var(--acc-400); cursor: pointer; }
.cm-tip { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.07); font-size: 12px; font-weight: 500; line-height: 1.4; color: #d4d7dc; }
.cm-tip b { color: #fff; font-weight: 700; }
#communityRoot .cm-tip svg { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--acc-400); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cm-hrank { font-size: 12px; font-weight: 700; color: #a7acb4; text-align: center; font-variant-numeric: tabular-nums; }

/* timeline */
.cm-day { margin: 14px 4px 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.cm-sec + .cm-day { margin-top: 4px; }
.cm-quest { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 9px 10px; border-radius: 14px; background: var(--panel); }
.cm-qico { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--acc-700); }
:root[data-theme="dark"] .cm-qico { background: rgba(var(--acc-500-rgb), 0.16); color: var(--acc-300); }
#communityRoot .cm-qico svg { width: 16px; height: 16px; }
.cm-qtext { display: flex; flex-direction: column; min-width: 0; }
.cm-qtext b { font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-qtext small { font-size: 11.5px; font-weight: 500; color: var(--muted); }

/* bell sheet */
.cm-notifs .u-row { gap: 10px; align-items: center; }
.cm-n .u-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cm-ntext { font-size: 13.5px; font-weight: 500; line-height: 1.35; }
.cm-ntext b { font-weight: 700; }
.cm-nav { position: relative; flex: none; }
.cm-nglyph { position: absolute; right: -4px; bottom: -3px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); font-size: 10.5px; box-shadow: 0 0 0 2px var(--u-tile); }
.cm-nglyph.is-ico { background: var(--accent); color: #fff; }
.cm-sheet .cm-nglyph svg { width: 10px; height: 10px; stroke-width: 2.6; }
.cm-new { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.cm-nbtns { display: flex; gap: 6px; flex: none; }
.cm-bell-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 30px 20px; }
.cm-bell-empty .fr-empty-ico { margin-bottom: 4px; }
.cm-bell-empty p { margin: 0; max-width: 280px; line-height: 1.45; }
.dash-rights .dash-round { flex: none; }
.fr-reqs + .cm-hero, .fr-reqs + .cm-empty { margin-top: 14px; }

/* Friends tab: one card per friend with their main quest. */
.cm-fcards { display: flex; flex-direction: column; gap: 10px; }
.cm-fcard { background: var(--panel); border-radius: 22px; padding: 14px; box-shadow: var(--u-card); display: flex; flex-direction: column; gap: 12px; }
.cm-fhead { display: flex; align-items: center; gap: 12px; }
.cm-fhead .u-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cm-fhead .fr-av { width: 38px; height: 38px; }
.cm-fq { background: var(--u-tile); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.cm-fq.is-none { padding: 12px; }
.cm-fq-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cm-fq-kick { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--acc-700); }
:root[data-theme="dark"] .cm-fq-kick { color: var(--acc-400); }
.cm-fq-name { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cm-fq-name b { font-size: 13.5px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-fq-name span { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cm-fq-bar { display: block; height: 5px; border-radius: 3px; background: var(--u-seg); overflow: hidden; }
.cm-fq-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.cm-fstats { display: flex; align-items: center; gap: 14px; }
.cm-fstats > span { display: flex; flex-direction: column; }
.cm-fstats b { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cm-fstats small { font-size: 10.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.cm-fstats .fr-fist { margin-left: auto; }
.cm-faces { display: inline-flex; }
.cm-face { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 8px; font-weight: 700; box-shadow: 0 0 0 2px var(--u-tile); }
.cm-face + .cm-face { margin-left: -5px; }
/* Text buttons on the Community page (New link, Quest log): no browser box. */
#communityRoot button.link { background: none; border: 0; padding: 0; font-family: inherit; cursor: pointer; }
/* Remove on a friend card: a quiet grey pill. */
#communityRoot .cm-fhead .fr-rm { flex: none; padding: 6px 12px; border-radius: 999px; background: var(--n-badge); color: var(--muted); font-size: 12px; font-weight: 600; }
:root[data-theme="dark"] #communityRoot .cm-fhead .fr-rm { background: var(--d-raise); }
