/* Followers / following modal (see follows-modal.js). */
.stats .fm-count { cursor: pointer; border-radius: 6px; transition: background .15s, color .15s; -webkit-tap-highlight-color: transparent; }
.stats .fm-count:hover dd, .stats .fm-count:focus-visible dd { color: var(--amber); }
.stats .fm-count:hover dt, .stats .fm-count:focus-visible dt { color: var(--muted); }
.stats .fm-count:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.stats > div[hidden] { display: none; }
html.fm-lock, html.fm-lock body { overflow: hidden; overscroll-behavior: none; }

.fm-backdrop { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,0); transition: background .18s; }
.fm-backdrop[hidden] { display: none; }
.fm-backdrop.on { background: rgba(0,0,0,.6); }
.fm-sheet { position: relative; overflow: hidden; width: 100%; height: calc(100dvh - 40px); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: #161411; color: var(--text);
  border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.5);
  transform: translateY(24px); opacity: 0; transition: transform .2s ease, opacity .18s; padding-bottom: env(safe-area-inset-bottom); }
.fm-backdrop.on .fm-sheet { transform: none; opacity: 1; }
@media (min-width: 720px) {
  .fm-backdrop { align-items: center; padding: 24px; }
  .fm-sheet { width: 420px; height: min(620px, calc(100vh - 48px)); border-radius: 16px; border-bottom: 1px solid var(--line); transform: scale(.97); }
}
.fm-head { position: relative; display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 8px 48px 4px; }
.fm-grip { position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 4px; background: rgba(236,228,214,.18); }
@media (min-width: 720px) { .fm-grip { display: none; } }
.fm-head h2 { margin: 6px 0 0; font: 600 15px/1.2 var(--sans); letter-spacing: .01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-x { position: absolute; right: 6px; top: 6px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.fm-x:hover, .fm-x:focus-visible { color: var(--text); background: rgba(236,228,214,.06); }
.fm-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.fm-tabs button { appearance: none; border: 0; background: transparent; color: var(--muted); font: 500 13.5px/1 var(--sans); padding: 13px 6px 12px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.fm-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.fm-tabs .fm-n { font-weight: 600; font-variant-numeric: tabular-nums; }
.fm-tabs button:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; }
.fm-search { display: flex; align-items: center; gap: 8px; margin: 12px 16px 6px; padding: 0 12px; height: 36px; border-radius: 10px; background: rgba(236,228,214,.06); color: var(--faint); }
.fm-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: 400 16px/1 var(--sans); }
@media (min-width: 720px) { .fm-search input { font-size: 14px; } }
.fm-search:focus-within { box-shadow: 0 0 0 1px var(--amber-soft); }
.fm-search input::-webkit-search-cancel-button { filter: invert(.6); }
.fm-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 4px 0 16px; }
.fm-list { list-style: none; margin: 0; padding: 0; }
.fm-row { display: flex; align-items: center; gap: 12px; padding: 8px 16px; min-height: 60px; }
.fm-av { flex: none; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: rgba(236,228,214,.07); display: block; }
.fm-av img, .fm-av .fm-fb { width: 100%; height: 100%; object-fit: cover; display: flex; align-items: center; justify-content: center; font: 500 17px var(--serif); color: rgba(236,228,214,.8); background: #2a2520; }
.fm-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fm-h { color: var(--text); font: 600 14px/1.25 var(--sans); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-h:hover { text-decoration: underline; text-underline-offset: 2px; }
.fm-sub { color: var(--muted); font: 400 12.5px/1.3 var(--sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.fm-sub .flag { font-size: 12px; }
.fm-follow { flex: none; appearance: none; min-width: 92px; height: 32px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--amber); background: var(--amber); color: #1a1510; font: 600 13px/1 var(--sans); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.fm-follow:hover { filter: brightness(1.06); }
.fm-follow[aria-pressed="true"] { background: transparent; color: var(--text); border-color: rgba(236,228,214,.22); }
.fm-follow[aria-pressed="true"]:hover { border-color: rgba(236,228,214,.4); filter: none; }
.fm-follow:disabled { opacity: .7; cursor: default; }
.fm-follow:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.fm-msg { margin: 36px 24px; text-align: center; color: var(--muted); font: 400 14px/1.5 var(--sans); }
.fm-more { display: block; margin: 12px auto 0; }
.fm-more[hidden] { display: none; }
.fm-skel .fm-av, .fm-skel .fm-txt i { background: rgba(236,228,214,.07); animation: fmPulse 1.2s ease-in-out infinite; }
.fm-skel .fm-txt i { display: block; height: 10px; border-radius: 4px; width: 40%; } .fm-skel .fm-txt i + i { width: 25%; }
@keyframes fmPulse { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .fm-sheet, .fm-backdrop { transition: none; } .fm-skel * { animation: none; } }

/* unfollow confirmation (inside the sheet) */
.fm-confirm { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(0,0,0,.55); }
.fm-confirm[hidden] { display: none; }
.fm-card { width: min(300px, 100%); display: flex; flex-direction: column; align-items: center; padding: 22px 0 0; border-radius: 16px; background: #221f1b; border: 1px solid var(--line); box-shadow: 0 12px 40px rgba(0,0,0,.5); transform: scale(.96); opacity: 0; transition: transform .15s, opacity .15s; }
.fm-confirm.on .fm-card { transform: none; opacity: 1; }
.fm-cav { width: 64px; height: 64px; }
.fm-card p { margin: 14px 20px 18px; text-align: center; font: 500 14.5px/1.4 var(--sans); color: var(--text); overflow-wrap: anywhere; }
.fm-card button { appearance: none; width: 100%; min-height: 48px; border: 0; border-top: 1px solid var(--line); background: transparent; font: 500 14px var(--sans); cursor: pointer; color: var(--text); }
.fm-card .fm-danger { color: #ed4956; font-weight: 600; }
.fm-card button:hover, .fm-card button:focus-visible { background: rgba(236,228,214,.05); outline: none; }
.fm-card button:last-child { border-radius: 0 0 16px 16px; }
