/* RareWatch social layer: avatars, the avatar picker, browse, upcoming, search, plus stats and edit-profile panels that account.js still renders.
   The top bar and account menu live in shell.css; .btn, .modal, .tab, .seg, .card are Core's (style.css). Tokens only. */

/* ---------- avatars ---------- */
.avimg { display: block; width: 100% !important; height: 100% !important; object-fit: cover; border-radius: inherit; }
.pcard .av, .bigav, .frav, .em, .who .av, .acav { overflow: hidden; }
.pcard .av:has(.avimg), .bigav:has(.avimg), .frav:has(.avimg), .who .av:has(.avimg) { background: none; padding: 0; }
.bigav:has(.avimg) { box-shadow: 0 0 0 3px var(--profile-accent); }
.frav { width: 52px; height: 52px; border-radius: var(--r-lg); }

/* avatar picker in Edit profile (rendered by account.js) */
.avpicker { border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4); background: var(--surface-1); }
.avtop { display: flex; gap: var(--s-4); align-items: center; margin-bottom: var(--s-4); flex-wrap: wrap; }
.avprev { width: 80px; height: 80px; border-radius: var(--r-xl); overflow: hidden; flex: none; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--accent); }
.avname { font: 650 var(--t-md)/var(--lh-snug) var(--font-display); color: var(--text-strong); margin-bottom: var(--s-2); min-height: 1.3em; }
.avtabs { margin: 0; }
.avgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: var(--s-2); max-height: 248px; overflow-y: auto; overscroll-behavior: contain; padding: var(--s-1); }
.avgrid.icons { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); }
.avopt { width: 100%; aspect-ratio: 1; border-radius: var(--r-lg); border: 2px solid transparent; padding: 0; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--mute); cursor: pointer; transition: background var(--fast), border-color var(--fast), color var(--fast); }
.avopt:hover { background: var(--surface-3); color: var(--text-strong); }
.avopt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.avopt.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); color: var(--text-strong); }

/* ---------- shared page pieces (browse, upcoming, search) ---------- */
.sp-page { padding-block: var(--s-6) var(--section-gap); }
.sp-head { display: grid; gap: var(--s-2); margin-bottom: var(--s-5); }
.sp-title { margin: 0; font-family: var(--font-display); font-stretch: 80%; font-weight: 750; letter-spacing: -.02em; line-height: var(--lh-tight); font-size: var(--t-3xl); color: var(--text-strong); }
.sp-sub { margin: 0; max-width: 60ch; color: var(--mute); font-size: var(--t-base); line-height: var(--lh-body); }
.sp-quiet { margin: 0; color: var(--mute); font-size: var(--t-sm); }
.sp-count { margin: var(--s-4) 0 var(--s-3); min-height: 1.4em; color: var(--mute); font-size: var(--t-sm); }

/* filter bar: labelled controls on one row that wraps */
.sp-filters { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-4); align-items: flex-end; margin-bottom: var(--s-3); }
.sp-fld { display: grid; gap: var(--s-1); min-width: 0; }
.sp-fld > span { color: var(--mute); font-size: var(--t-sm); font-weight: 600; }
.sp-select, .sp-input { height: var(--ctl); padding: 0 var(--s-3); border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--field); color: var(--text); font: 400 var(--t-base) var(--font-body); min-width: 0; margin: 0; }
.sp-select { padding-right: var(--s-2); cursor: pointer; }
.sp-input { width: min(100%, 260px); }
.sp-select:hover, .sp-input:hover { border-color: var(--faint); }
.sp-select:focus-visible, .sp-input:focus-visible, .sp-seg button:focus-visible, .sp-pill:focus-visible, .sp-chip:focus-visible, .sp-find-x:focus-visible, .swtch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sp-seg { display: inline-flex; gap: 2px; padding: 2px; height: var(--ctl); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.sp-seg button { border: 0; background: none; padding: 0 var(--s-3); border-radius: var(--r-sm); color: var(--mute); font: 600 var(--t-sm) var(--font-body); cursor: pointer; transition: color var(--fast), background var(--fast); }
.sp-seg button:hover { color: var(--text-strong); }
.sp-seg button.on { background: var(--surface-1); color: var(--text-strong); box-shadow: inset 0 0 0 1px var(--accent-line); }

/* active filters, removable */
.sp-active { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-top: var(--s-3); }
.sp-active[hidden], .sp-recent[hidden] { display: none; }
.sp-chip, .sp-pill { display: inline-flex; align-items: center; gap: var(--s-1); height: var(--ctl-sm); padding: 0 var(--s-3); border-radius: var(--r-pill); font: 600 var(--t-sm) var(--font-body); cursor: pointer; transition: background var(--fast), border-color var(--fast); }
.sp-chip { border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--text-strong); }
.sp-chip:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.sp-pill { border: 1px solid var(--line-strong); background: transparent; color: var(--text); }
.sp-pill:hover { background: var(--hover); }
.sp-pill.on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text-strong); }
.sp-pills { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-4); }
.sp-pills[hidden] { display: none; }

