/* account.css — sign-in, sign-up and dashboard chrome.
 *
 * Matches the existing site: the same system font stack index.php already
 * uses, and the same violet family (#4c1d95 / #7c3aed) as the Experiences
 * heading. Self-hosted only — no font CDN, keeping the zero-third-party
 * property established on 2026-08-22.
 */

:root {
  --sa-ink:      #1f2937;
  --sa-muted:    #6b7280;
  --sa-line:     #e5e7eb;
  --sa-bg:       #f7f7fb;
  --sa-card:     #ffffff;
  --sa-brand:    #4c1d95;
  --sa-brand-2:  #7c3aed;
  --sa-ok:       #15803d;
  --sa-ok-bg:    #dcfce7;
  --sa-err:      #b91c1c;
  --sa-err-bg:   #fee2e2;
  --sa-warn:     #92400e;
  --sa-warn-bg:  #fef3c7;
  --sa-radius:   14px;
}

.sa-page {
  margin: 0;
  background: var(--sa-bg);
  color: var(--sa-ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.sa-wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
  box-sizing: border-box;
}
/* vh first as a fallback for browsers without dvh */
@supports not (height: 100dvh) { .sa-wrap { min-height: 100vh; } }

.sa-card {
  width: 100%;
  max-width: 420px;
  background: var(--sa-card);
  border: 1px solid var(--sa-line);
  border-radius: var(--sa-radius);
  padding: 30px 28px 26px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 12px 32px -12px rgba(16,24,40,.12);
  box-sizing: border-box;
}
.sa-card--wide { max-width: 760px; }

.sa-brandbar { text-align: center; margin-bottom: 20px; }
.sa-brandbar img { width: 44px; height: 44px; border-radius: 10px; }
.sa-brandbar a { text-decoration: none; color: inherit; }

.sa-title    { font-size: 1.4rem; font-weight: 700; margin: 0 0 6px; letter-spacing: -.01em; }
.sa-subtitle { color: var(--sa-muted); font-size: .93rem; margin: 0 0 22px; }

/* ---------- fields ---------- */
.sa-field { margin-bottom: 15px; }
.sa-field label {
  display: block; font-size: .84rem; font-weight: 600;
  margin-bottom: 6px; color: #374151;
}
.sa-input {
  width: 100%; box-sizing: border-box;
  padding: 11px 13px;
  font: inherit; font-size: .95rem;
  color: var(--sa-ink);
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 9px;
  transition: border-color .15s, box-shadow .15s;
}
.sa-input:focus {
  outline: none;
  border-color: var(--sa-brand-2);
  box-shadow: 0 0 0 3px rgba(124,58,237,.15);
}
.sa-input[aria-invalid="true"] { border-color: var(--sa-err); }

.sa-hint { font-size: .78rem; color: var(--sa-muted); margin-top: 5px; }

.sa-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 18px; }
.sa-check { display: flex; align-items: center; gap: 7px; font-size: .86rem; color: #374151; }
.sa-check input { width: 15px; height: 15px; accent-color: var(--sa-brand-2); }

/* ---------- buttons ---------- */
.sa-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; box-sizing: border-box;
  padding: 12px 16px;
  font: inherit; font-size: .95rem; font-weight: 600;
  border-radius: 9px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: filter .15s, background .15s;
}
.sa-btn:hover  { filter: brightness(.96); }
.sa-btn:active { filter: brightness(.92); }
.sa-btn:focus-visible { outline: 2px solid var(--sa-brand-2); outline-offset: 2px; }