/* poster grid */
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: var(--s-4); }
.sp-grid.up { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }
.sp-card { display: grid; gap: var(--s-1); align-content: start; min-width: 0; color: inherit; text-decoration: none; border-radius: var(--r-poster); }
.sp-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sp-poster { position: relative; border-radius: var(--r-poster); overflow: hidden; box-shadow: 0 0 0 1px var(--line); transition: box-shadow var(--fast); margin-bottom: var(--s-1); }
.sp-card:hover .sp-poster, .sp-up:hover .sp-poster { box-shadow: 0 0 0 2px var(--accent); }
.sp-poster .poster { width: 100%; border-radius: 0; transform: none; box-shadow: none; }
.sp-ct { color: var(--text-strong); font: 650 var(--t-base)/var(--lh-snug) var(--font-body); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.sp-cm { color: var(--mute); font-size: var(--t-sm); }
.sp-st { display: inline-flex; align-items: center; gap: var(--s-1); width: fit-content; padding: 2px var(--s-2); border-radius: var(--r-pill); font-size: var(--t-xs); font-weight: 650; background: var(--accent-soft); color: var(--accent-hi); }
.sp-st.watching { background: var(--warn-soft); color: var(--warn); }
.sp-st.watched { background: var(--good-soft); color: var(--good); }
.sp-svcs { position: absolute; left: var(--s-2); right: var(--s-2); bottom: var(--s-2); display: flex; flex-wrap: wrap; gap: var(--s-1); }
.sp-svc { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; border-radius: var(--r-xs); font-size: var(--t-xs); font-weight: 650; background: var(--media-chip); color: var(--media-ink); }
.sp-svc.mine { background: var(--accent); color: var(--on-accent); }
.sp-skel { aspect-ratio: 2 / 3; border-radius: var(--r-poster); background: var(--skeleton); }
.sp-skel.prof { aspect-ratio: auto; height: 190px; border-radius: var(--r-lg); }
.sp-skel.spot { aspect-ratio: auto; height: 240px; border-radius: var(--r-xl); margin-bottom: var(--s-5); }
.moreRow { display: flex; justify-content: center; margin: var(--s-5) 0; }

/* empty and error states: say what happened, offer the next step */
.sp-empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: var(--s-3); padding: var(--s-7) var(--s-4); text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); color: var(--mute); }
.sp-empty h3 { margin: 0; font: 650 var(--t-lg)/var(--lh-snug) var(--font-display); color: var(--text-strong); }
.sp-empty p { margin: 0; max-width: 46ch; line-height: var(--lh-body); }
.sp-ei { color: var(--faint); display: inline-flex; }
.sp-acts { display: flex; flex-wrap: wrap; gap: var(--s-2); justify-content: center; margin-top: var(--s-1); }
.sp-acts.start { justify-content: flex-start; margin-top: var(--s-2); }

/* search field */
.sp-find { display: flex; align-items: center; gap: var(--s-3); height: 56px; padding: 0 var(--s-4); border-radius: var(--r-lg); background: var(--field); border: 1px solid var(--line-strong); color: var(--mute); transition: border-color var(--fast); }
.sp-find:focus-within { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 2px; }
.sp-find-in { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; box-shadow: none; background: none; color: var(--text-strong); font: 400 var(--t-md) var(--font-body); padding: 0; margin: 0; }
.sp-find-x { flex: none; width: var(--ctl-sm); height: var(--ctl-sm); display: grid; place-items: center; border: 0; border-radius: var(--r-pill); background: var(--hover); color: var(--mute); cursor: pointer; }
.sp-find-x:hover { color: var(--text-strong); background: var(--press); }
.sp-find-x[hidden] { display: none; }
.sp-recent { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-top: var(--s-3); }
.sp-recent > span { color: var(--mute); font-size: var(--t-sm); font-weight: 600; margin-right: var(--s-1); }
.sp-head + .sp-find, .sp-find { margin-bottom: 0; }
.sp-find + .sp-filters, .sp-recent + .sp-filters { margin-top: var(--s-5); }

/* streaming service filter */
.sp-svcpanel { margin-top: var(--s-3); padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-1); }
.svchead { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.svchead b { display: block; font-size: var(--t-base); color: var(--text-strong); }
.svchead small { color: var(--mute); font-size: var(--t-sm); }
.svcnote { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin-top: var(--s-3); }
.svcnote small { color: var(--mute); font-size: var(--t-sm); }
.swtch { flex: none; width: 48px; height: 28px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); padding: 2px; background: var(--surface-3); cursor: pointer; transition: background var(--med) var(--ease); }
.swtch i { display: block; width: 22px; height: 22px; border-radius: 50%; background: var(--mute); transition: transform var(--med) var(--ease), background var(--med); }
.swtch.on { background: var(--accent); border-color: var(--accent); }
.swtch.on i { transform: translateX(20px); background: var(--on-accent); }

/* browse profiles */
.sp-profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s-4); }
.sp-prof { display: grid; gap: var(--s-3); align-content: start; padding: var(--card-pad); border-radius: var(--r-lg); background: var(--surface-1); border: 1px solid var(--line); color: inherit; text-decoration: none; transition: border-color var(--fast), background var(--fast); }
.sp-prof:hover { border-color: var(--line-strong); background: var(--surface-2); }
.sp-prof:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sp-ptop { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.sp-pname { display: grid; min-width: 0; flex: 1; }
.sp-pname b { font: 650 var(--t-md)/var(--lh-snug) var(--font-display); color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-pname small { color: var(--mute); font-size: var(--t-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-pn { flex: none; color: var(--mute); font-size: var(--t-sm); }
.sp-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-1); }
.sp-strip .poster { border-radius: var(--r-xs); }

/* ---------- upcoming ---------- */
.hypehost { min-width: 0; }
.hspot { position: relative; overflow: hidden; border-radius: var(--r-xl); border: 1px solid var(--line); background: var(--surface-1); margin-bottom: var(--s-5); }
.hbg { position: absolute; inset: 0; background-size: cover; background-position: center 25%; opacity: .16; -webkit-mask-image: linear-gradient(90deg, transparent 20%, #000); mask-image: linear-gradient(90deg, transparent 20%, #000); }
.hin { position: relative; display: flex; gap: var(--s-5); padding: var(--card-pad); align-items: center; }
.hposter { flex: none; width: 168px; background: none; border: 0; padding: 0; cursor: pointer; border-radius: var(--r-poster); }
.hposter:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.hposter .pwrap { border-radius: var(--r-poster); overflow: hidden; box-shadow: var(--shadow-2), 0 0 0 1px var(--line); }
.hinfo { min-width: 0; flex: 1; display: grid; gap: var(--s-3); justify-items: start; }
.hinfo h2 { margin: 0; font-family: var(--font-display); font-stretch: 80%; font-weight: 750; letter-spacing: -.02em; line-height: var(--lh-tight); font-size: clamp(28px, 4vw, 44px); color: var(--text-strong); }
.hinfo .ov { margin: 0; max-width: 62ch; color: var(--text); line-height: var(--lh-body); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hrank { margin: 0; color: var(--accent-hi); font-size: var(--t-sm); font-weight: 650; }
.hinfo .sp-hype { width: min(100%, 340px); }
.hinfo .tags { display: flex; flex-wrap: wrap; gap: var(--s-2); }

.sp-hype { display: grid; gap: var(--s-1); }
.sp-hype-l { display: flex; justify-content: space-between; gap: var(--s-2); color: var(--mute); font-size: var(--t-xs); }
.sp-hype-l b { color: var(--text-strong); font-weight: 650; }
.sp-hype-bar { height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.sp-hype-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

.sp-up { display: grid; gap: var(--s-2); align-content: start; min-width: 0; }
.sp-upbtn { display: grid; gap: var(--s-1); align-content: start; width: 100%; padding: 0; border: 0; background: none; text-align: left; color: inherit; cursor: pointer; border-radius: var(--r-poster); }
.sp-upbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sp-up .sp-poster { transform: none; }
.sp-rank, .sp-when { position: absolute; padding: 2px 6px; border-radius: var(--r-xs); background: var(--media-chip); color: var(--media-ink); font-size: var(--t-xs); font-weight: 700; line-height: 1.5; }
.sp-rank { top: var(--s-2); left: var(--s-2); }
.sp-when { right: var(--s-2); bottom: var(--s-2); }
.sp-when.now { background: var(--accent); color: var(--on-accent); }
.sp-up-d { display: flex; flex-wrap: wrap; gap: 0 var(--s-1); font-size: var(--t-sm); color: var(--mute); }
.sp-up-d b { color: var(--text); font-weight: 600; }
.sp-add { width: fit-content; }
.sp-add.on, .sp-add.on:disabled { opacity: 1; color: var(--good); }
.sp-group { margin-top: var(--section-gap); }
.sp-filters + .sp-active + .sp-count + .upgroups > .sp-group:first-child { margin-top: var(--s-3); }
.sp-gh { margin-bottom: var(--s-4); }
.sp-gh h2 { margin: 0; font: 650 var(--t-lg)/var(--lh-snug) var(--font-display); color: var(--text-strong); }
.sp-gh p { margin: var(--s-1) 0 0; color: var(--mute); font-size: var(--t-sm); }
.sp-n { margin-left: var(--s-2); color: var(--mute); font-weight: 500; }
.sp-src { margin: var(--section-gap) 0 0; color: var(--faint); font-size: var(--t-sm); }

/* notes, errors, lite title page */
.dnote { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin: var(--s-3) 0; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); font-size: var(--t-sm); color: var(--text); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.dnote[hidden] { display: none; }
.dnote svg { flex: none; }
.dnote span { flex: 1 1 220px; }
.litebox { display: grid; grid-template-columns: minmax(120px, 220px) 1fr; gap: var(--s-5); align-items: start; }
.litep .poster { aspect-ratio: 2 / 3; border-radius: var(--r-poster); }
.litetext { display: grid; gap: var(--s-3); max-width: 60ch; }
.litetext p { margin: 0; line-height: var(--lh-body); }

/* home banner seam (full-bleed, outside .wrap) */
.herobar { position: relative; width: 100%; max-width: none; margin: 0; }
.herobar.hero, .herobar.minihero { padding-inline: max(16px, calc((100vw - 1180px) / 2)); }

.btngroup { display: inline-flex; gap: var(--s-2); }

@media (max-width: 640px) {
  .sp-page { padding-block: var(--s-5) var(--section-gap); }
  .sp-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  .sp-grid.up { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
  .sp-filters .sp-fld { flex: 1 1 140px; }
  .sp-filters .sp-fld .sp-select, .sp-filters .sp-fld .sp-input { width: 100%; }
  .sp-seg { width: 100%; } .sp-seg button { flex: 1; }
  .sp-find { height: 52px; }
  .sp-find-in { font-size: 16px; }
  .hin { flex-direction: column; align-items: flex-start; }
  .hposter { width: 132px; }
  .litebox { grid-template-columns: 1fr; } .litep { max-width: 200px; }
  .svchead { align-items: flex-start; }
}

/* ---------- stats panels (rendered by account.js; Account may restyle these in account.css) ---------- */
.scard { padding: var(--card-pad); margin: 0 0 var(--s-4); border-radius: var(--r-lg); background: var(--surface-1); border: 1px solid var(--line); }
.schead { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-3); margin-bottom: var(--s-4); }
.schead h3 { margin: 0; font: 650 var(--t-lg)/var(--lh-snug) var(--font-display); color: var(--text-strong); }
.schead small { color: var(--mute); display: block; margin-top: var(--s-1); }
.tag.vis { cursor: pointer; font-size: var(--t-xs); padding: var(--s-1) var(--s-3); white-space: nowrap; }
.tag.vis.on { color: var(--good); border-color: color-mix(in srgb, var(--good) 50%, transparent); background: var(--good-soft); }
.privbar { display: flex; align-items: center; gap: var(--s-4); padding: var(--s-3) var(--s-4); border-radius: var(--r-lg); margin-bottom: var(--s-4); flex-wrap: wrap; background: var(--surface-1); border: 1px solid var(--line); }
.privbar > .ic { color: var(--accent); flex: none; }
.privbar > div:nth-child(2) { flex: 1; min-width: 200px; }
.privbar b { color: var(--text-strong); display: block; } .privbar small { color: var(--mute); }
.privbtns { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.taste { display: inline-flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3); border-radius: var(--r-md); margin-bottom: var(--s-3); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.taste .ic { color: var(--accent); } .taste span { color: var(--mute); font-size: var(--t-sm); } .taste b { color: var(--text-strong); font: 650 var(--t-md) var(--font-display); }
.scard .stats-grid { margin-bottom: 0; }
.scard .stat { padding: var(--s-3) var(--s-4); }
.scard .stat b { font-size: var(--t-xl); word-break: break-word; }
.scard .stat small { color: var(--mute); font-size: var(--t-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.timehero, .ratehero { display: flex; gap: var(--s-5); align-items: center; flex-wrap: wrap; margin-bottom: var(--s-4); }
.stat.big { background: none; border: 0; box-shadow: none; padding: 0; }
.stat.big::before { display: none; }
.stat.big b { font: 800 clamp(54px, 9vw, 84px)/1 var(--font-display); font-stretch: 80%; letter-spacing: -.02em; color: var(--text-strong); }
.stat.big span { font-size: var(--t-sm); }
.timeside { display: flex; flex-direction: column; gap: var(--s-2); color: var(--mute); font-size: var(--t-base); }
.timeside b { color: var(--text-strong); font-family: var(--font-display); }
.sbars { display: flex; flex-direction: column; gap: var(--s-2); }
.sbar { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 30px 38px; gap: var(--s-3); align-items: center; font-size: var(--t-sm); }
.sbar .sl { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbar .sb { height: 8px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.sbar .sb i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.sbar b { color: var(--text-strong); text-align: right; } .sbar small { color: var(--mute); }
.scard .vbars { height: 110px; margin-bottom: var(--s-1); }
.scard .vbars i { background: var(--accent); }
.vbars.rate10 { grid-template-columns: repeat(10, 1fr); width: min(360px, 100%); flex: 1; min-width: 220px; }
.vbars.wk { grid-template-columns: repeat(7, 1fr); }
.strip6 { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.sposter { position: relative; width: 78px; display: block; }
.sposter .poster { width: 78px; border-radius: var(--r-poster); }
.sposter b { position: absolute; right: var(--s-1); bottom: var(--s-1); background: var(--media-chip); color: var(--media-ink); border-radius: var(--r-xs); padding: 0 6px; font: 700 var(--t-xs)/18px var(--font-body); }
@media (max-width: 640px) { .sbar { grid-template-columns: minmax(70px, 110px) 1fr 26px; } .sbar small { display: none; } }

/* ---------- settings (Edit profile dialog, rendered by account.js) ---------- */
.modal.settings { width: min(860px, 100%); height: min(680px, 92vh); padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.settings .shead { padding: var(--s-5) var(--s-5) var(--s-3); border-bottom: 1px solid var(--line); }
.settings .shead h3 { margin: 0; font: 650 var(--t-lg)/var(--lh-snug) var(--font-display); color: var(--text-strong); }
.settings .shead small { color: var(--mute); }
.settings .sbody { flex: 1; min-height: 0; display: grid; grid-template-columns: 200px 1fr; }
.srail { display: flex; flex-direction: column; gap: var(--s-1); padding: var(--s-3); border-right: 1px solid var(--line); overflow-y: auto; }
.stab { display: flex; align-items: center; gap: var(--s-3); min-height: var(--ctl); padding: 0 var(--s-3); border: 0; border-radius: var(--r-md); background: none; color: var(--mute); font: 600 var(--t-sm) var(--font-body); text-align: left; cursor: pointer; transition: background var(--fast), color var(--fast); }
.stab:hover { background: var(--hover); color: var(--text-strong); }
.stab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.stab.on { background: var(--accent-soft); color: var(--text-strong); box-shadow: inset 3px 0 0 var(--accent); }
.sstage { overflow-y: auto; padding: var(--s-4) var(--s-5); min-height: 0; }
.spanel { display: grid; gap: var(--s-4); }
.sgroup { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4); }
.sgroup h4 { margin: 0 0 var(--s-1); font: 650 var(--t-md)/var(--lh-snug) var(--font-display); color: var(--text-strong); }
.sgroup .hint { margin: 0 0 var(--s-3); }
.sgroup .field:last-child { margin-bottom: 0; }
.sgroup .count { display: block; text-align: right; color: var(--mute); margin-top: var(--s-1); }
.settings .err { padding: 0 var(--s-5); }
.sfoot { margin: 0; padding: var(--s-3) var(--s-5); border-top: 1px solid var(--line); background: var(--surface-2); }
.settings .x { z-index: 2; }
@media (max-width: 640px) {
  .modal.settings { height: 94vh; }
  .settings .sbody { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .srail { flex-direction: row; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--line); padding: var(--s-2) var(--s-3); }
  .stab { flex: none; }
  .stab.on { box-shadow: inset 0 -3px 0 var(--accent); }
  .sstage, .settings .shead, .sfoot, .settings .err { padding-left: var(--s-4); padding-right: var(--s-4); }
}