.sa-btn--primary { background: var(--sa-brand); color: #fff; }
.sa-btn--ghost   { background: #fff; color: var(--sa-ink); border-color: #d1d5db; }
.sa-btn--danger  { background: #fff; color: var(--sa-err); border-color: #fecaca; }
.sa-btn[disabled], .sa-btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

/* ---------- social ---------- */
.sa-social { display: grid; gap: 9px; margin-bottom: 4px; }
.sa-social .sa-btn { font-weight: 500; }
.sa-social svg { flex: 0 0 auto; }

.sa-or {
  display: flex; align-items: center; gap: 12px;
  color: var(--sa-muted); font-size: .78rem; text-transform: uppercase;
  letter-spacing: .06em; margin: 20px 0;
}
.sa-or::before, .sa-or::after {
  content: ""; flex: 1; height: 1px; background: var(--sa-line);
}

/* ---------- messages ---------- */
.sa-msg {
  border-radius: 9px; padding: 11px 13px; font-size: .88rem;
  margin-bottom: 16px; border: 1px solid transparent;
}
.sa-msg--error   { background: var(--sa-err-bg);  color: var(--sa-err);  border-color: #fecaca; }
.sa-msg--success { background: var(--sa-ok-bg);   color: var(--sa-ok);   border-color: #bbf7d0; }
.sa-msg--info    { background: #eef2ff;           color: #3730a3;        border-color: #c7d2fe; }
.sa-msg--warning { background: var(--sa-warn-bg); color: var(--sa-warn); border-color: #fde68a; }
.sa-msg ul { margin: 6px 0 0; padding-left: 18px; }

.sa-foot { text-align: center; font-size: .88rem; color: var(--sa-muted); margin-top: 20px; }
.sa-foot a, .sa-link { color: var(--sa-brand-2); text-decoration: none; font-weight: 600; }
.sa-foot a:hover, .sa-link:hover { text-decoration: underline; }

.sa-legal { text-align: center; font-size: .74rem; color: #9ca3af; margin-top: 18px; line-height: 1.5; }
.sa-legal a { color: #9ca3af; text-decoration: underline; }

/* ---------- avatar picker ---------- */
.sa-avatars {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
  gap: 10px; margin: 4px 0 6px;
}
.sa-avatar-opt { position: relative; }
.sa-avatar-opt input {
  position: absolute; opacity: 0; width: 100%; height: 100%;
  margin: 0; cursor: pointer;
}
.sa-avatar-opt img {
  width: 100%; height: auto; display: block;
  border-radius: 50%; padding: 3px;
  border: 2px solid transparent; background: #fff;
  transition: border-color .12s, transform .12s;
}
.sa-avatar-opt input:checked + img { border-color: var(--sa-brand-2); transform: scale(1.06); }
.sa-avatar-opt input:focus-visible + img { outline: 2px solid var(--sa-brand-2); outline-offset: 2px; }
.sa-avatar-opt:hover img { border-color: #d8b4fe; }

/* ---------- the header chip, used across the whole site ---------- */
.saplus-acct {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--sa-line);
  background: #fff;
  color: var(--sa-ink);
  text-decoration: none;
  font-size: .86rem; font-weight: 600;
  line-height: 1;
  transition: border-color .15s, box-shadow .15s;
}
.saplus-acct:hover { border-color: #c4b5fd; box-shadow: 0 2px 8px rgba(76,29,149,.08); }
.saplus-acct-avatar { width: 32px; height: 32px; border-radius: 50%; display: block; background: #f3f4f6; }
.saplus-acct-icon { display: inline-flex; color: var(--sa-muted); padding-left: 4px; }
.saplus-acct-label { white-space: nowrap; }
@media (max-width: 420px) { .saplus-acct-label { display: none; } .saplus-acct { padding: 6px 8px; } }

@media (prefers-reduced-motion: reduce) {
  .sa-btn, .sa-input, .sa-avatar-opt img, .saplus-acct { transition: none; }
}

/* ===================== signed-in area =====================
 * A wider, calmer layout than the auth cards: large type, generous
 * whitespace, soft pastel tiles drawn from the site's own violet family.
 * The system font stack resolves to SF Pro on Apple devices, so the tight
 * negative tracking on headings lands the way it is meant to.
 */

.sa-shell {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 72px;
  box-sizing: border-box;
}
.sa-wrap--dash {
  display: block;
  min-height: 100dvh;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
}
@supports not (height: 100dvh) { .sa-wrap--dash { min-height: 100vh; } }

/* ---------- top bar ---------- */
.sa-topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 30px;
}
.sa-topbar-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--sa-ink); }
.sa-topbar-brand img { width: 36px; height: 36px; border-radius: 9px; display: block; }
.sa-topbar-brand span { font-weight: 700; font-size: .96rem; letter-spacing: -.01em; }
@media (max-width: 480px) { .sa-topbar-brand span { display: none; } }

/* ---------- hero ---------- */
.sa-hero {
  position: relative; overflow: hidden;
  border-radius: 26px;
  padding: 42px 36px;
  margin-bottom: 26px;
  background:
    radial-gradient(1100px 320px at 12% -30%, rgba(124,58,237,.30), transparent 60%),
    radial-gradient(900px 300px at 92% 0%,  rgba(219,39,119,.20), transparent 62%),
    linear-gradient(135deg, #f6f2ff 0%, #fdf4ff 48%, #eef4ff 100%);
  border: 1px solid #eae4fa;
  text-align: center;
}
.sa-hero-avatar {
  box-sizing: border-box;
  width: 104px; height: 104px; border-radius: 50%;
  display: block; margin: 0 auto 18px;
  background: #fff; padding: 5px;
  box-shadow: 0 0 0 1px #e6dcfb, 0 14px 34px -12px rgba(76,29,149,.42);
}
.sa-hero-name {
  margin: 0 0 8px;
  font-size: clamp(1.9rem, 5.2vw, 2.65rem);
  font-weight: 700; letter-spacing: -.032em; line-height: 1.08;
  color: #17122b;
}
.sa-hero-mail { margin: 0; color: #6b6580; font-size: 1.02rem; word-break: break-word; }
.sa-hero-badges { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

.sa-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .76rem; font-weight: 700; letter-spacing: .02em;
  padding: 6px 13px; border-radius: 999px;
}
.sa-badge--ok   { background: #dcfce7; color: #14532d; }
.sa-badge--warn { background: #fef3c7; color: #78350f; }
.sa-badge--pro  { background: linear-gradient(135deg,#7c3aed,#db2777); color: #fff; }

/* ---------- tabs ---------- */
.sa-nav {
  display: flex; gap: 6px; margin-bottom: 26px;
  background: #f1eefb; padding: 6px; border-radius: 16px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.sa-nav::-webkit-scrollbar { display: none; }
.sa-nav a {
  flex: 1 0 auto; text-align: center; white-space: nowrap;
  font-size: .93rem; font-weight: 600; text-decoration: none;
  color: #635d7a; padding: 11px 20px; border-radius: 11px;
  transition: background .16s, color .16s, box-shadow .16s;
}
.sa-nav a:hover { color: var(--sa-brand); }
.sa-nav a[aria-current="page"] {
  background: #fff; color: var(--sa-brand);
  box-shadow: 0 1px 2px rgba(16,24,40,.05), 0 6px 16px -8px rgba(76,29,149,.30);
}

/* ---------- stat tiles ---------- */
.sa-tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
  gap: 16px; margin-bottom: 30px;
}
.sa-tile {
  border-radius: 22px; padding: 26px 26px 24px;
  border: 1px solid transparent; position: relative; overflow: hidden;
}
.sa-tile--violet { background: linear-gradient(160deg,#f3edff,#fbf7ff); border-color: #e9e0fb; }
.sa-tile--mint   { background: linear-gradient(160deg,#e6f9ef,#f5fdf8); border-color: #cdeedd; }
.sa-tile--sky    { background: linear-gradient(160deg,#e8f1ff,#f6faff); border-color: #d6e5fb; }

.sa-tile-label {
  font-size: .76rem; text-transform: uppercase; letter-spacing: .07em;
  font-weight: 700; color: #6b6580; margin-bottom: 10px;
}
.sa-tile-value {
  font-size: clamp(2.1rem, 6vw, 2.9rem); font-weight: 700;
  letter-spacing: -.035em; line-height: 1; color: #17122b;
}
.sa-tile-unit { font-size: 1rem; font-weight: 600; color: #6b6580; letter-spacing: 0; }
.sa-tile-note { font-size: .86rem; color: #6b6580; margin-top: 10px; }

.sa-meter { height: 8px; background: rgba(23,18,43,.09); border-radius: 99px; overflow: hidden; margin-top: 14px; }
.sa-meter span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg,#7c3aed,#a855f7); }
.sa-meter--full span { background: linear-gradient(90deg,#f59e0b,#f97316); }

/* ---------- panels ---------- */
.sa-panel {
  background: #fff; border: 1px solid #ece9f5; border-radius: 22px;
  padding: 28px; margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(16,24,40,.03);
}
.sa-panel-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px; margin-bottom: 18px; flex-wrap: wrap;
}
.sa-panel h2 {
  font-size: 1.28rem; font-weight: 700; letter-spacing: -.022em;
  margin: 0; color: #17122b;
}
.sa-panel-sub { font-size: .9rem; color: #6b6580; margin: 4px 0 0; }

/* ---------- rows ---------- */
.sa-list { list-style: none; margin: 0; padding: 0; }
.sa-list li {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 4px; border-bottom: 1px solid #f2f0f8;
}
.sa-list li:last-child { border-bottom: 0; }
.sa-list li:first-child { padding-top: 0; }
.sa-list-main { flex: 1; min-width: 0; }
.sa-list-main a { color: #17122b; text-decoration: none; font-weight: 650; font-size: 1rem; }
.sa-list-main a:hover { color: var(--sa-brand-2); }
.sa-list-sub { color: #6b6580; font-size: .86rem; margin-top: 3px; }
.sa-list-when { color: #918ba6; font-size: .84rem; white-space: nowrap; flex: 0 0 auto; }
@media (max-width: 560px) {
  .sa-list li { flex-wrap: wrap; }
  .sa-list-when { width: 100%; }
}

.sa-empty {
  border: 1px dashed #ddd6f3; border-radius: 18px;
  padding: 40px 24px; text-align: center; color: #6b6580; font-size: .95rem;
  background: #fcfbff;
}
.sa-empty a { color: var(--sa-brand-2); font-weight: 650; }

.sa-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.sa-actions .sa-btn { width: auto; flex: 0 0 auto; padding: 12px 22px; font-size: .92rem; border-radius: 12px; }

.sa-provider { display: inline-flex; align-items: center; gap: 9px; font-weight: 650; font-size: 1rem; }

/* Bigger, calmer form controls inside the signed-in area. */
.sa-panel .sa-input { padding: 13px 15px; font-size: 1rem; border-radius: 12px; }
.sa-panel .sa-field { margin-bottom: 20px; }
.sa-panel .sa-field label { font-size: .89rem; margin-bottom: 8px; }
.sa-panel .sa-avatars { grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 14px; }

@media (max-width: 640px) {
  .sa-shell { padding: 18px 14px 56px; }
  .sa-hero  { padding: 32px 20px; border-radius: 22px; }
  .sa-panel { padding: 22px 18px; border-radius: 20px; }
  .sa-tile  { padding: 22px 20px; border-radius: 18px; }
  .sa-actions .sa-btn { width: 100%; }
}

/* ============ pricing: the Unlimited Pass (/account/upgrade.php) ============
 * The page header and the two plan cards, and nothing else: the panels,
 * lists, buttons and badges further down that page are the dashboard
 * furniture defined above, reused as-is.
 *
 * The cards are one grid, so the desktop pair and the phone stack are the
 * same markup. The recommended card is raised with a negative margin rather
 * than a transform, which keeps the lift honest when motion is turned off
 * and leaves transform free for the hover.
 */

.sa-pricehead { max-width: 660px; margin: 2px 0 26px; }
.sa-pricehead h1 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 4.6vw, 2.15rem);
  font-weight: 750; letter-spacing: -.03em; line-height: 1.14;
  color: #17122b;
}
.sa-pricehead p { margin: 0; color: #6b6580; font-size: 1.02rem; }
.sa-pricehead strong { color: #17122b; font-weight: 650; }

.sa-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: 18px;
  align-items: stretch;
  margin: 0 0 24px;
}

.sa-plan {
  position: relative;
  display: flex; flex-direction: column;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #ece9f5;
  border-radius: 22px;
  padding: 26px 26px 24px;
  box-shadow: 0 1px 2px rgba(16,24,40,.03);
  transition: transform .28s cubic-bezier(.22,.9,.3,1), box-shadow .28s, border-color .28s;
}
.sa-plan:hover { transform: translateY(-4px); box-shadow: 0 16px 34px -20px rgba(23,18,43,.30); }
.sa-plan:focus-within { border-color: #c4b5fd; }

/* The yearly card. The ribbon carries the wording, so the colour is never
   the only thing saying which plan is recommended. */
.sa-plan--best {
  margin-top: -10px;
  border: 2px solid #c4b5fd;
  background: linear-gradient(180deg, #faf7ff 0%, #fff 44%);
  box-shadow: 0 1px 2px rgba(16,24,40,.03), 0 18px 40px -22px rgba(76,29,149,.45);
}
.sa-plan--best:hover { box-shadow: 0 1px 2px rgba(16,24,40,.03), 0 24px 46px -22px rgba(76,29,149,.50); }

.sa-plan-flag {
  position: absolute; top: 16px; right: 18px;
  display: inline-flex; align-items: center;
  padding: 5px 12px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  background: linear-gradient(135deg, #7c3aed, #db2777); color: #fff;
  box-shadow: 0 8px 16px -10px rgba(124,58,237,.85);
  white-space: nowrap;
}

.sa-plan-name {
  margin: 0 0 12px;
  font-size: 1.06rem; font-weight: 700; letter-spacing: -.015em;
  color: #17122b;
}
/* Keeps a long plan name clear of the ribbon above it. */
.sa-plan--best .sa-plan-name { padding-right: 100px; }

.sa-plan-price {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px;
  font-size: clamp(2.05rem, 5.6vw, 2.6rem); font-weight: 700;
  letter-spacing: -.035em; line-height: 1; color: #17122b;
  font-variant-numeric: tabular-nums;
}
.sa-plan-price span {
  font-size: 1rem; font-weight: 600; letter-spacing: 0;
  color: #6b6580; font-variant-numeric: normal;
}

.sa-plan-note { margin: 12px 0 22px; color: #6b6580; font-size: .92rem; }

/* Buttons sit on the bottom edge of both cards, whatever the note runs to. */
.sa-plan .sa-btn { margin-top: auto; min-height: 48px; padding: 13px 18px; border-radius: 12px; }

@media (max-width: 640px) {
  .sa-plans { grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px; }
  .sa-plan  { padding: 22px 18px 20px; border-radius: 20px; }
  /* Stacked, there is nothing left to be raised above. */
  .sa-plan--best { margin-top: 0; }
}

@media (max-width: 480px) {
  .sa-pricehead { margin-bottom: 20px; }
  .sa-pricehead p { font-size: .96rem; }
  .sa-plan-flag { top: 14px; right: 14px; padding: 4px 10px; font-size: .68rem; }
  .sa-plan--best .sa-plan-name { padding-right: 88px; }
  .sa-plan-note { margin-bottom: 18px; }
  .sa-plan .sa-btn { min-height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  .sa-plan { transition: none; }
  .sa-plan:hover { transform: none; }
}

/* Shared blocks the pricing page needs a different alignment for. These exist
   so /account/upgrade.php carries no inline styles: `.sa-empty` and `.sa-legal`
   both centre by default, which is right for a one-line notice and wrong for a
   paragraph of prose. `.sa-actions--spaced` lifts an action row off the list
   above it when it sits at the foot of a panel rather than after a form. */
.sa-empty--start   { text-align: left; }
.sa-legal--start   { text-align: left; margin-top: 6px; }
.sa-actions--spaced { margin-top: 20px; }

/* ============ locked experience (xp-gate.php) ============
 * Uses the same card, brandbar, title and buttons as the sign-in and sign-up
 * screens so all four read as one interface. Only the pieces unique to a
 * locked experience are defined here.
 */
.sa-wrap--flow { min-height: auto; padding: 44px 18px 26px; }
.sa-card--centred, .sa-wrap--flow .sa-card { text-align: center; }

.sa-eyebrow {
  font-size: .74rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--sa-brand-2); margin: 0 0 6px;
}
.sa-wrap--flow .sa-title { font-size: 1.5rem; }
.sa-wrap--flow .sa-subtitle { margin-bottom: 22px; }

.sa-lock {
  background: #faf9ff; border: 1px solid #e9e5f8; border-radius: 12px;
  padding: 20px; margin-bottom: 20px; color: var(--sa-brand-2);
}
.sa-lock-title { margin: 8px 0 4px; font-weight: 700; font-size: .98rem; color: var(--sa-ink); }
.sa-lock-note  { margin: 0; color: var(--sa-muted); font-size: .87rem; }

.sa-aside {
  margin-top: 24px; padding-top: 18px;
  border-top: 1px solid var(--sa-line); text-align: left;
}
.sa-aside-title { font-size: .8rem; font-weight: 700; color: #374151; margin: 0 0 8px; }
.sa-aside-list {
  margin: 0; padding-left: 18px;
  color: var(--sa-muted); font-size: .87rem; line-height: 1.8;
}

/* ============ rendered markdown (/account/guide.php) ============ */
.md { line-height: 1.7; color: #2b2740; }
.md h1 { font-size: clamp(1.7rem,4.4vw,2.2rem); font-weight: 700; letter-spacing: -.03em; margin: 0 0 6px; color: #17122b; }
.md h2 { font-size: 1.35rem; font-weight: 700; letter-spacing: -.022em; margin: 38px 0 12px; color: #17122b;
         padding-top: 20px; border-top: 1px solid #f0edf8; }
.md h1 + h2, .md h2:first-child { border-top: 0; padding-top: 0; margin-top: 8px; }
.md h3 { font-size: 1.08rem; font-weight: 700; letter-spacing: -.012em; margin: 26px 0 8px; color: #17122b; }
.md p  { margin: 0 0 14px; }
.md ul, .md ol { margin: 0 0 16px; padding-left: 22px; }
.md li { margin-bottom: 7px; }
.md a  { color: var(--sa-brand-2); font-weight: 600; }
.md strong { color: #17122b; }
.md hr { border: 0; border-top: 1px solid #eeebf7; margin: 30px 0; }

.md code {
  background: #f4f1fc; color: #4c1d95; padding: 2px 6px; border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em;
  word-break: break-word;
}
.md pre {
  background: #17122b; color: #e9e4ff; padding: 16px 18px; border-radius: 12px;
  overflow-x: auto; margin: 0 0 18px; font-size: .86rem; line-height: 1.55;
}
.md pre code { background: none; color: inherit; padding: 0; font-size: inherit; }

.md blockquote {
  margin: 0 0 18px; padding: 14px 18px;
  background: #fff8e8; border-left: 3px solid #f59e0b; border-radius: 0 10px 10px 0;
  color: #78350f; font-size: .93rem;
}

/* Wide tables scroll inside their own box; the page never scrolls sideways. */
.md .md-scroll { overflow-x: auto; margin: 0 0 20px; -webkit-overflow-scrolling: touch; }
.md table { border-collapse: collapse; width: 100%; min-width: 460px; font-size: .91rem; }
.md th, .md td { text-align: left; padding: 11px 13px; border-bottom: 1px solid #eeebf7; vertical-align: top; }
.md th { background: #f7f4fe; font-weight: 700; color: #17122b; white-space: nowrap; }
.md tbody tr:last-child td { border-bottom: 0; }

/* ===================== motion =====================
 * Drifting gradients, entrance animations, hover lift and counting numbers.
 * Every rule here is inert under prefers-reduced-motion (see the block at the
 * end) — the layout must stand up completely without any of it.
 */

/* ---------- floating gradient blobs behind the hero ---------- */
.sa-hero::before,
.sa-hero::after {
  content: ""; position: absolute; border-radius: 50%;
  filter: blur(46px); pointer-events: none; z-index: 0;
}
.sa-hero::before {
  width: 330px; height: 330px; top: -130px; left: -90px;
  background: radial-gradient(circle, rgba(124,58,237,.34), transparent 70%);
  animation: sa-drift-a 17s ease-in-out infinite;
}
.sa-hero::after {
  width: 290px; height: 290px; bottom: -140px; right: -70px;
  background: radial-gradient(circle, rgba(219,39,119,.28), transparent 70%);
  animation: sa-drift-b 21s ease-in-out infinite;
}
.sa-hero > * { position: relative; z-index: 1; }

@keyframes sa-drift-a {
  0%,100% { transform: translate(0,0) scale(1); }
  33%     { transform: translate(60px,34px) scale(1.14); }
  66%     { transform: translate(24px,64px) scale(.94); }
}
@keyframes sa-drift-b {
  0%,100% { transform: translate(0,0) scale(1); }
  40%     { transform: translate(-52px,-30px) scale(1.1); }
  70%     { transform: translate(-20px,-58px) scale(.96); }
}

/* ---------- avatar: rotating gradient ring + gentle float ---------- */
.sa-hero-figure {
  position: relative; width: 118px; height: 118px;
  margin: 0 auto 18px; animation: sa-float 6s ease-in-out infinite;
}
.sa-hero-figure::before {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  background: conic-gradient(from 0deg, #7c3aed, #db2777, #4c1d95, #22c55e, #7c3aed);
  animation: sa-spin 9s linear infinite;
}
.sa-hero-figure::after {
  content: ""; position: absolute; inset: 2px; border-radius: 50%;
  background: #fff;
}
.sa-hero-figure .sa-hero-avatar {
  position: relative; z-index: 2;
  /* border-box is REQUIRED here. With the default content-box the 9px padding
     is added OUTSIDE the 118px width, rendering a 136px image inside a 118px
     figure — it overflows by 9px on every side and the ring, drawn on the
     figure, ends up smaller than the image it is meant to surround. */
  box-sizing: border-box;
  width: 118px; height: 118px; margin: 0;
  box-shadow: none; padding: 9px; background: transparent;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1);
}
.sa-hero-figure:hover .sa-hero-avatar { transform: scale(1.07) rotate(-4deg); }

@keyframes sa-spin  { to { transform: rotate(360deg); } }
@keyframes sa-float {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-9px); }
}

/* ---------- entrance ---------- */
@keyframes sa-rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.sa-hero, .sa-nav, .sa-tile, .sa-panel, .sa-actions {
  /* `backwards`, NOT `both`. A filled animation keeps applying its final
     keyframe forever, and a running animation's declarations outrank normal
     author ones -- so with `both` the `to { transform: none }` below silently
     beat `.sa-tile:hover { transform: translateY(-6px) }` and the hover lifts
     never rendered at all. `backwards` still applies the `from` frame during
     the delay (which is what stops the flash of unstyled position), then lets
     go once the animation ends. The resting state is identical either way. */
  animation: sa-rise .6s cubic-bezier(.22,.9,.3,1) backwards;
}
.sa-nav             { animation-delay: .06s; }
.sa-tile:nth-child(1){ animation-delay: .10s; }
.sa-tile:nth-child(2){ animation-delay: .17s; }
.sa-tile:nth-child(3){ animation-delay: .24s; }
.sa-panel:nth-of-type(1){ animation-delay: .28s; }
.sa-panel:nth-of-type(2){ animation-delay: .34s; }
.sa-panel:nth-of-type(3){ animation-delay: .40s; }
.sa-panel:nth-of-type(4){ animation-delay: .46s; }
.sa-actions         { animation-delay: .52s; }

/* ---------- hover ---------- */
.sa-tile {
  transition: transform .28s cubic-bezier(.22,.9,.3,1), box-shadow .28s;
  will-change: transform;
}
.sa-tile:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 38px -18px rgba(76,29,149,.42);
}
/* a slow sheen sweeping across the tile on hover */
.sa-tile::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.62) 50%, transparent 62%);
  transform: translateX(-120%);
  transition: transform .85s ease;
}
.sa-tile:hover::after { transform: translateX(120%); }

.sa-panel { transition: box-shadow .28s, transform .28s; }
.sa-panel:hover { box-shadow: 0 14px 34px -22px rgba(23,18,43,.30); }

.sa-list li { transition: background .18s, padding-left .18s; border-radius: 10px; }
.sa-list li:hover { background: #faf8ff; padding-left: 12px; }

.sa-meter span { transition: width 1.1s cubic-bezier(.22,.9,.3,1); }

/* ---------- counting numbers ---------- */
.sa-tile-value [data-count] { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .sa-hero::before, .sa-hero::after,
  .sa-hero-figure, .sa-hero-figure::before { animation: none; }
  .sa-hero, .sa-nav, .sa-tile, .sa-panel, .sa-actions { animation: none; opacity: 1; transform: none; }
  .sa-tile:hover, .sa-panel:hover { transform: none; }
  .sa-tile::after { display: none; }
  .sa-list li:hover { padding-left: 4px; }
  .sa-meter span, .sa-hero-figure .sa-hero-avatar { transition: none; }
}

/* ============ study streak + calendar ============ */
.sa-streaks {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 26px;
}
.sa-streak {
  border-radius: 18px; padding: 22px 24px; text-align: center;
  background: linear-gradient(160deg, #f3edff, #fbf7ff); border: 1px solid #e9e0fb;
}
.sa-streak--best { background: linear-gradient(160deg, #fff4e6, #fffaf3); border-color: #fbe2c0; }
.sa-streak-num {
  font-size: clamp(2.3rem, 7vw, 3.1rem); font-weight: 700;
  letter-spacing: -.04em; line-height: 1; color: #17122b;
  font-variant-numeric: tabular-nums;
}
.sa-streak-lbl { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: #6b6580; margin-top: 9px; }
.sa-streak-sub { font-size: .84rem; color: #918ba6; margin-top: 3px; }

/* The grid scrolls inside its own box; the page never scrolls sideways. */
.sa-cal-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.sa-cal { min-width: 560px; }

.sa-cal-months {
  display: grid; grid-template-columns: repeat(13, 1fr);
  gap: 4px; margin: 0 0 6px 34px;
  font-size: .72rem; color: #918ba6; font-weight: 600;
}
.sa-cal-month { white-space: nowrap; }

.sa-cal-body { display: flex; gap: 8px; }
.sa-cal-days {
  display: grid; grid-template-rows: repeat(7, 1fr); gap: 4px;
  width: 26px; font-size: .66rem; color: #918ba6; text-align: right;
}
.sa-cal-days span { line-height: 1; display: flex; align-items: center; justify-content: flex-end; }

.sa-cal-grid { display: grid; grid-template-columns: repeat(13, 1fr); gap: 4px; flex: 1; }
.sa-cal-week { display: grid; grid-template-rows: repeat(7, 1fr); gap: 4px; }

.sa-cal-cell {
  aspect-ratio: 1 / 1; border-radius: 4px; display: block;
  background: #eceaf4; transition: transform .14s ease;
}
.sa-cal-cell:hover { transform: scale(1.32); }
.sa-cal-cell.is-download { background: #22c55e; }
.sa-cal-cell.is-login    { background: #f5b301; }
.sa-cal-cell.is-miss     { background: #f3b0b0; }
.sa-cal-cell.is-none     { background: #f4f2fa; }

.sa-cal-legend {
  display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px;
  font-size: .8rem; color: #6b6580;
}
.sa-cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sa-cal-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.sa-cal-legend i.is-download { background: #22c55e; }
.sa-cal-legend i.is-login    { background: #f5b301; }
.sa-cal-legend i.is-miss     { background: #f3b0b0; }

@media (prefers-reduced-motion: reduce) { .sa-cal-cell:hover { transform: none; } }

/* ============ password reveal + stacked options row ============ */

/* Wrapper is added by JS around each password input. */
.sa-pw { position: relative; display: block; }
.sa-pw .sa-input { padding-right: 46px; }

.sa-pw-btn {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 34px; height: 34px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; border-radius: 8px; cursor: pointer;
  color: #8b8699; line-height: 0;
  transition: color .15s, background .15s;
}
.sa-pw-btn:hover { color: var(--sa-brand-2); background: #f4f1fc; }
.sa-pw-btn:focus-visible { outline: 2px solid var(--sa-brand-2); outline-offset: 2px; }
.sa-pw-btn svg { pointer-events: none; }
.sa-pw-btn .sa-pw-off { display: none; }
.sa-pw-btn[aria-pressed="true"] .sa-pw-off { display: block; }
.sa-pw-btn[aria-pressed="true"] .sa-pw-on  { display: none; }

/* The "keep me signed in" / "forgot password" row.
   On phones these two sit on their own lines rather than being squeezed
   onto one, where the link ends up cramped against the checkbox label. */
@media (max-width: 480px) {
  .sa-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin: 8px 0 20px;
  }
  .sa-row .sa-check { width: 100%; }
  .sa-row .sa-link  { padding: 2px 0; }
}

/* Verified tick, sitting inline with the email address. */
.sa-hero-mail { display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: center; }
.sa-verified { flex: 0 0 auto; display: block; }

/* ============ danger zone ============ */
.sa-danger { border-color: #f7d4d4; background: linear-gradient(180deg,#fffbfb,#fff); }
.sa-danger h2 { color: #9f1239; }
.sa-danger-list { margin: 0 0 16px; padding-left: 20px; color: #6b6580; font-size: .93rem; line-height: 1.85; }
.sa-danger-list strong { color: #17122b; }
.sa-danger-note {
  background: #fff5f5; border: 1px solid #fadada; border-radius: 12px;
  padding: 14px 16px; font-size: .88rem; color: #7f1d1d; margin-bottom: 20px;
}
.sa-btn--destructive { background: #dc2626; color: #fff; border-color: #dc2626; }
.sa-btn--destructive:hover { background: #b91c1c; }
.sa-btn--destructive[disabled] { background: #e5a1a1; border-color: #e5a1a1; cursor: not-allowed; }

/* ============ reveal panel (social-first sign-in) ============
   A <details> whose <summary> is styled as an ordinary .sa-btn, so the
   "Sign in with email" control is visually a sibling of the provider
   buttons above it. Deliberately not a JS toggle — with scripting off the
   panel still opens and the form still submits. */

.sa-reveal { margin: 0; }

.sa-reveal > summary {
  position: relative;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  list-style: none;                 /* Firefox: drop the disclosure triangle */
}
.sa-reveal > summary::-webkit-details-marker { display: none; }   /* Safari */
.sa-reveal > summary::marker { content: ""; }

/* Absolutely positioned so the icon + label stay optically centred, exactly
   like the provider buttons, instead of being shoved left by the chevron. */
.sa-reveal-chev {
  position: absolute; right: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--sa-muted);
  transition: transform .2s ease;
  pointer-events: none;
}
.sa-reveal[open] .sa-reveal-chev { transform: translateY(-50%) rotate(180deg); }

.sa-reveal-body {
  padding-top: 18px;
  animation: sa-reveal-in .22s ease both;
}
@keyframes sa-reveal-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sa-reveal-body { animation: none; }
  .sa-reveal-chev { transition: none; }
}

/* ============ phones ============
   The auth card is the one screen people meet on a phone before they trust
   the site, so it gets its own pass rather than inheriting desktop metrics. */

@media (max-width: 480px) {
  /* Centre the card when it fits, but fall back to scrolling from the top
     when it does not. A plain justify-content:center clips the TOP of an
     overflowing flex child and makes it unreachable — which is exactly what
     happens once the on-screen keyboard halves the viewport. */
  .sa-wrap:not(.sa-wrap--dash) { justify-content: flex-start; padding: 20px 14px; }
  .sa-wrap:not(.sa-wrap--dash) > .sa-card { margin: auto 0; }

  .sa-card { padding: 24px 20px 22px; border-radius: 16px; }

  .sa-title    { font-size: 1.26rem; }
  .sa-subtitle { font-size: .9rem; margin-bottom: 18px; }

  /* 48px+ targets, comfortably above the 44px minimum for a thumb. */
  .sa-btn   { min-height: 50px; padding: 13px 16px; font-size: 1rem; border-radius: 11px; }
  .sa-social { gap: 10px; }
  .sa-or     { margin: 16px 0; }

  /* 16px is load-bearing: iOS Safari zooms the whole page in on focus for
     any input below it, and the user is then left panned sideways. */
  .sa-input { font-size: 16px; min-height: 50px; padding: 13px 14px; border-radius: 11px; }

  .sa-field { margin-bottom: 16px; }
  .sa-check input { width: 18px; height: 18px; }

  .sa-reveal-body { padding-top: 16px; }
  .sa-reveal-chev { right: 15px; }

  .sa-foot  { font-size: .9rem; margin-top: 18px; }
  .sa-legal { font-size: .76rem; }
}

/* ============================= admin console =============================
 * Only /account/admin.php uses these. They are in this stylesheet rather than
 * one of their own because every account page already loads it through
 * saplus_asset(), and a second file would be a second cache-busting problem
 * for one page seen by one person.
 *
 * The charts are plain flex boxes, not SVG and not a library: this site
 * removed all three of its CDNs on 2026-08-22 and is not getting one back for
 * a bar chart.
 */

.sa-adminhead {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin: 4px 0 22px;
}
.sa-adminhead h1 { margin: 0; font-size: 1.7rem; font-weight: 750; letter-spacing: -.03em; color: #17122b; }
.sa-adminhead p  { margin: 6px 0 0; color: #6b6580; font-size: .93rem; }
.sa-adminhead-now { color: #918ba6; font-size: .82rem; font-variant-numeric: tabular-nums; }

.sa-crumb { margin: 0 0 16px; font-size: .9rem; }

/* Four tiles read better than three across a wide console. */
.sa-tiles--4 { grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); }
.sa-tiles--flat { margin-bottom: 0; }
.sa-tiles--flat .sa-tile { padding: 20px 20px 18px; border-radius: 16px; background: #fbfaff; border-color: #ece7fa; }
.sa-tiles--flat .sa-tile-value { font-size: 1.9rem; }
.sa-tile--amber { background: linear-gradient(160deg,#fff5e4,#fffaf2); border-color: #f6e3c2; }
.sa-tile--pro   { background: linear-gradient(160deg,#f6ecff,#fdf5ff); border-color: #ecd7fb; }

.sa-delta { font-weight: 700; }
.sa-delta.is-up   { color: #15803d; }
.sa-delta.is-down { color: #b91c1c; }

/* ---------- segmented control (day / week / month) ---------- */
.sa-seg {
  display: inline-flex; background: #f3f0fb; border: 1px solid #e7e1f7;
  border-radius: 11px; padding: 3px; gap: 2px; flex: 0 0 auto;
}
.sa-seg a {
  padding: 7px 14px; border-radius: 8px; font-size: .84rem; font-weight: 650;
  color: #6b6580; text-decoration: none; white-space: nowrap;
}
.sa-seg a:hover { color: var(--sa-brand); }
.sa-seg a[aria-current="true"] { background: #fff; color: var(--sa-brand); box-shadow: 0 1px 3px rgba(23,18,43,.1); }

/* ---------- bar chart ---------- */
.sa-chart { margin-top: 6px; }
.sa-bars {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: flex-end; gap: 3px; height: 190px;
}
.sa-bars li {
  flex: 1 1 0; min-width: 0; height: 100%;
  display: flex; flex-direction: column; position: relative;
}
.sa-bar-slot { flex: 1 1 auto; display: flex; align-items: flex-end; min-height: 0; }
.sa-bar-slot i {
  display: block; width: 100%; border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #a78bfa, #6d28d9);
  transition: height .5s cubic-bezier(.2,.8,.25,1), filter .15s;
  min-height: 0;
}
.sa-chart--sky  .sa-bar-slot i { background: linear-gradient(180deg,#7dd3fc,#0369a1); }
.sa-chart--mint .sa-bar-slot i { background: linear-gradient(180deg,#6ee7b7,#047857); }
.sa-bars li:hover .sa-bar-slot i { filter: brightness(1.12); }

/* The value only prints inside the bar when there is room for it; on a 30-day
   chart the bars are too narrow, so the hover tip carries it instead. */
.sa-bar-val { display: none; }
.sa-bars li em {
  font-style: normal; font-size: .68rem; color: #918ba6; text-align: center;
  padding-top: 7px; white-space: nowrap; overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.sa-bars li.is-peak .sa-bar-slot i { box-shadow: 0 0 0 2px rgba(124,58,237,.22); }

.sa-bar-tip {
  position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -6px);
  background: #17122b; color: #fff; font-size: .74rem; line-height: 1.35;
  padding: 6px 9px; border-radius: 7px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .13s; z-index: 4;
}
.sa-bars li:hover .sa-bar-tip { opacity: 1; }

/* ---------- two panels side by side ---------- */
.sa-duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 20px; }
.sa-duo > .sa-panel { margin-bottom: 0; }
.sa-duo + .sa-duo, .sa-duo + .sa-panel, .sa-panel + .sa-duo { margin-top: 20px; }
.sa-duo + .sa-actions { margin-top: 24px; }

/* ---------- tables ---------- */
/* The wrapper scrolls, not the page: a wide table must never make the whole
   layout pan sideways on a phone. */
.sa-tablewrap { overflow-x: auto; margin: 0 -4px; -webkit-overflow-scrolling: touch; }
.sa-table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 640px; }
.sa-table th {
  text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: #918ba6; font-weight: 700; padding: 0 12px 10px; white-space: nowrap;
}
.sa-table td { padding: 13px 12px; border-top: 1px solid #f0edf8; vertical-align: middle; color: #3d3757; }
.sa-table tbody tr:hover { background: #fbfaff; }
.sa-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.sa-table a { color: #17122b; text-decoration: none; font-weight: 650; }
.sa-table a:hover { color: var(--sa-brand-2); }
.sa-td-sub { color: #918ba6; font-size: .78rem; margin-top: 2px; font-weight: 400; word-break: break-word; }

.sa-who { display: flex; align-items: center; gap: 11px; }
.sa-who img { border-radius: 50%; background: #f3f0fb; flex: 0 0 auto; }
.sa-who > span { display: block; min-width: 0; }
.sa-who strong { display: block; font-weight: 650; }

.sa-count {
  background: #f3f0fb; color: var(--sa-brand); font-weight: 700; font-size: .8rem;
  padding: 4px 11px; border-radius: 99px; flex: 0 0 auto;
}

/* ---------- chips and tags ---------- */
.sa-chip {
  display: inline-block; padding: 3px 9px; border-radius: 7px; font-size: .74rem;
  font-weight: 650; background: #f1eefb; color: #5b21b6; margin: 1px 3px 1px 0;
  white-space: nowrap; text-transform: lowercase;
}
.sa-chip--google   { background: #e8f0fe; color: #1a4b8c; }
.sa-chip--apple    { background: #eceff3; color: #1f2937; }
.sa-chip--facebook { background: #e7f0fd; color: #1e3a8a; }
.sa-chip--password { background: #f1f5f9; color: #475569; }
.sa-chip--none     { background: #fee2e2; color: #991b1b; }
.sa-chip--pro      { background: linear-gradient(135deg,#7c3aed,#db2777); color: #fff; }
.sa-chip--biology  { background: #dcfce7; color: #14532d; }
.sa-chip--chemistry{ background: #e0e7ff; color: #3730a3; }
.sa-chip--physics  { background: #fee2e2; color: #991b1b; }
.sa-chip--general  { background: #f1f5f9; color: #475569; }

.sa-tag {
  display: inline-block; padding: 1px 6px; border-radius: 5px; font-size: .66rem;
  font-weight: 700; background: #ede9fe; color: #5b21b6; text-transform: uppercase;
  letter-spacing: .04em; vertical-align: middle;
}
.sa-tag--warn { background: #fef3c7; color: #92400e; }

/* ---------- filter bar, pager, small controls ---------- */
.sa-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.sa-filters .sa-input { width: auto; flex: 1 1 190px; }
.sa-input--sm { padding: 9px 12px !important; font-size: .88rem !important; border-radius: 10px !important; }
.sa-btn--sm { width: auto; padding: 9px 16px; font-size: .85rem; border-radius: 10px; flex: 0 0 auto; }

.sa-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; color: #6b6580; font-size: .87rem; }
.sa-pager .sa-btn { margin: 0; }

/* ---------- ranked bars (sign-in mix) ---------- */
.sa-ranks { list-style: none; margin: 0; padding: 0; }
.sa-ranks li { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.sa-rank-label { flex: 0 0 108px; font-weight: 650; font-size: .9rem; color: #3d3757; }
.sa-rank-bar { flex: 1 1 auto; height: 10px; background: #f1eefb; border-radius: 99px; overflow: hidden; }
.sa-rank-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg,#7c3aed,#a855f7); }
.sa-rank-num { flex: 0 0 auto; font-weight: 700; font-variant-numeric: tabular-nums; color: #17122b; }

/* ---------- one member ---------- */
.sa-mhead { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; flex-wrap: wrap; }
.sa-mhead-av { border-radius: 50%; background: #f3f0fb; flex: 0 0 auto; }
.sa-mhead-txt { min-width: 0; }
.sa-mhead-txt h1 { margin: 0; font-size: 1.5rem; font-weight: 750; letter-spacing: -.025em; color: #17122b; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sa-mhead-txt p { margin: 7px 0 0; color: #6b6580; font-size: .92rem; word-break: break-word; }
.sa-mhead-meta { font-size: .84rem !important; color: #918ba6 !important; }

@media (prefers-reduced-motion: reduce) {
  .sa-bar-slot i { transition: none; }
}

@media (max-width: 640px) {
  .sa-adminhead h1 { font-size: 1.45rem; }
  .sa-bars { height: 150px; gap: 2px; }
  .sa-bars li em { font-size: .6rem; }
  .sa-seg a { padding: 7px 11px; font-size: .8rem; }
  .sa-filters .sa-input { flex: 1 1 100%; }
  /* Touch has no hover, so the tip can never be reached: the label under each
     bar and the chart's aria-label carry the reading instead. */
  .sa-bar-tip { display: none; }
}
