/* GBM VA portal — single stylesheet, light theme (SPEC v77 "Modern Forest" palette). --brand-mint* is decoration,
   hover and picked states; status colours are the --ok / --warn / --danger / --info / --neutral triples (text, tint,
   border). Every text / tint pair used below is AA: --muted 5.2:1 or better on every tint, --primary 6.5:1 on white,
   --ok 6.5:1, --warn 6.4:1, --danger 6.8:1, --info 5.5:1 and --neutral 7:1 on their own -bg tint. */
:root {
  --bg: #f6f8f6;
  --surface-subtle: #eef2ef;
  --card: #ffffff;
  --border: #e2e8e4;
  --border-strong: #c8d3cc;

  --ink: #142b1f;
  --text: #1a2e23;
  --muted: #52635a;
  --faint: #8c9b93;

  --brand-mint: #ace4a2;
  --brand-mint-soft: #e6f5e3;
  --brand-mint-line: #b9e3b0;
  --sidebar-text: #e6f2e8;
  --sidebar-muted: #9db5a6;

  --primary: #1f6b3a;
  --primary-hover: #17542d;
  --ring: #1f6b3a;

  --ok: #166534;
  --ok-bg: #dcfce7;
  --ok-border: #86efac;

  --warn: #92400e;
  --warn-bg: #fef3c7;
  --warn-border: #fcd34d;

  --danger: #991b1b;
  --danger-solid: #b91c1c;
  --danger-bg: #fee2e2;
  --danger-border: #fca5a5;

  --info: #1d4ed8;
  --info-bg: #dbeafe;
  --info-border: #93c5fd;

  --neutral: #475467;
  --neutral-bg: #f2f4f7;
  --neutral-border: #d0d5dd;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 43, 31, .05), 0 4px 12px -4px rgba(20, 43, 31, .06);
  --sidebar-w: 248px;
  --gutter: 16px;
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: var(--font-body);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  background: var(--bg);
  font: 15px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-hover); }
h1, h2 { font-family: var(--font-display); color: var(--ink); font-variant-numeric: lining-nums; }
h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 20px; }
h2 { font-size: 1.15rem; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; margin: 0 0 12px; }
h2 .muted, h1 .muted { font-weight: 500; font-size: .8em; font-family: var(--font-body); }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }
code { font: .92em ui-monospace, Menlo, Consolas, monospace; background: var(--surface-subtle); padding: 3px 7px; border-radius: 6px; word-break: break-all; color: var(--ink); }
.muted { color: var(--muted); }
.error { color: var(--danger); font-weight: 600; background: var(--danger-bg); border: 1px solid var(--danger-border); padding: 10px 12px; border-radius: var(--radius-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -48px; background: var(--card); color: var(--ink); padding: 8px 12px; border-radius: var(--radius-sm); z-index: 10; }
.skip:focus { top: 8px; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--ink); color: var(--sidebar-text);
  padding: 20px 14px 0; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh;
  overflow-y: auto; overscroll-behavior: contain; scroll-padding-bottom: 88px;   /* clears the pinned .who (see below) */
}
/* Brand lockup: the GBM mark beside "GBM" / "VA Portal" */
.brand { display: flex; align-items: center; gap: 10px; color: var(--sidebar-text); text-decoration: none; padding: 0 2px; }
.brand:hover { color: #fff; }
.brand-logo { display: block; width: 36px; height: 36px; flex-shrink: 0; }
.brand-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-title { color: #fff; font-weight: 700; font-size: 1.05rem; line-height: 1; }
.brand small { display: block; font-size: .68rem; font-weight: 600; color: var(--brand-mint); letter-spacing: .08em; text-transform: uppercase; }
/* A team's own logo can be any shape, so it sits on a white plaque above "VA Portal" */
.brand--team { flex-direction: column; align-items: stretch; gap: 8px; }
.brand--team small { padding-left: 4px; }
.brand-plaque { display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 12px; padding: 10px 14px; min-height: 60px; }
.brand-plaque .brand-logo { max-width: 100%; max-height: 44px; width: auto; height: auto; object-fit: contain; }
/* No logo (sub-admin hides GBM, no team logo): "VA Portal" becomes the wordmark under a mint rule */
.brand--text { display: block; }
.brand-word { display: block; padding: 6px 4px 4px; font-size: 1.25rem; font-weight: 700; line-height: 1.15; letter-spacing: -.01em; color: #fff; }
.brand-word::before { content: ""; display: block; width: 28px; height: 3px; margin-bottom: 10px; border-radius: 2px; background: var(--brand-mint); }
.brand--text:hover .brand-word { color: var(--brand-mint); }
.sidebar ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.sidebar li a {
  display: block; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--sidebar-text); text-decoration: none; font-weight: 600; font-size: .9rem;
}
.sidebar li a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar li a[aria-current="page"] { background: var(--brand-mint); color: var(--ink); }
/* Section headers between groups of links (not links themselves; hidden in the phone top bar). --sidebar-muted on
   --ink is 6.9:1. */
.sidebar .nav-group { padding: 12px 10px 4px; margin-top: 4px; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sidebar-muted); }
.sidebar .nav-group:first-child { padding-top: 2px; margin-top: 0; }
.sidebar .spacer { flex: 1; }
/* The sidebar scrolls when the nav is taller than the window; who / Log out stays pinned to its bottom edge. The
   block owns the sidebar's bottom padding and spans its full width, so it covers the scrollport edge to edge:
   nothing scrolls into view beneath it, and it sits in the same place pinned as at the end of the scroll. */
.who { position: sticky; bottom: 0; flex-shrink: 0; background: var(--ink); margin: 0 -14px; padding: 12px 20px 24px; border-top: 1px solid rgba(255, 255, 255, .12); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.who .name { font-weight: 600; font-size: .9rem; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .role { display: block; font-size: .75rem; color: var(--sidebar-muted); font-weight: 500; }
.sidebar button.link { color: var(--sidebar-text); }
.sidebar button.link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar a:focus-visible, .sidebar button:focus-visible { outline-color: var(--brand-mint); }   /* 10.3:1 on --ink */
.content { flex: 1; min-width: 0; padding: 32px; max-width: 1120px; width: 100%; }
.content.center { display: grid; place-items: center; max-width: none; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.narrow { width: 100%; max-width: 420px; margin: 24px auto; padding: 28px; }
.card h2:first-child { margin-top: -2px; }
.card-head { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.grid .card { margin-bottom: 0; }
.grid + .card { margin-top: 16px; }

/* Stats */
.stat .label { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 6px; }
.big { font-size: 2.5rem; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; margin: 0 0 6px; font-variant-numeric: tabular-nums; color: var(--ink); }
.earnings { color: var(--primary); font-weight: 700; }
.sub { color: var(--muted); font-size: .9rem; margin: 0; }

/* Messages */
.flash { background: var(--ok-bg); border: 1px solid var(--ok-border); color: var(--ink); padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 500; }
.flash:focus { outline: none; }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }
.empty .icon { width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 50%; background: var(--brand-mint-soft); display: grid; place-items: center; color: var(--primary); }
td.empty, li.empty { text-align: center; padding: 8px 0; }
td.empty .empty, li.empty .empty { padding: 20px 12px; }
/* An empty row spans every column, so in a table wider than the screen (phones) its centred message would sit off
   screen; sticky to both edges keeps it inside the visible part of the scroll. */
td.empty .empty { position: sticky; left: 0; right: 0; width: fit-content; max-width: calc(100vw - 80px); margin: 0 auto; }
.note { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-subtle); border-radius: var(--radius-sm); padding: 12px 14px; color: var(--muted); }
.note.pending { background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--ink); }

/* Forms */
label { display: block; font-weight: 600; font-size: .88rem; margin: 12px 0 5px; color: var(--ink); }
label:first-child { margin-top: 0; }
label.check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.hint { font-size: .82rem; color: var(--muted); margin: 4px 0 0; }
input, select, textarea {
  width: 100%; max-width: 100%; font: inherit; color: var(--text); background: #fff; min-height: 42px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 9px 12px;
}
input::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--primary); margin: 0; }
input[type=file] { padding: 7px 10px; }
select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2352635a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
textarea { font: .86rem/1.5 ui-monospace, Menlo, Consolas, monospace; min-height: 120px; resize: vertical; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  background: var(--primary); color: #fff; border: 1px solid var(--primary); border-radius: var(--radius-sm); padding: 9px 16px; min-height: 42px; margin: 0;
  transition: background-color .12s, border-color .12s, color .12s;
}
button:hover, .button:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
form > button:last-child, form > .button:last-child { margin-top: 16px; }
button.secondary, .button.secondary { background: #fff; color: var(--ink); border-color: var(--border-strong); }
button.secondary:hover, .button.secondary:hover { background: var(--brand-mint-soft); border-color: var(--brand-mint-line); color: var(--ink); }
button.danger, .button.danger { background: #fff; color: var(--danger); border-color: var(--border-strong); }
button.danger:hover, .button.danger:hover { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
button.small, .button.small { padding: 5px 10px; min-height: 32px; font-size: .82rem; }
button.link { background: none; border: none; color: var(--muted); padding: 6px 8px; min-height: 0; }
button.link:hover { background: var(--surface-subtle); color: var(--ink); }
button.copy { background: #fff; color: var(--ink); border-color: var(--border-strong); white-space: nowrap; }
button.copy:hover { background: var(--brand-mint-soft); border-color: var(--brand-mint-line); color: var(--ink); }
button.copy.done { background: var(--brand-mint); color: var(--ink); border-color: var(--brand-mint); }
button.copy svg { width: 15px; height: 15px; flex-shrink: 0; }
a:focus-visible, button:focus-visible, .button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--ring); outline-offset: 2px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--primary); outline-offset: 0; }

.inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.inline-form > div { flex: 1 1 180px; min-width: 0; }
.inline-form label { margin-top: 0; }
.inline-form > button, .inline-form > .button { margin-top: 0; flex: 0 0 auto; }
td .inline-form.compact { flex-wrap: nowrap; gap: 8px; }
td .inline-form.compact select, td .inline-form.compact input { min-width: 150px; }
.inline-form.compact > div, .inline-form.compact select, .inline-form.compact input { flex: 1 1 140px; min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
.inline-form.compact { gap: 8px; }
.inline-form.compact button { min-height: 36px; padding: 6px 12px; font-size: .88rem; }
td .inline-form.compact > button:last-child { margin-top: 0; }   /* beats the global form > button:last-child top margin: Assign/Transfer sits level with its select */
form.inline { display: inline; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions form { margin: 0; }
.actions .muted { font-size: .9rem; }
td .actions { flex-wrap: nowrap; }
td .actions button, td .actions .button { min-height: 34px; padding: 5px 12px; font-size: .85rem; white-space: nowrap; }

/* Link rows (chat link / invite) */
.linkrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0; }
.linkrow code { flex: 1 1 240px; display: block; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-subtle); line-height: 1.4; }
.linkrow button { margin: 0; flex: 0 0 auto; }

/* Tables */
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -22px; padding: 0 22px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
th { color: var(--muted); font-weight: 700; font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-subtle); }
tfoot th, tfoot td { border-top: 2px solid var(--border-strong); border-bottom: none; font-weight: 700; text-transform: none; letter-spacing: 0; font-size: .95rem; color: var(--ink); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
th.group { text-align: center; padding-bottom: 4px; }
th.context, td.context { color: var(--muted); }
td.wrap { word-break: break-all; max-width: 320px; }
td.date { white-space: nowrap; font-variant-numeric: tabular-nums; }
td.low { color: var(--danger); font-weight: 700; }
td .muted { font-size: .85rem; }
.handle { font-weight: 600; white-space: nowrap; }
.yes { color: var(--ok); font-weight: 600; }
.no { color: var(--muted); }

/* Badges: status text on its own tint (AA, see :root); --ink on --brand-mint is 10.3:1 */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; background: var(--neutral-bg); color: var(--neutral); white-space: nowrap; text-transform: capitalize; }
.badge.active, .badge.free, .badge.paid, .badge.done { background: var(--ok-bg); color: var(--ok); }
.badge.pending, .badge.assigned, .badge.open, .badge.progress { background: var(--info-bg); color: var(--info); }
.badge.removed, .badge.retired, .badge.unpaid { background: var(--neutral-bg); color: var(--neutral); }
.badge.accent { background: var(--brand-mint); color: var(--ink); }

/* Lists */
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 12px 0; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
ul.plain li:last-child { border-bottom: none; }
ul.plain li a { font-weight: 600; word-break: break-word; }
ul.links { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
ul.links a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); text-decoration: none; font-weight: 600; background: #fff; color: var(--ink); }
ul.links a:hover { border-color: var(--brand-mint-line); background: var(--brand-mint-soft); }
ul.links a svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--muted); margin-left: auto; }

/* Media */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.media-grid figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.media-grid img, .media-grid video { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-subtle); display: block; border: 1px solid var(--border); }
.media-grid a { display: block; border-radius: var(--radius-sm); }
.media-grid form { margin: 0; }
.media-grid form button { width: 100%; }
.team-logo { display: block; max-height: 56px; max-width: 220px; width: auto; height: auto; object-fit: contain; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px; }

/* Page header: title + optional hierarchy strip side by side */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 20px; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head .sub { margin-top: 6px; }
.page-head > .hier { margin: 6px 0 0; }
.team-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-width: 0; }
h1 .badge { font-family: var(--font-body); vertical-align: middle; position: relative; top: -3px; }
h3 { font-family: var(--font-body); font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin: 20px 0 8px; }
h3:first-of-type { margin-top: 14px; }

/* Breadcrumbs */
.crumbs { margin: 0 0 10px; font-size: .88rem; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.crumbs li { display: flex; align-items: center; gap: 8px; color: var(--muted); min-width: 0; }
.crumbs li + li::before { content: "\203A"; color: var(--faint); font-size: 1.1em; line-height: 1; }
.crumbs a { color: var(--primary); font-weight: 600; text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs [aria-current="page"] { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }

/* Hierarchy strip: Teams -> Lead Manager -> Managers -> VAs */
.hier { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hier li { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 600; color: var(--muted); }
.hier li span { padding: 4px 11px; border-radius: 999px; background: #fff; border: 1px solid var(--border-strong); white-space: nowrap; }
.hier li.done span { background: var(--brand-mint-soft); border-color: var(--brand-mint-line); color: var(--ink); }
.hier li.on span { background: var(--brand-mint); border-color: var(--brand-mint); color: var(--ink); }
.hier li + li::before { content: "\2192"; color: var(--faint); }

/* One-time password reveal */
.reveal { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; background: var(--ok-bg); border: 1px solid var(--ok-border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; color: var(--ink); }
.reveal:focus { outline: none; }
.reveal-text { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.reveal-added { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ok); margin-bottom: 2px; }
.reveal-text .handle { white-space: normal; overflow-wrap: anywhere; }
.reveal-text .hint { margin: 0; }
.reveal .linkrow { flex: 1 1 300px; }
.reveal .linkrow code { background: #fff; border-color: var(--ok-border); font-size: 1rem; letter-spacing: .02em; }

/* Stacked forms inside a card */
.inline-form + .inline-form, .hint + .inline-form, .logo-row + .inline-form, .inline-form + .note { margin-top: 14px; }
.inline-form + .hint { margin-top: 8px; }
.logo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0; }
.badge.lead { background: var(--brand-mint-soft); color: var(--ink); }
.badge.owner { text-transform: none; margin-right: 6px; }
h2.section { margin: 28px 0 12px; }

/* Week navigation */
.weeknav { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.weeknav .button { flex: 0 0 auto; }
.weeknav > div { flex: 1 1 160px; }

/* Auth: the brand stacked above the form. A team's own logo keeps its shape; the GBM mark is a 52px square with a
   "GBM" title under it. */
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 4px 0 22px; text-align: center; }
.auth-brand .brand-logo { width: auto; height: auto; max-height: 64px; max-width: 240px; object-fit: contain; }
.auth-brand:has(.auth-brand-title) .brand-logo { width: 52px; height: 52px; }
.auth-brand-title { color: var(--ink); font-weight: 700; font-size: 1.25rem; line-height: 1.1; }
.auth-brand small { display: block; font-size: .72rem; font-weight: 700; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.auth-brand-title + small { margin-top: -4px; }
.auth-brand--text { margin: 2px 0 10px; }
.auth-brand--text::before { content: ""; width: 28px; height: 3px; border-radius: 2px; background: var(--brand-mint); }
.card.narrow h1 { font-size: 1.5rem; margin-bottom: 14px; }
.card.narrow form > button { width: 100%; }
.card.narrow .muted { margin-top: 16px; font-size: .9rem; }
.error-code { font-size: .8rem; font-weight: 700; color: var(--danger); letter-spacing: .1em; text-transform: uppercase; margin: 0 0 6px; }

/* Phone: sidebar becomes a top bar */
@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: sticky; top: 0; z-index: 5;
    padding: 0 var(--gutter); display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand who" "nav nav"; gap: 0; align-items: center; overflow: hidden; scroll-padding-bottom: 0;
  }
  .brand { grid-area: brand; padding: 10px 0; min-width: 0; }
  .brand--team { flex-direction: row; align-items: center; }
  .brand small { display: none; }
  .brand-logo { width: 30px; height: 30px; }
  .brand-plaque { padding: 6px 10px; min-height: 0; max-width: 100%; }
  .brand-plaque .brand-logo { max-height: 30px; }
  .brand-word { display: flex; align-items: center; min-height: 42px; padding: 0; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand-word::before { display: none; }
  .sidebar .spacer, .sidebar .nav-group { display: none; }
  .who { grid-area: who; position: static; border-top: none; margin: 0; padding: 0; gap: 6px; }
  .who .name { display: none; }
  /* The links scroll sideways; a fade on the right edge hints at more (the end padding clears it on the last link) */
  .sidebar ul {
    grid-area: nav; min-width: 0; flex-direction: row; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 4px 28px 10px var(--gutter);
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  }
  .sidebar ul::-webkit-scrollbar { display: none; }
  .sidebar li { flex: 0 0 auto; }
  .sidebar li a { padding: 7px 12px; }
  .content { padding: 20px var(--gutter) 32px; }
  .card { padding: 18px; }
  .card.narrow { padding: 22px; }
  .table-wrap { margin: 0 -18px; padding: 0 18px; }
  .card.narrow { margin: 12px auto; }
  h1 { font-size: 1.5rem; margin-bottom: 16px; }
  h2 { font-size: 1.1rem; }
  .big { font-size: 2.2rem; }
  .inline-form > button, .inline-form > .button { flex: 1 1 100%; }
  .linkrow button { flex: 1 1 100%; }
  td .actions { flex-wrap: wrap; }
  .page-head { margin-bottom: 16px; }
  .reveal { padding: 14px; }
  .crumbs [aria-current="page"] { max-width: 70vw; }
  .hier { gap: 4px; }
  .hier li { font-size: .7rem; gap: 4px; }
  .hier li span { padding: 3px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* v10 removal: Remove buttons, confirm pages, "Show removed" toggle, removed rows */
button.danger, .button.danger { border-color: var(--danger-border); }
button.danger:hover, .button.danger:hover { border-color: var(--danger-solid); }
.actions form > button:last-child { margin-top: 0; }   /* Reset password sits level with Remove */

.toggle-link { font-size: .85rem; font-weight: 600; color: var(--primary); text-decoration-color: var(--brand-mint-line); }
.toggle-link:hover { text-decoration-color: currentColor; }
tr.removed td, tr.removed a { color: var(--muted); }
tr.removed .handle { font-weight: 500; }

.card.confirm { max-width: 640px; border-top: 3px solid var(--danger-border); }
.card.confirm > .error { margin-bottom: 16px; }
.plain-list { margin: 0; padding-left: 22px; color: var(--ink); }
.plain-list li { margin: 6px 0; padding-left: 2px; }
.plain-list li::marker { color: var(--danger-border); }
.card.confirm form { margin-top: 18px; }
.card.confirm .field { margin: 0 0 18px; max-width: 420px; }
.card.confirm .field label { margin-top: 0; }
.card.confirm .note { margin: 0 0 18px; }
.card.confirm .note svg { flex-shrink: 0; margin-top: 2px; color: var(--warn); }
.card.confirm .actions { gap: 10px; padding-top: 18px; border-top: 1px solid var(--border); }
.card.confirm .actions button.danger { background: var(--danger-solid); color: #fff; border-color: var(--danger-solid); }
.card.confirm .actions button.danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.card.confirm .actions button.danger:focus-visible { outline-color: var(--danger); }

@media (max-width: 760px) {
  .card.confirm .actions > button, .card.confirm .actions > .button { flex: 1 1 100%; }
  .card.confirm .field { max-width: none; }
}

/* v11 This week vs Last week. Two tiles side by side (they stack on phones) and a change chip.
   The arrow and sign carry the meaning; colour only helps. Chip text stays AA on its tint:
   --ok on --ok-bg 6.5:1, --danger on --danger-bg 6.8:1, --neutral on --neutral-bg 7:1. */
.grid > .compare { grid-column: 1 / -1; }
.compare-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.compare-pair > div { min-width: 0; padding: 16px 18px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff; border-left: 4px solid var(--border-strong); }
.compare-this { border-color: var(--brand-mint-line); border-left-color: var(--primary); background: linear-gradient(160deg, var(--brand-mint-soft), #fff 72%); }
.compare-pair .label { margin-bottom: 8px; }
.compare-this .label { color: var(--ink); }
.compare-pair .big { font-size: 2.75rem; margin-bottom: 4px; }
.compare-last .big { color: var(--muted); }
.compare-pair .sub { font-size: .86rem; }
.compare-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 14px 0 0; }
.compare-foot .sub { font-weight: 600; color: var(--ink); }
.compare .hint { margin-top: 10px; }

/* Change chip: ▲ +N (+P%) / ▼ −N (−P%) / — */
.delta { display: inline-flex; align-items: baseline; gap: .3em; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--neutral-border); background: var(--neutral-bg); color: var(--neutral); font-weight: 700; font-size: .82rem; line-height: 1.5; white-space: nowrap; font-variant-numeric: tabular-nums; }
.delta .pct { font-weight: 600; }
.delta .pct::before { content: "("; }
.delta .pct::after { content: ")"; }
.delta.up { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-border); }
.delta.down { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-border); }
.delta.same { min-width: 2.4em; justify-content: center; }
.compare-foot .delta { font-size: 1.05rem; padding: 6px 14px; gap: .4em; }
.compare-foot .delta.same { padding-left: 16px; padding-right: 16px; }

/* Table: this week bold, last week muted, change right-aligned (header cells wrap so the date range stays readable) */
th.wk { white-space: normal; min-width: 9.5em; }
th.wk .so-far { display: block; text-transform: none; letter-spacing: 0; font-weight: 600; }
th.chg, td.chg { text-align: right; white-space: nowrap; }
td:has(+ td + td.chg) { font-weight: 700; color: var(--ink); }
td:has(+ td.chg) { color: var(--muted); }
tfoot td:has(+ td.chg) { color: var(--ink); }

@media (max-width: 760px) {
  .compare-pair .big { font-size: 2.4rem; }
  .compare-pair > div { padding: 14px 16px 12px; }
}

/* v13 payment status. Paid/Unpaid badges carry a glyph (check / ring) plus the word, so colour is never the
   only cue. Text stays AA on its tint: --ok on --ok-bg 6.5:1, --warn on --warn-bg 6.4:1. */
.badge.paid, .badge.unpaid {
  display: inline-flex; align-items: center; gap: 5px; text-transform: none; padding: 2px 10px 2px 8px;
  border: 1px solid transparent; vertical-align: middle;
}
.badge.paid::before, .badge.unpaid::before {
  content: ""; width: 12px; height: 12px; flex-shrink: 0; background-color: currentColor;
  -webkit-mask: var(--glyph) center / contain no-repeat; mask: var(--glyph) center / contain no-repeat;
}
.badge.paid { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-border);
  --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E"); }
.badge.unpaid { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border);
  --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 8v4.5l3 2'/%3E%3C/svg%3E"); }
.badge.paid + .muted { font-size: .82rem; white-space: nowrap; }
.card-head > .badge { font-size: .8rem; }

/* "Paid X/Y": count plus a progress bar (decorative; the text carries the meaning). */
.pay-progress { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.pay-progress .bar { display: block; width: 88px; height: 8px; border-radius: 999px; background: var(--neutral-bg); border: 1px solid var(--neutral-border); overflow: hidden; }
.pay-progress .bar > span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.pay-progress .count { font-weight: 700; font-size: .9rem; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Per-row toggle and the "Mark all" trigger */
td .pay-toggle { margin: 0; }
td .pay-toggle > button:last-child { margin: 0; min-height: 34px; white-space: nowrap; }
td .pay-toggle button.undo { color: var(--muted); }
td .pay-toggle button.undo:hover { color: var(--ink); }
.pay-actions { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.pay-actions form { margin: 0; }
.pay-actions.flush { margin-top: 0; padding-top: 0; border-top: 0; }
.pay-actions .muted { font-size: .9rem; flex: 1 1 240px; }
.pay-actions .actions { margin-left: auto; }

/* Confirm step for a bulk mark: same card as the removal confirm, green instead of red because it is
   reversible (Undo per VA). The primary button is deliberately the only dark one on the page. */
.card.confirm.pay { border-top-color: var(--primary); margin-bottom: 16px; }
.card.confirm.pay:focus { outline: none; }
.card.confirm.pay h2 { margin-bottom: 4px; }
.card.confirm.pay .sub { margin-bottom: 14px; }
.card.confirm.pay .plain-list li::marker { color: var(--primary); }
.card.confirm.pay .handles { margin: 14px 0 0; font-size: .92rem; line-height: 1.7; }
.card.confirm.pay .handles .handle { white-space: normal; }
.card.confirm.pay form { margin-top: 18px; }

/* Status cells (admin report, lead / manager Payments table): badge, date and payer stay on one line */
td.pay-cell { white-space: nowrap; }

/* VA weekly history: the long header may wrap so the Payment column fits on a 375px phone */
table.history th { white-space: normal; }
table.history th:last-child { min-width: 7em; }
td.pay-cell .num { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .pay-progress .bar { width: 64px; }
  .pay-actions .actions { margin-left: 0; width: 100%; }
  .pay-actions .actions form, .pay-actions .actions > .button { flex: 1 1 100%; }
  .pay-actions .actions form button { width: 100%; }
  .card.confirm.pay .actions > button, .card.confirm.pay .actions > .button { flex: 1 1 100%; }
}

/* Sub-admin Payments, by manager: each team card lists its managers as native <details> rows (name, VA count,
   qualifying total, "Paid X/Y" and a chevron); the VAs sit inside on a green-ruled indent. The chevron is
   decorative; the summary itself is the button. */
.mgr-list { list-style: none; margin: 0; padding: 0; }
.mgr-list > li + li { border-top: 1px solid var(--border); }
.mgr-row > summary, .mgr-row.flat {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "name state chev" "meta state chev";
  gap: 2px 14px; align-items: center; padding: 13px 0; min-height: 56px;
}
.mgr-row > summary { cursor: pointer; list-style: none; border-radius: var(--radius-sm); }
.mgr-row > summary::-webkit-details-marker { display: none; }
.mgr-row > summary:hover { background: var(--surface-subtle); box-shadow: 0 0 0 8px var(--surface-subtle); }
.mgr-row > summary:focus-visible { outline: 2px solid var(--ring); outline-offset: 6px; }
.mgr-name { grid-area: name; display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 700; font-size: 1.02rem; color: var(--ink); }
.mgr-name .badge { font-size: .7rem; flex-shrink: 0; }
.mgr-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mgr-meta { grid-area: meta; font-size: .86rem; color: var(--muted); white-space: nowrap; }
.mgr-meta strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.mgr-meta .dot { color: var(--faint); }
.mgr-row > summary { grid-template-areas: "name state chev" "meta state chev" "tiers state chev"; }
.mgr-tiers { grid-area: tiers; font-size: .84rem; }
.mgr-state { grid-area: state; justify-self: end; display: inline-flex; align-items: center; }
.chev { grid-area: chev; flex-shrink: 0; width: 10px; height: 10px; margin: -4px 6px 0 0; border-right: 2px solid var(--primary); border-bottom: 2px solid var(--primary); transform: rotate(45deg); transition: transform .15s ease; }
.mgr-row[open] > summary .chev { transform: rotate(-135deg); margin: 4px 6px 0 0; }
.mgr-row.flat .mgr-name { font-weight: 600; color: var(--muted); font-size: .98rem; }
.mgr-body { margin: 2px 0 14px 5px; padding-left: 14px; border-left: 3px solid var(--brand-mint-line); }
.mgr-body .pay-actions.mgr-actions { margin-top: 10px; padding-top: 10px; }

/* VA rows inside a manager: a grid, not a table, so they can restack on phones without side-scrolling. */
.va-rows { list-style: none; margin: 0; padding: 0; font-size: .92rem; }
.va-rows > li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto auto auto; grid-template-areas: "handle tiers qual status action"; gap: 4px 14px; align-items: center; padding: 9px 0; border-top: 1px solid var(--border); }
.va-rows > li:first-child { border-top: 0; }
.va-rows > li.va-row:hover { background: var(--surface-subtle); box-shadow: 0 0 0 6px var(--surface-subtle); border-radius: 6px; }
.va-head { color: var(--muted); font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; white-space: nowrap; padding-bottom: 4px !important; }
.va-head .num, .va-qual { text-align: right; }
.va-handle { grid-area: handle; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.va-handle .muted { font-size: .85rem; }
.va-tiers { grid-area: tiers; }
.va-qual { grid-area: qual; }
.va-status { grid-area: status; }
.va-action { grid-area: action; justify-self: end; }
.tiers { display: inline-flex; flex-wrap: wrap; gap: 2px 8px; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tiers .tier abbr { text-decoration: none; cursor: help; color: var(--muted); font-size: .76rem; font-weight: 700; letter-spacing: .03em; }
.tiers .tier + .tier::before { content: "·"; color: var(--faint); margin-right: 8px; }
.va-qual strong { font-size: 1.05rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.va-action .pay-toggle { margin: 0; }
.va-action .pay-toggle > button:last-child { margin: 0; min-height: 34px; padding: 5px 12px; font-size: .85rem; white-space: nowrap; }
.va-action .pay-toggle button.undo { color: var(--muted); }
.va-action .pay-toggle button.undo:hover { color: var(--ink); }

@media (max-width: 760px) {
  .mgr-row > summary, .mgr-row.flat { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name chev" "meta state"; gap: 4px 10px; padding: 12px 0; }
  .mgr-row > summary { grid-template-areas: "name chev" "meta state" "tiers tiers"; }
  .mgr-row > summary .chev { justify-self: end; }
  .mgr-row > summary:hover { box-shadow: none; background: none; }
  .mgr-state .pay-progress { gap: 8px; }
  .mgr-state .pay-progress .bar { width: 56px; }
  .mgr-body { margin-left: 3px; padding-left: 10px; }
  .va-rows > li.va-head { display: none; }
  .va-rows > li { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "handle qual" "tiers tiers" "status action"; gap: 6px 12px; padding: 12px 0; }
  .va-rows > li.va-row:hover { box-shadow: none; background: none; }
  .va-tiers { font-size: .88rem; }
  .va-status { justify-self: start; }
  .va-action { align-self: end; }
  .va-qual .qual-word { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: nowrap; font-size: .8rem; color: var(--muted); }
}

/* v12 Rules: admin text rendered by app/rules.py. Readable line length, long URLs wrap so phones never scroll
   sideways. Bullet markers use --primary (6.5:1 on white). */
.rules { max-width: 72ch; overflow-wrap: anywhere; font-size: 1rem; line-height: 1.65; }
.rules > :first-child { margin-top: 0; }
.rules h2 { font-size: 1.3rem; margin: 26px 0 10px; }
.rules h3 { font-size: 1.08rem; font-weight: 700; color: var(--ink); text-transform: none; letter-spacing: 0; margin: 20px 0 8px; }
.rules p, .rules ul { margin: 0 0 14px; }
.rules > :last-child { margin-bottom: 0; }
.rules ul { padding-left: 22px; }
.rules li { margin: 6px 0; padding-left: 2px; }
.rules li::marker { color: var(--primary); }
.rules strong { color: var(--ink); font-weight: 700; }
.rules a { font-weight: 600; }
.rules-editor textarea { min-height: 360px; font-size: .9rem; }
.rules-actions { margin-top: 16px; }
.rules-preview.draft { border-top: 3px solid var(--warn-border); }

@media (max-width: 760px) {
  .rules h2 { font-size: 1.2rem; }
  .rules h3 { font-size: 1.02rem; }
  .rules-editor textarea { min-height: 260px; }
  .rules-actions > button { flex: 1 1 100%; }
}

/* SPEC v17 creator gallery. Stock-photo style: rounded white cards on the tinted page background, the image
   filling the card top, filename and a round download button below, and a green "New" pill over the image.
   Text on tints stays AA: --ink on --brand-mint 10.3:1, --ink on --brand-mint-soft 13:1, --danger on --danger-bg
   6.8:1, --muted on white 6.4:1. Colour never carries meaning alone (badges have words, the play glyph is a shape). */

/* Toolbar: creator picker, filter pills and the item count */
.gallery-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.gallery-bar .count { font-size: .9rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gallery-picker { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.gallery-picker > div { flex: 1 1 220px; max-width: 360px; }
.gallery-picker label { margin-top: 0; }
.gallery-picker > button { margin: 0; flex: 0 0 auto; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 15px; min-height: 36px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: #fff; color: var(--ink); font-size: .85rem; font-weight: 600;
  text-decoration: none; white-space: nowrap; transition: background-color .12s, border-color .12s;
}
.pill:hover { background: var(--brand-mint-soft); border-color: var(--brand-mint-line); color: var(--ink); }
.pill[aria-current="page"] { background: var(--brand-mint); border-color: var(--brand-mint); color: var(--ink); }
.pill .n { font-weight: 500; color: var(--muted); font-size: .78rem; }
.pill[aria-current="page"] .n { color: var(--ink); }

/* Grid: 4–5 columns on a desktop, 3 on a tablet, 2 on a phone */
.gallery-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.gallery-grid.admin { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.card .gallery-grid { margin-top: 16px; }
.gallery-grid + .pager { margin-top: 20px; }
.card:has(> .gallery-grid) + .card, .gallery-grid + .card, .pager + .card { margin-top: 16px; }
.gallery-empty { margin-top: 0; }

/* Card */
.tile {
  position: relative; display: flex; flex-direction: column; min-width: 0; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: border-color .12s, box-shadow .12s;
}
.tile:hover { border-color: var(--border-strong); box-shadow: 0 2px 4px rgba(20, 43, 31, .06), 0 12px 24px -12px rgba(20, 43, 31, .18); }
.tile:focus-within { border-color: var(--primary); }
.tile-media { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; background: var(--surface-subtle); }
.tile-link { position: absolute; inset: 0; display: block; color: inherit; outline-offset: -4px; }
.tile-link:focus-visible { outline: 2px solid var(--ring); outline-offset: -4px; border-radius: calc(var(--radius) - 2px); }
.tile-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.tile:hover .tile-media img { transform: scale(1.03); }
.tile-media.is-broken img { visibility: hidden; }
.tile-media.is-broken::after {
  content: "Preview unavailable"; position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; text-align: center;
  font-size: .8rem; font-weight: 600; color: var(--muted);
}
.tile-badges { position: absolute; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; max-width: calc(100% - 20px); }
.badge.new { background: var(--brand-mint); color: var(--ink); box-shadow: 0 1px 2px rgba(20, 43, 31, .18); }
.tile-badges .badge { box-shadow: 0 1px 2px rgba(20, 43, 31, .18); }
.badge.hidden { background: var(--neutral-bg); color: var(--neutral); }
.badge.gone { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.badge.starter { background: var(--ink); color: #fff; }
.badge.failed { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.tile-play {
  position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; display: grid; place-items: center;
  border-radius: 50%; background: rgba(20, 43, 31, .82); color: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); pointer-events: none;
}
.tile-play svg { width: 18px; height: 18px; margin-left: 2px; }
.tile-ext { position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--ink); pointer-events: none; }
.tile-ext svg { width: 13px; height: 13px; }

/* Below the image: filename, kind · size, download */
.tile-foot { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; min-width: 0; }
.tile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tile-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; font-weight: 600; color: var(--ink); }
.tile-sub { font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  flex: 0 0 auto; display: inline-grid; place-items: center; width: 38px; height: 38px; min-height: 0; padding: 0; border-radius: 50%;
  background: #fff; color: var(--ink); border: 1px solid var(--border-strong); cursor: pointer; text-decoration: none;
  transition: background-color .12s, border-color .12s, color .12s;
}
.icon-btn:hover { background: var(--brand-mint-soft); border-color: var(--brand-mint-line); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.danger { color: var(--danger); border-color: var(--danger-border); }
.icon-btn.danger:hover { background: var(--danger-bg); border-color: var(--danger-solid); color: var(--danger); }

/* Admin: actions under each card */
.tile form { margin: 0; }
.tile-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 10px 12px; }
.tile-actions form { display: contents; }
.tile-actions .hint { margin: 0; flex: 1 1 100%; font-size: .76rem; }
.tile-actions button.small { min-height: 32px; padding: 4px 10px; }
.tile-actions button.wide { flex: 1 1 100%; }           /* starter toggle on its own row; Hide + Delete below */
.tile-actions .icon-btn { width: 32px; height: 32px; margin-left: auto; }
.tile-actions .icon-btn svg { width: 16px; height: 16px; }
.gallery-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.gallery-foot .hint { margin: 0; }
.gallery-foot form { margin: 0; }
.gallery-foot form > button:last-child { margin: 0; }
.gallery-foot button svg { width: 16px; height: 16px; flex-shrink: 0; }

.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
.pager .muted { font-variant-numeric: tabular-nums; }

/* Lightbox: dark stage, white caption bar; Escape and the X close it, arrows move between items */
.lightbox { border: none; border-radius: var(--radius); padding: 0; width: min(96vw, 1200px); max-width: none; max-height: 96vh; background: #111; color: #fff; overflow: hidden; }
.lightbox::backdrop { background: rgba(14, 30, 20, .82); }
.lightbox-stage { position: relative; display: grid; place-items: center; min-height: 240px; background: #111; }
.lightbox-body { display: grid; place-items: center; width: 100%; }
.lightbox-body img, .lightbox-body video { display: block; max-width: 100%; max-height: min(78vh, 900px); margin: 0 auto; object-fit: contain; }
.lightbox-body img { min-height: 160px; }
.lightbox-close, .lightbox-nav {
  position: absolute; display: grid; place-items: center; width: 42px; height: 42px; min-height: 0; padding: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: var(--ink); border: 1px solid rgba(255, 255, 255, .5); cursor: pointer;
}
.lightbox-close:hover, .lightbox-nav:hover { background: var(--brand-mint); border-color: var(--brand-mint); color: var(--ink); }
.lightbox-close:focus-visible, .lightbox-nav:focus-visible { outline-color: var(--brand-mint); }
.lightbox-close { top: 12px; right: 12px; }
.lightbox-nav { top: 50%; margin-top: -21px; }
.lightbox-nav.prev { left: 12px; }
.lightbox-nav.next { right: 12px; }
.lightbox-nav[disabled] { opacity: .35; cursor: default; }
.lightbox-nav[disabled]:hover { background: rgba(255, 255, 255, .92); border-color: rgba(255, 255, 255, .5); }
.lightbox-close svg, .lightbox-nav svg { width: 20px; height: 20px; }
.lightbox-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #fff; color: var(--ink); }
.lightbox-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lightbox-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lightbox-count { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.lightbox-bar .button svg { width: 16px; height: 16px; }

/* Admin import panel: one block per Drive folder with a status badge, progress bar, counts and actions */
.sources { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.source { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; background: #fff; }
.source-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.source-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.source-title strong { color: var(--ink); font-size: 1rem; overflow-wrap: anywhere; }
.source-title .muted { font-size: .85rem; }
.job-progress { margin: 10px 0 0; }
.job-progress p { margin: 0; }
.job-bar { display: block; height: 8px; border-radius: 999px; background: var(--brand-mint-soft); overflow: hidden; margin: 0 0 8px; }
.job-bar > span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--primary); transition: width .4s ease; }
.job-bar.indeterminate > span { width: 40%; background: linear-gradient(90deg, var(--brand-mint-soft), var(--primary), var(--brand-mint-soft)); animation: job-scan 1.4s linear infinite; }
.job-bar.failed { background: var(--danger-bg); }
.job-bar.failed > span { background: var(--danger-solid); }
@keyframes job-scan { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.job-text { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .9rem; }
.job-text .muted { font-size: .85rem; }
.job-errors { font-size: .85rem; margin: 6px 0 0; padding-left: 18px; }
.source details { margin-top: 8px; }
.source summary { cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--primary); }
.source-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.source-actions form { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.source-actions form > button:last-child { margin: 0; }
.source-actions label.check { font-size: .88rem; }

/* Admin upload form: files on their own row, then URL + kind, then starter + Add */
.upload-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px 14px; align-items: end; }
.upload-form .files { grid-column: 1 / -1; }
.upload-form label { margin-top: 0; }
.upload-form .check { grid-column: 1 / -1; }
.upload-form > button { grid-column: 1 / -1; justify-self: start; margin: 0; }
.upload-form + .hint { margin-top: 10px; }
.card-head .filters { flex: 1 1 100%; }
.card-head .head-links { display: flex; align-items: center; gap: 12px; }

@media (max-width: 1100px) {
  .gallery-grid, .gallery-grid.admin { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}
@media (max-width: 760px) {
  .gallery-grid, .gallery-grid.admin { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { border-radius: 14px; }
  .tile-foot { padding: 8px 8px 8px 10px; gap: 6px; }
  .tile-name { font-size: .8rem; }
  .icon-btn { width: 34px; height: 34px; }
  .icon-btn svg { width: 16px; height: 16px; }
  .tile-badges { top: 8px; left: 8px; }
  .tile-badges .badge { font-size: .7rem; padding: 2px 8px; }
  .tile-play { width: 38px; height: 38px; margin: -19px 0 0 -19px; }
  .tile-actions { padding: 0 8px 10px; }
  .tile-actions button.small { font-size: .76rem; padding: 4px 8px; }
  .gallery-picker > button { flex: 1 1 100%; }
  .gallery-picker > div { max-width: none; }
  .pill { padding: 6px 12px; min-height: 34px; font-size: .82rem; }
  .lightbox { width: 100vw; max-height: 100vh; border-radius: 0; }
  .lightbox-nav { width: 38px; height: 38px; margin-top: -19px; }
  .lightbox-bar { padding: 10px 12px; }
  .upload-form { grid-template-columns: minmax(0, 1fr); }
  .upload-form > button { justify-self: stretch; }
  .source-actions form { flex: 1 1 100%; }
  .source-actions form > button { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .tile:hover .tile-media img { transform: none; }
  .job-bar.indeterminate > span { animation: none; width: 100%; opacity: .6; }
}

/* SPEC v18 country tiers */
.compare .tier-rules, .compare .tier-week { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--border); font-size: .88rem; }
.compare .tier-rules .label, .compare .tier-week .label { margin-bottom: 4px; }
.tier-rules ul.plain li { padding: 9px 0; }
.tier-rules .tier-name { font-weight: 600; color: var(--ink); }
.eq { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.eq-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--surface-subtle); color: var(--ink); font-weight: 600; white-space: nowrap; }
.eq-pill.lead { background: var(--brand-mint-soft); }
.eq-pill.none { background: var(--neutral-bg); color: var(--neutral); }
.eq-sign { font-weight: 700; color: var(--ink); }
.eq .muted { font-size: .8rem; }
.tier-rules .hint { margin-top: 8px; }
.tier-counts { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.tier-total { margin: 6px 0 0; font-size: 1.05rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
th.tier abbr { text-decoration: none; cursor: help; }
.tier-lists { margin: 12px 0 0; }
.tier-lists dt { font-weight: 700; margin-top: 10px; }
.tier-lists dd { margin: 2px 0 0; }

/* SPEC v20 multi-creator. Creator names are neutral chips (--ink on --surface-subtle 13:1); "none" states are an amber
   badge with a warning glyph (--warn on --warn-bg 6.4:1) so colour never carries the meaning alone. Grant checklists
   are tiles that tint green when ticked; the tick itself still shows. */

/* Creator names: chips; the warning badge when a level has none */
.chips { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; vertical-align: middle; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--surface-subtle); border: 1px solid var(--border); color: var(--ink); font-size: .8rem; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.chip.accent { background: var(--brand-mint); border-color: var(--brand-mint); }
.chip.off { background: var(--neutral-bg); border-color: var(--neutral-border); color: var(--neutral); text-decoration: line-through; }
.badge.warn {
  display: inline-flex; align-items: center; gap: 6px; text-transform: none; white-space: normal; text-align: left; line-height: 1.35;
  padding: 3px 10px 3px 8px; background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-border); vertical-align: middle;
}
.badge.warn::before {
  content: ""; flex-shrink: 0; width: 13px; height: 13px; background-color: currentColor;
  -webkit-mask: var(--glyph) center / contain no-repeat; mask: var(--glyph) center / contain no-repeat;
  --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E");
}
td .chips, td .badge.warn { font-size: .78rem; }
td .chips { flex-wrap: nowrap; }                 /* the table scrolls sideways; names stay on one line */
td .badge.warn { white-space: nowrap; }
td .chips + a, td .badge.warn + a { font-size: .85rem; font-weight: 600; white-space: nowrap; margin-left: 4px; }

/* "Can use: …" summary line above a grant form */
.creator-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 14px; color: var(--muted); font-size: .92rem; }
.creator-summary > span:first-child { font-weight: 600; color: var(--ink); }
.page-head .creator-summary, .sub .creator-summary { display: inline-flex; margin: 0; font-size: inherit; }
.sub .chips { vertical-align: middle; }

/* Grant checklist: a tile per creator; ticked tiles go green */
.creator-form { margin: 0; }
fieldset.checks { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
fieldset.checks + fieldset.checks { margin-top: 18px; }
fieldset.checks legend { grid-column: 1 / -1; float: left; width: 100%; padding: 0; margin: 0 0 8px; font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
fieldset.checks legend .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
fieldset.checks label.check {
  margin: 0; min-width: 0; padding: 10px 12px; min-height: 44px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff;
  font-size: .92rem; cursor: pointer; transition: background-color .12s, border-color .12s;
}
fieldset.checks label.check:hover { border-color: var(--faint); background: var(--surface-subtle); }
fieldset.checks label.check:has(input:checked) { background: var(--brand-mint-soft); border-color: var(--primary); }
fieldset.checks label.check:has(input:focus-visible) { outline: 2px solid var(--ring); outline-offset: 2px; }
fieldset.checks label.check input { flex-shrink: 0; }
fieldset.checks label.check .muted { font-size: .8rem; }
fieldset.checks > .muted { grid-column: 1 / -1; padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); font-size: .9rem; }
.creator-form > button { margin: 0; }
.creator-form + .hint { margin-top: 10px; max-width: 72ch; }
.card.access .note { margin-top: 2px; }

/* "All creators" filter: label, select and button on one line; a Clear link when a creator is picked */
.creator-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.creator-filter > div { display: flex; align-items: center; gap: 8px; flex: 0 1 auto; min-width: 0; }
.creator-filter label { margin: 0; font-size: .85rem; color: var(--muted); white-space: nowrap; }
.creator-filter select { width: auto; min-width: 180px; max-width: 280px; min-height: 38px; padding-top: 6px; padding-bottom: 6px; font-size: .92rem; }
.creator-filter > button { margin: 0; min-height: 38px; padding: 6px 14px; font-size: .88rem; }
.creator-filter > button:last-child { margin: 0; }   /* no Clear link yet: beats the global form > button:last-child top margin */
.creator-filter .toggle-link { margin-left: 2px; }
.creator-filter.is-on select, .creator-filter select.is-on { border-color: var(--primary); background-color: var(--brand-mint-soft); }
.page-head > .creator-filter { margin-top: 4px; }
.content > .creator-filter { margin-bottom: 16px; }
.page-tools > .creator-filter { justify-content: flex-end; }
.card.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 14px 22px; }
.card.filter-bar .hint { margin: 0; flex: 1 1 260px; }

/* By creator: this week vs last week per creator */
.card.split td:first-child { font-weight: 600; color: var(--ink); }
.card.split .empty { padding: 20px 12px; }

/* Change creator: from → to strip, pick step and confirm step */
.move-path { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; font-size: .92rem; color: var(--muted); }
.move-path .arrow { color: var(--faint); font-size: 1.1em; }
.move-path .chip { font-size: .88rem; padding: 5px 13px; }
.card.confirm.move { border-top-color: var(--primary); }
.card.confirm.move .plain-list li::marker { color: var(--primary); }
.card.confirm.move .note.pending { margin: 18px 0 0; }
.card.confirm.move .note.pending label.check { margin: 0; font-weight: 600; }
.card.confirm.move .actions { margin-top: 18px; }
.card.pick .inline-form { margin-top: 4px; }
.card.pick .inline-form > div { flex: 1 1 220px; max-width: 360px; }
.card.pick .empty { padding-bottom: 8px; }
.card.pick .empty .button { margin-top: 14px; }

/* Error flash (change refused): --danger on --danger-bg, AA; distinct from the green status flash */
.flash.error { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
.flash.error:focus { outline: none; }

/* Notice: unmatched sheet tabs on the Links page, tab names as code chips */
.flash.notice { display: flex; gap: 12px; align-items: flex-start; background: var(--warn-bg); border-color: var(--warn-border); color: var(--ink); line-height: 1.55; }
.flash.notice > svg { flex-shrink: 0; width: 20px; height: 20px; margin-top: 2px; color: var(--warn); }
.flash.notice p { margin: 0; }
.flash.notice code { background: #fff; border: 1px solid var(--warn-border); color: var(--warn); font-weight: 600; margin: 1px 0; display: inline-block; word-break: break-word; }
.flash.notice .muted { display: block; font-size: .85rem; font-weight: 500; margin-top: 4px; }

/* Add VA when the manager has no creators */
.note.pending svg { flex-shrink: 0; margin-top: 2px; color: var(--warn); }

@media (max-width: 760px) {
  fieldset.checks { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .creator-filter { width: 100%; }
  .creator-filter > div { flex: 1 1 100%; }
  .creator-filter select { flex: 1; width: 100%; max-width: none; min-width: 0; }
  .creator-filter > button { flex: 1 1 auto; }
  .page-head > .creator-filter { margin-top: 0; }
  .card.filter-bar { padding: 14px 18px; }
  .card.pick .inline-form > div { max-width: none; }
  .card.confirm.move .actions > button, .card.confirm.move .actions > .button { flex: 1 1 100%; }
  .move-path .chip { font-size: .82rem; }
  td .chips + a, td .badge.warn + a { display: block; margin: 4px 0 0; }
}

/* v22 Clicks and subs (information only). A compact pair of tiles under the qualifying-leads tiles: this week
   big, last week beside it, the same change chip. — is "no data", never 0. Text stays AA: --ink on #fff 15:1,
   --muted on #fff 6.4:1, --danger on #fff 8.3:1, #fff on --ink 15:1. */
.clicks-pair { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.clicks-sum .clicks-pair { margin-top: 0; padding-top: 0; border-top: 0; }
.cp-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 10px; }
.cp-head .label { margin: 0; color: var(--ink); }
.cp-head .clicks-fresh { margin-left: auto; }
.clicks-sum .cp-head .label { font-size: 1.15rem; font-weight: 700; text-transform: none; letter-spacing: -.01em; }
.clicks-fresh { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.clicks-fresh.failed { color: var(--danger); font-weight: 600; }
.clicks-fresh svg { width: 15px; height: 15px; flex-shrink: 0; }
/* Tiles: 5 across (3 without revenue) on wide screens; 1200px and under, 3 across with the two money tiles sharing a
   full second row, so "Rev / sub" never sits alone; phones go 2 across (last odd tile full width). Each tile is an
   inline-size container so the big number scales with the tile (clamped) instead of spilling out of narrow ones. */
.cp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); gap: 10px; margin: 0; }
.cp-tile { min-width: 0; container-type: inline-size; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 14px; border: 1px solid var(--border); border-left: 4px solid var(--brand-mint); border-radius: var(--radius-sm); background: #fff; }
.cp-tile.money { border-left-color: var(--primary); }
.cp-tile dt { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink); }
.cp-tile dd { margin: 0; }
.cp-chg { margin-top: auto; max-width: 100%; }
.cp-chg .delta { max-width: 100%; white-space: normal; flex-wrap: wrap; gap: 0 .3em; }   /* wraps "(+310%)" in the narrowest tiles */
.cp-val { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.cp-now { font-size: 1.75rem; font-size: clamp(1.25rem, 18cqi, 1.75rem); line-height: 1.15; font-weight: 700; letter-spacing: -.01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.cp-last { font-size: .84rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cp-now .muted, .cp-last .muted { font-size: inherit; }
.cp-empty { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); color: var(--muted); font-size: .9rem; }
.cp-empty strong { color: var(--ink); }
.cp-empty svg { flex-shrink: 0; margin-top: 1px; color: var(--primary); }
.clicks-pair .hint { margin-top: 8px; }

@media (max-width: 1200px) {
  .cp-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .cp-tile { grid-column: span 2; }
  .cp-tile.money { grid-column: span 3; }
}

/* SPEC v69 Raw conversations (admin dashboard): two tiles capped so they don't stretch across the card; neutral left
   border distinguishes pre-filter counts from green pay metrics. */
.raw-pair .cp-tiles { grid-template-columns: repeat(2, minmax(0, 280px)); }
.raw-pair .cp-tile { border-left-color: var(--faint); }
.raw-pair .cp-head .toggle-link { margin-left: auto; }
@media (max-width: 1200px) {
  .raw-pair .cp-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .raw-pair .cp-tile { grid-column: auto; }
}

/* "Estimated" marker: the word plus ≈ (never colour alone); its explanation is in the DOM for screen readers and
   shows as a tooltip on hover, tap or keyboard focus. It opens upward so it stays inside scrolling tables. */
.est { position: relative; display: inline-flex; vertical-align: middle; margin-left: 6px; border-radius: 999px; cursor: help; text-transform: none; letter-spacing: 0; }
.est-badge { background: var(--info-bg); color: var(--info); text-transform: none; font-size: .72rem; padding: 2px 8px; }
.est-badge::before { content: "≈ "; font-weight: 700; }
.est:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.est-tip { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.est:hover .est-tip, .est:focus .est-tip {
  left: 0; bottom: calc(100% + 8px); z-index: 20; width: max-content; max-width: min(280px, 70vw); height: auto; margin: 0; padding: 8px 10px;
  overflow: visible; clip: auto; white-space: normal; background: var(--ink); color: #fff; border-radius: 8px; box-shadow: var(--shadow);
  font-size: .78rem; font-weight: 500; line-height: 1.4; text-align: left; text-transform: none; letter-spacing: 0;
}

/* SPEC v68 freshness. Header: each part is a .fseg, so the line breaks only at the "·" separators; lnk2go's time is
   the one number that matters, so it is bold --ink while the rest stays muted; the "N links behind · oldest …" part is
   amber (--warn: 7.1:1 on white) with the "!" glyph. The glyph is a small amber disc (CSS content, so
   it is never colour alone and never read twice): on aggregate rows and the footer inside an .est, so its "N of M
   links last updated …" text is read in place and shows as a tooltip; in the detail tables' Updated cell next to the
   amber time. --warn on --warn-bg is 6.4:1. */
.clicks-fresh > span { min-width: 0; line-height: 1.45; }
.clicks-fresh .fseg { white-space: nowrap; }
.clicks-fresh strong { color: var(--ink); font-weight: 700; }
.clicks-fresh .fseg.behind { color: var(--warn); font-weight: 600; }
.stale-badge {
  display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; vertical-align: -3px;
  background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-border); font-size: .7rem; font-weight: 800; line-height: 1;
}
.stale-badge::before { content: "!"; }
.fseg .stale-badge, td.updated .stale-badge { margin-right: 5px; }
.est.stale { margin-left: 4px; }
.est.stale .stale-badge { vertical-align: 0; }
.clicks-table td.updated { white-space: nowrap; font-variant-numeric: tabular-nums; }
.clicks-table td.updated.stale { color: var(--warn); font-weight: 600; }

/* Per-VA / per-page tables (clicks, v37 SMS usage): the name column stays put while the numbers scroll sideways
   inside the card. Chromium clips a collapsed-border cell's box-shadow to the cell, so the card gutter to the left of
   the column is covered by a pseudo-element (oversized; the scroller clips it), never by a shadow. */
.clicks-table .name, .sms-table .name { position: sticky; left: 0; z-index: 1; background: var(--card); box-shadow: 8px 0 8px -8px rgba(20, 43, 31, .18); }
.clicks-table .name::before, .sms-table .name::before { content: ""; position: absolute; top: 0; bottom: -1px; right: calc(100% - 1px); width: 48px; background: var(--card); }
.clicks-table thead .name, .sms-table thead .name { z-index: 2; }
tbody tr:hover td.name { background: var(--surface-subtle); }
.clicks-table td.name, .sms-table td.name { min-width: 8.5em; max-width: 14em; }
.clicks-table td.name .handle, .sms-table td.name .handle { white-space: normal; overflow-wrap: anywhere; }
.clicks-table td.name .est { margin: 2px 0 0 6px; }
.clicks-table .cell-sub, .sms-table .cell-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clicks-table th.wk { min-width: 5.5em; }
.clicks-table .cell-sub, .sms-table .cell-sub { display: block; font-size: .82rem; }
.clicks-table td.name code { font-size: .85rem; }
.clicks-table tfoot th, .sms-table tfoot th { text-align: left; }
.clicks-table tr.grp th { padding: 9px 0 7px; background: var(--surface-subtle); color: var(--ink); text-transform: none; letter-spacing: 0; font-size: .88rem; box-shadow: -22px 0 0 var(--surface-subtle), 22px 0 0 var(--surface-subtle); }
.clicks-table tr.grp .grp-name { position: sticky; left: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.clicks-table tbody + tbody tr.grp th { border-top: 2px solid var(--border-strong); }

@media (max-width: 760px) {
  .clicks-table tr.grp th { box-shadow: -18px 0 0 var(--surface-subtle), 18px 0 0 var(--surface-subtle); }
  .cp-now { font-size: 1.6rem; font-size: clamp(1.25rem, 18cqi, 1.6rem); }
  .cp-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cp-tile, .cp-tile.money { grid-column: auto; }
  .cp-tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .clicks-table td.name, .sms-table td.name { min-width: 7.5em; max-width: 9.5em; }
  .clicks-table td.name .est { margin-left: 0; }
  .cp-head .clicks-fresh { margin-left: 0; flex-basis: 100%; }
}

/* v37 SMS usage tables. Header summary: two groups that wrap as units. Zeros are muted (still AA: --muted on white
   6.4:1) so the eye lands on real counts. Mix column: this week's providers as chips (codes bold, /reqs light),
   services as a muted text line under them; chips wrap so the Total row never stretches the column. */
.sms-sum { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 0; font-size: .88rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.sms-table td.num.zero { color: var(--muted); }
.sms-table th.sms-mix { min-width: 22em; white-space: normal; }
.sms-table td.sms-mix { min-width: 22em; max-width: 30em; }
.sms-table td.sms-mix .chips { display: flex; flex-wrap: wrap; }
.sms-table td.sms-mix .chip .of { font-weight: 500; color: var(--muted); }
.sms-svc { display: block; margin-top: 5px; font-size: .8rem; font-weight: 500; line-height: 1.5; color: var(--muted); }
.sms-svc > span { white-space: nowrap; }

/* v29 Telegram accounts: stock strip, link variants, handle badge photos and /admin/tg.
   Text on tints stays AA: --ink on --brand-mint-soft 13:1, --warn on --warn-bg 6.4:1, --danger on --danger-bg 6.8:1.
   Low stock is a word ("low") and a tint, never colour alone. */
.page-head .tg-stock-strip { margin-top: 6px; }   /* beats .page-head .creator-summary { margin: 0 } so the strip sits 6px under the sub line like .sub does under h1 */
.chip.low { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn); }
.chip.low .chip-note { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-left: 3px; }
.badge.banned { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }

/* /admin/tg: stock table flags low creators; the accounts table lets its action buttons wrap instead of side-scrolling */
td.num .badge.warn { margin-left: 6px; vertical-align: 1px; }
.tg-table td { vertical-align: top; }
.tg-table .phone, .tg-table .preset { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tg-table .since { white-space: nowrap; }
.tg-table td .actions { flex-wrap: wrap; min-width: 240px; }
.tg-table td .inline-form.compact { flex: 1 1 100%; }

/* Telegram account search (/admin/tg, /subadmin/tg, /lead/tg): one big search field, then match cards that say
   which VA and Manager hold the account. "Last assigned" is spelled out, never a tint alone. */
.card.tg-search { padding: 18px 22px; }
.tg-search-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tg-search-row label { flex: 1 1 100%; margin: 0; }
.tg-search-row .field { position: relative; flex: 1 1 320px; min-width: 0; }
.tg-search-row .field svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.tg-search-row input { appearance: none; -webkit-appearance: none; min-height: 46px; padding-left: 42px; font-size: 1.02rem; }   /* Safari's native searchfield ignores padding/border */
.tg-search-row.is-on input { border-color: var(--primary); background-color: var(--brand-mint-soft); }
.tg-search-row > button { margin: 0; min-height: 46px; padding: 9px 22px; }
.tg-search-row .toggle-link { margin-left: 2px; }
.tg-search .hint { margin-top: 8px; }
.tg-search-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 16px 0 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.tg-search-head h2 { font-size: 1.1rem; margin: 0; }
.tg-search-head .handle { font-family: var(--font-body); font-size: .9em; white-space: normal; overflow-wrap: anywhere; }
.tg-search-head .muted { font-size: .9rem; }
.tg-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tg-result { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px 20px; align-items: start; padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--card); }
.tg-result-who { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.tg-result-who .handle { font-size: 1.08rem; white-space: normal; overflow-wrap: anywhere; }
.tg-result dl { margin: 0; min-width: 0; }
.tg-result dt { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 3px; }
.tg-result dd { margin: 0; color: var(--ink); line-height: 1.45; overflow-wrap: anywhere; }
.tg-result dd .muted { font-size: .85rem; }
.tg-result dd .since { font-size: .82rem; }
.tg-result dd .handle { white-space: normal; overflow-wrap: anywhere; }
.tg-more { margin-top: 10px; }
.tg-more a { font-weight: 600; }
.tg-search .empty { padding-top: 18px; padding-bottom: 6px; }

/* "Last assigned" marker in result cards and table cells: a small uppercase label, text carries the meaning */
.was { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--warn); }
.tg-table .was + br + .handle, .tg-result .was + br + .handle { font-weight: 500; }   /* previous holder reads lighter than a live assignment */
td .chip.accent { font-size: .8rem; }

@media (max-width: 760px) {
  .card.tg-search { padding: 18px; }
  .tg-search-row > button { flex: 1 1 100%; min-height: 44px; }
  .tg-search-row .toggle-link { flex: 1 1 100%; text-align: center; padding: 6px 0; margin: 0; }
  .tg-result { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}

/* VA Resources: handle variants with a fixed label column, then the 3 x 3 badge grid (16:10 images) */
.tg-resources-card .card-head h2 .handle { font-family: var(--font-body); font-weight: 600; font-size: .78em; color: var(--muted); margin-left: 4px; }
.tg-variants { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tg-variants .lab { flex: 0 0 96px; font-size: .88rem; font-weight: 600; color: var(--muted); }
.tg-resources-card h3 { margin-top: 22px; }
.gallery-grid.tg-badge-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-top: 12px; }
.tg-badge-grid .tile-media { aspect-ratio: 16 / 10; background: var(--surface-subtle); }
.tg-badge-grid .tile-media img { object-fit: contain; }
.tg-badge-grid .tile-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.tg-badge-grid .tile-name .code { font-weight: 700; color: var(--primary); margin-right: 4px; }

@media (max-width: 760px) {
  .tg-variants .lab { flex-basis: 100%; margin-bottom: -4px; }
  .gallery-grid.tg-badge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tg-badge-grid .tile-name { font-size: .78rem; }
}

/* v36/v43 conversation scanner (Lead Managers, sub-admins and the admin): filters in a row, a Sample fieldset (number
   input + preset pills, pressed = the creator-filter green tint), quick questions as pill chips, an indeterminate bar
   while the scan runs (reuses .job-bar). The result is a thread: "You" turns are plain text with a green left rule,
   "Grok" turns are plain text in a tinted box (white-space keeps Grok's line breaks; the script only sets textContent),
   then the follow-up form and a "which chat is which" table in a <details>. .chat-scan--page is the full-page view. */
.chat-scan .head-links { flex-wrap: wrap; gap: 4px 12px; }
.chat-scan .head-links > * { white-space: nowrap; }
.chat-scan .head-links a { font-size: .85rem; font-weight: 600; color: var(--primary); text-decoration-color: var(--brand-mint-line); }
.chat-scan .head-links a:hover { color: var(--ink); text-decoration-color: currentColor; }
.chat-scan-filters > div { flex: 1 1 150px; }
.chat-scan-sample { border: 0; padding: 0; margin: 14px 0 0; min-width: 0; }
.chat-scan-sample legend { padding: 0; margin: 0 0 6px; font-weight: 600; font-size: .88rem; color: var(--ink); }
.chat-scan-sample legend .muted { font-weight: 500; font-size: .82rem; margin-left: 6px; }
.chat-scan-sample-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.chat-scan-sample input[type=number] { width: 96px; min-height: 38px; padding: 6px 10px; font-variant-numeric: tabular-nums; }
.chat-scan-sizes { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-scan-sizes button { border-radius: 999px; padding: 5px 12px; font-variant-numeric: tabular-nums; }
.chat-scan-sizes button[aria-pressed="true"] { background: var(--brand-mint-soft); border-color: var(--primary); color: var(--ink); }
.chat-scan-qualified { margin: 14px 0 0; }
.chat-scan-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.chat-scan-presets-label { flex: 1 1 100%; font-size: .88rem; font-weight: 600; color: var(--ink); margin-bottom: -3px; }
.chat-scan-presets button { border-radius: 999px; padding: 6px 13px; white-space: normal; text-align: left; line-height: 1.3; }
.chat-scan textarea { font: inherit; min-height: 64px; }
.chat-scan-submit { margin-top: 12px; gap: 8px 14px; }
.chat-scan-submit .hint { margin: 0; flex: 1 1 240px; font-size: .88rem; }
.chat-scan-error { color: var(--danger); font-weight: 600; }
.chat-scan-progress { height: 6px; margin: 12px 0 0; }
.chat-scan-progress[hidden] { display: none; }
.chat-scan form[aria-busy="true"] button { opacity: .55; cursor: progress; pointer-events: none; }
.chat-scan form[aria-busy="true"] textarea { opacity: .7; }
.chat-scan-result { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.chat-scan-result .sub { font-variant-numeric: tabular-nums; }
.chat-scan-stale { margin-top: 8px; padding: 8px 12px; background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: var(--radius-sm); color: var(--ink); font-weight: 500; }

/* Thread */
.chat-scan-thread { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.chat-scan--page .chat-scan-thread { max-width: 80ch; }
.chat-scan-turn { min-width: 0; }
.chat-scan-who { display: block; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 6px; }
.chat-scan-msg { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.chat-scan-turn.you .chat-scan-msg { padding: 2px 0 2px 12px; border-left: 3px solid var(--brand-mint); color: var(--ink); font-weight: 500; }
.chat-scan-turn.grok .chat-scan-msg { padding: 14px 16px; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.chat-scan-turn.is-pending .chat-scan-msg { color: var(--muted); font-style: italic; }
.chat-scan-turn.is-pending .chat-scan-progress { margin-top: 8px; }

/* Follow-up form */
.chat-scan-followup { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border-strong); }
.chat-scan--page .chat-scan-followup { max-width: 80ch; }
.chat-scan-followup > .hint { margin-top: 8px; }
.chat-scan-followup.is-expired textarea { background: var(--surface-subtle); color: var(--muted); }
.chat-scan-followup.is-expired button[type=submit] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.chat-scan-followup.is-expired [data-reset] { background: var(--primary); color: #fff; border-color: var(--primary); }
.chat-scan-followup.is-expired [data-reset]:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

/* Mapping table */
.chat-scan-map { margin-top: 16px; }
.chat-scan-result summary { cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--primary); border-radius: var(--radius-sm); }
.chat-scan-result summary:hover { color: var(--ink); }
.chat-scan-result summary:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.chat-scan-result details .table-wrap { margin-top: 8px; }
.chat-scan > .hint { margin-top: 14px; max-width: 80ch; }

@media (max-width: 760px) {
  .chat-scan-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat-scan-sample input[type=number] { width: 100%; }
  .chat-scan-sample-row > div { flex: 1 1 100%; }
  .chat-scan-submit > button { flex: 1 1 100%; }
  .chat-scan-submit .hint { flex-basis: 100%; }
}

/* v40 SMS usage page (/lead/sms, /subadmin/sms, /admin/sms). One GET form in a card: period pills + custom dates on
   the first row, scope selects + sort on the second. Picked state is the green tint used by the creator filter
   (--ink on --brand-mint-soft 13:1). Sorted column: --ink header, an arrow glyph, bold cells; aria-sort carries the
   meaning. Zero rows stay muted (6.4:1) so "least" sorts read as a list of names with 0s, not noise. */
.sms-filters { padding: 18px 22px; }
.sms-filters fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.sms-filters legend { padding: 0; margin: 0 0 8px; font-weight: 600; font-size: .85rem; color: var(--muted); }
.sms-period { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.sms-period legend { flex: 1 1 100%; }
.sms-period .filters { flex: 1 1 auto; }
.sms-dates { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.sms-dates > div { display: flex; align-items: center; gap: 8px; }
.sms-dates label { margin: 0; font-size: .85rem; color: var(--muted); white-space: nowrap; }
.sms-dates input[type=date] { width: auto; min-width: 150px; min-height: 36px; padding: 5px 10px; font-size: .9rem; }
.sms-dates.is-on input[type=date] { border-color: var(--primary); background-color: var(--brand-mint-soft); }
.sms-custom { font-size: .85rem; font-variant-numeric: tabular-nums; }
.sms-scope { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.sms-scope > div { flex: 1 1 150px; max-width: 220px; min-width: 0; }
.sms-scope label { margin-top: 0; font-size: .85rem; color: var(--muted); }
.sms-scope select { min-height: 38px; padding-top: 6px; padding-bottom: 6px; font-size: .92rem; }
.sms-scope select.is-on { border-color: var(--primary); background-color: var(--brand-mint-soft); }
.sms-scope > button { margin: 0; min-height: 38px; padding: 6px 14px; font-size: .88rem; }   /* level with the 38px selects, as .creator-filter */
.sms-scope .toggle-link { align-self: flex-end; line-height: 38px; margin-left: 2px; }        /* centred on the button, not on the label + select stack */
/* v49 dashboard filter card: the Lead Manager select gets room for its long "lead · Team" labels (desktop only;
   phones keep every select full width). */
@media (min-width: 761px) {
  .dash-filters .f-lead { flex-basis: 220px; max-width: 320px; }
}

/* Totals for the picked period: the four stat cards above the tables; "x / y" keeps the slash quiet */
.sms-stats .big .sep { color: var(--faint); font-weight: 500; }

/* Sortable headers: the whole label is the link; the active column is --ink with ↓ / ↑ (direction also in aria-sort).
   Numeric columns keep the label flush right by putting the arrow on the left. */
th.sortable a.sort { position: relative; display: inline-flex; align-items: center; gap: 5px; color: inherit; text-decoration: none; padding: 2px 4px; margin: -2px -4px; border-radius: 6px; } /* relative: paints above the sticky .name gutter cover so hover/focus aren't clipped */
th.sortable a.sort:hover { color: var(--ink); background: var(--surface-subtle); }
th.sortable a.sort:focus-visible { outline-offset: 0; }
th.sortable .sort-ic { width: 10px; font-size: .8rem; line-height: 1; opacity: .55; }
th.sortable[aria-sort] a.sort { color: var(--ink); }
th.sortable[aria-sort] .sort-ic { opacity: 1; }
th.sortable[aria-sort="descending"] .sort-ic::before { content: "↓"; }
th.sortable[aria-sort="ascending"] .sort-ic::before { content: "↑"; }
th.sortable.num a.sort { flex-direction: row-reverse; }
th.sortable abbr { text-decoration: none; border-bottom: 1px dotted currentColor; }
.sms-window td.num.on { font-weight: 600; }
.sms-window td.num.on.zero { font-weight: 500; }

@media (max-width: 760px) {
  .sms-filters { padding: 16px 18px; }
  .sms-dates { width: 100%; }
  .sms-dates > div { flex: 1 1 100%; }
  .sms-dates label { flex: 0 0 3.2em; }
  .sms-dates input[type=date] { flex: 1; min-width: 0; }
  .sms-scope > div { flex: 1 1 100%; max-width: none; }
  .sms-scope > button { flex: 1 1 100%; }
  .sms-scope .toggle-link { flex: 1 1 100%; text-align: center; padding: 6px 0; margin: 0; line-height: 1.5; } /* a comfortable tap row under the full-width button */
}

/* v42 Superadmin dashboard. Tints reuse the AA pairs above: --ink on --brand-mint 10.3:1, --warn on --warn-bg 6.4:1,
   --muted on white 6.4:1. "override" and "from <parent>" are words, not colours; the × on a country chip has a
   label naming the country and tier. */

/* Dashboard and drill-down headers: the intro stays a readable measure so the drill-downs' creator filter and the
   quick links sit to its right (the dashboard's own filters are a card under the header). */
.dash-head > div:first-child { flex: 1 1 320px; max-width: 62ch; }
.dash-head .page-tools { margin-left: auto; }
.page-tools { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.page-tools .head-links { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; justify-content: flex-end; font-size: .88rem; }
.page-tools .head-links a { font-weight: 600; text-decoration: none; }
.page-tools .head-links a:hover { text-decoration: underline; }

/* Summary strip footers: last-week figure left, link right, the Paid X/Y progress on its own line under them */
.stat-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--border); font-size: .88rem; color: var(--muted); }
.stat-foot strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-foot .toggle-link { grid-column: 2; grid-row: 1; }
.stat-foot .badge, .stat-foot .pay-progress { grid-column: 1 / -1; font-size: .78rem; }
.big.earnings { color: var(--primary); }

/* Org and fraud tables: sticky name column like the clicks/SMS tables; a Rate cell that says where the rate came from */
.org-table .name, .fraud-table .name { position: sticky; left: 0; z-index: 1; background: var(--card); box-shadow: 8px 0 8px -8px rgba(20, 43, 31, .18); }
.org-table .name::before, .fraud-table .name::before { content: ""; position: absolute; top: 0; bottom: -1px; right: calc(100% - 1px); width: 48px; background: var(--card); }
.org-table thead .name, .fraud-table thead .name { z-index: 2; }
.org-table tbody tr:hover td.name, .fraud-table tbody tr:hover td.name { background: var(--surface-subtle); }
.org-table td.name, .fraud-table td.name { min-width: 9em; max-width: 15em; }
.org-table td.name .handle, .org-table td.name.handle, .fraud-table td.name .handle { white-space: normal; overflow-wrap: anywhere; }
.org-table .cell-sub, .fraud-table .cell-sub { display: block; font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-table tfoot th, .fraud-table tfoot th { text-align: left; }
.card.org > .empty { padding-top: 20px; }
.org-table tr.context td, .org-table tr.context a { color: var(--muted); }
.org-table td.num.zero, .fraud-table td.num.zero { color: var(--muted); }
td.rate { white-space: nowrap; }
.badge.override { background: var(--brand-mint); color: var(--ink); text-transform: none; margin-left: 4px; }
.rate-from { display: block; font-size: .76rem; color: var(--muted); font-weight: 500; }
.badge.scope { background: var(--neutral-bg); color: var(--neutral); border: 1px solid var(--neutral-border); text-transform: none; }
h1 .badge.scope { font-size: .8rem; }
/* /admin/subadmins: effective GBM-logo state. Hidden is a deliberate setting, so ink on a subtle fill with a border, not a warning tint */
.badge.logo-off { background: var(--surface-subtle); color: var(--ink); border: 1px solid var(--border-strong); text-transform: none; }
.logo-from { display: block; font-size: .76rem; color: var(--muted); font-weight: 500; white-space: nowrap; }
td.logo-cell { white-space: nowrap; }

/* Compensation card: two columns, default rate left and overrides right */
.comp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 20px 28px; }
.comp-col h3:first-child { margin-top: 0; }
.comp-visibility { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.comp-visibility label.check { margin: 0; }
.comp-visibility > button:last-child { margin: 0; }
.comp .inline-form .ov-rate-field { flex: 0 1 150px; }
ul.plain.overrides { margin-top: 14px; }
ul.plain.overrides li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 14px; align-items: center; padding: 10px 0; }
.ov-who { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ov-who .cell-sub { flex-basis: 100%; font-size: .82rem; }
.ov-rate { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ov-rate .earnings { font-size: 1.05rem; }
.ov-clear { margin: 0; }
.ov-clear > button:last-child { margin: 0; }

/* Rate card on a drill-down page */
.rate-scope .rate-now { display: inline-flex; align-items: baseline; gap: 4px; font-variant-numeric: tabular-nums; }
.rate-scope .rate-now .earnings { font-size: 1.35rem; }
.rate-scope .inline-form > div { flex: 0 1 260px; }

/* Dashboard: compensation and tiers side by side; stack under 1100px */
.comp-tier-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.comp-tier-grid > .card { margin-bottom: 0; }
.comp-tier-grid .comp-grid { grid-template-columns: minmax(0, 1fr); }

/* v52 Throttle back (superadmin only). The pill reads "−20%" in amber like the other "less than full" badges
   (unpaid, warn); the dashboard card reuses the Compensation layout, the scoped card the rate-scope one. */
.badge.throttle { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-border); text-transform: none; font-variant-numeric: tabular-nums; margin-left: 6px; vertical-align: 1px; }
h1 .badge.throttle { font-size: .8rem; vertical-align: middle; }
.throttle .inline-form .th-pct-field { flex: 0 1 190px; }
.throttle.global .inline-form .th-pct-field { flex: 1 1 100%; }   /* settings: the % select is the only field, so it takes the row and Save / Turn off sit beneath */
.th-now { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; white-space: nowrap; }
.th-now .badge.throttle { margin-left: 0; font-size: .82rem; }
.th-since { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Filtered dashboard: scoped rate and scoped throttle side by side; stack under 1100px */
.scope-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; align-items: start; }
.scope-grid > .card { margin-bottom: 0; }
@media (max-width: 1100px) { .scope-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .throttle .inline-form .th-pct-field { flex: 1 1 100%; }
  ul.plain.overrides.throttles li { grid-template-columns: minmax(0, 1fr); }   /* name, then "−20% since …", then Remove */
}

/* Country tier editor: two panels of removable chips, then the add row */
.tier-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.tier-panel { padding: 14px 16px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); border-left: 4px solid var(--border-strong); background: #fff; }
.tier-panel.t1 { border-left-color: var(--primary); background: linear-gradient(160deg, var(--brand-mint-soft), #fff 70%); }
.tier-panel.t2 { border-left-color: var(--info-border); background: linear-gradient(160deg, var(--info-bg), #fff 70%); }
.tier-panel h3 { margin: 0 0 10px; }
.tier-panel h3 .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
.tier-panel .note { padding: 10px 12px; font-size: .88rem; }
ul.chips-edit { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.chip.chip-rm { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; background: #fff; }
.chip-rm .cc { color: var(--muted); font-weight: 500; }
.chip-rm form { margin: 0; display: inline-flex; }
.chip-rm form > button:last-child { margin: 0; }   /* beats the global form > button:last-child top margin */
.chip-x { width: 22px; height: 22px; min-height: 0; padding: 0; border-radius: 50%; background: transparent; color: var(--muted); border-color: transparent; font-size: 1rem; line-height: 1; }
.chip-x:hover { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.chip-x:focus-visible { outline-color: var(--danger); }
.tier-add { margin-top: 16px; }
.tier-add .tier-pick { flex: 0 1 170px; }
.tier-reset { margin-top: 12px; }
.tier-reset > button:last-child { margin: 0; }
.tiers-edit > .hint { margin-top: 12px; }

/* "Show removed" sits between two tables */
.table-toggle { margin: -6px 0 10px; }

@media (max-width: 1100px) {
  .comp-tier-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .page-tools { align-items: stretch; width: 100%; }
  .page-tools .head-links { justify-content: flex-start; }
  .comp-grid { grid-template-columns: minmax(0, 1fr); }
  ul.plain.overrides li { grid-template-columns: minmax(0, 1fr) auto; }
  ul.plain.overrides li .ov-clear { grid-column: 1 / -1; }
  ul.plain.overrides li .ov-clear button { width: 100%; }
  .org-table td.name, .fraud-table td.name { min-width: 7.5em; max-width: 10em; }
  .tier-panel { padding: 12px 14px 10px; }
  .chip-x { width: 28px; height: 28px; }
  .comp .inline-form .ov-rate-field, .tier-add .tier-pick, .rate-scope .inline-form > div { flex: 1 1 100%; }
}

/* v47 Fraud tracker (/admin/fraud). The header holds the intro on the left and the scan bar on the right: last run,
   its flag counts and the "Scan now" button. The three flag kinds are words on tinted pills; tints reuse the AA
   pairs above (--danger on --danger-bg 6.8:1, --warn on --warn-bg 6.4:1, --neutral on --neutral-bg 7:1) and are never the only cue.
   Stat cards for the kinds carry the same tint as a left rule, like the week-compare tiles. */
.fraud-head > div:first-child { flex: 1 1 320px; max-width: 62ch; }
.fraud-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 10px 0 0; font-size: .88rem; }
.fraud-status .badge { text-transform: none; border: 1px solid transparent; }
.badge.fraud-on { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-border); }
.badge.fraud-off { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.fraud-scan {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-left: auto; padding: 12px 16px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.fraud-scan-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fraud-scan-meta .label { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 0; }
.fraud-scan-meta strong { font-size: .95rem; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fraud-scan-sum { display: flex; flex-wrap: wrap; gap: 2px 0; font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.fraud-scan-sum > span + span::before { content: "·"; color: var(--faint); margin: 0 6px; }
.fraud-scan > button:last-child { margin: 0; flex: 0 0 auto; }   /* beats the global form > button:last-child top margin */

.fraud-stats .stat { border-left: 4px solid var(--border-strong); }
.fraud-stats .stat.fraud-self { border-left-color: var(--danger-border); }
.fraud-stats .stat.fraud-dup { border-left-color: var(--neutral-border); }
.fraud-stats .stat.fraud-sneaky { border-left-color: var(--warn-border); }
.fraud-stats .sub { font-variant-numeric: tabular-nums; }
.fraud-amount { color: var(--ink); font-weight: 700; }

.badge.fraud { text-transform: none; border: 1px solid transparent; font-size: .78rem; }
.badge.fraud.self { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.badge.fraud.dup { background: var(--neutral-bg); color: var(--neutral); border-color: var(--neutral-border); }
.badge.fraud.sneaky { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }

/* Sorted column reads bold (aria-sort carries the meaning); zero cells stay muted; money and tier splits never wrap */
.fraud-table td.num.on { font-weight: 600; }
.fraud-table td.num.on.zero { font-weight: 500; }
.fraud-table td.money, .fraud-table .tiers-col { white-space: nowrap; }
.fraud-table .tiers-col { color: var(--muted); }
.fraud-table tbody .tiers-col { font-size: .88rem; }
.fraud-table .tiers-col .sep { color: var(--faint); }
.fraud-table th.tiers-col abbr, .fraud-table th.num abbr { text-decoration: none; cursor: help; border-bottom: 1px dotted currentColor; }
.fraud-recent td.date { color: var(--muted); }
.fraud-recent td.detail { max-width: 22em; overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .fraud-head > div:first-child { max-width: none; }
  .fraud-scan { width: 100%; margin-left: 0; }
  .fraud-scan > button:last-child { flex: 1 1 100%; }
}

/* SPEC v60: 7-day VA SMS lockout badge, manager-issued SMS puller card, and SMS accountability columns.
   Reuses verified AA pairs: --warn on --warn-bg (6.4:1), --ok on --ok-bg (6.5:1), --muted on white (6.4:1).
   Lock state carries a padlock glyph + explicit text ("SMS locked · until …"), never colour alone. */
.badge.sms-locked {
  display: inline-flex; align-items: center; gap: 4px; text-transform: none; padding: 2px 9px 2px 7px;
  background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-border);
  font-size: .73rem; line-height: 1.3; font-variant-numeric: tabular-nums; vertical-align: middle;
}
.badge.sms-locked::before {
  content: ""; width: 11px; height: 11px; flex-shrink: 0; background-color: currentColor;
  -webkit-mask: var(--glyph) center / contain no-repeat; mask: var(--glyph) center / contain no-repeat;
  --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E");
}
.badge.sms-locked .lock-until { font-weight: 500; white-space: nowrap; }
td.name .badge.sms-locked, td .badge + .badge.sms-locked {
  display: flex; width: fit-content; margin: 4px 0 2px;
}

/* Manager-issued SMS puller card (.card.sms-pull) */
.sms-pull-form .sms-field-va { flex: 2 1 260px; }
.sms-pull-form .sms-field-service { flex: 1 1 160px; }
.sms-pull-form .sms-field-country { flex: 0 1 195px; }
.sms-orders-wrap { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.sms-orders-wrap h3 { margin: 0 0 10px; }
.sms-orders { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sms-order {
  display: grid;
  grid-template-columns: minmax(172px, 1.12fr) 136px minmax(264px, 1.35fr) minmax(200px, 1.03fr) minmax(118px, auto);
  gap: 8px 14px; align-items: center; padding: 12px 14px;
  border: 1px solid var(--border-strong); border-left: 4px solid var(--border-strong);
  border-radius: var(--radius-sm); background: #fff;
}
.sms-order.is-open { border-left-color: var(--info-border); background: linear-gradient(160deg, var(--info-bg), #fff 65%); }
.sms-order.is-received { border-left-color: var(--ok-border); background: linear-gradient(160deg, var(--ok-bg), #fff 68%); }
.sms-order-who { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sms-order-who .handle { overflow: hidden; text-overflow: ellipsis; }
.sms-order-meta { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.sms-order-status .badge { text-transform: none; }
.sms-order-cell { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sms-cell-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.sms-copy-pair { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sms-copy-pair code {
  display: inline-flex; align-items: center; min-height: 30px; padding: 3px 8px;
  font-size: .9rem; font-weight: 600; background: var(--surface-subtle); border: 1px solid var(--border-strong);
  border-radius: 6px; font-variant-numeric: tabular-nums;
}
.sms-copy-pair code.sms-otp {
  background: #fff; border-color: var(--ok-border); color: var(--ink);
  font-size: 1rem; font-weight: 700; letter-spacing: .06em;
}
.sms-copy-pair button.copy { min-height: 30px; padding: 4px 9px; font-size: .78rem; border-radius: 6px; }
.sms-wait { display: inline-flex; align-items: center; gap: 7px; font-size: .85rem; color: var(--muted); font-weight: 500; }
.sms-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--info); animation: sms-pulse 1.4s ease-in-out infinite; flex-shrink: 0; }
@keyframes sms-pulse { 0%, 100% { opacity: .35; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.1); } }
.sms-order-actions { justify-self: end; }
.sms-order-actions button { white-space: nowrap; }

@media (max-width: 1100px) {
  .sms-order {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
  }
  .sms-order-status { align-self: start; }
  .sms-order-cell, .sms-order-actions { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 760px) {
  .sms-table td.name:has(.badge.sms-locked) { max-width: 11em; }
  td.name .badge.sms-locked { font-size: .66rem; padding: 2px 6px 2px 5px; gap: 3px; }
  td.name .badge.sms-locked::before { width: 10px; height: 10px; }
  .sms-pull-form .sms-field-va,
  .sms-pull-form .sms-field-service,
  .sms-pull-form .sms-field-country { flex: 1 1 100%; }
  .sms-order-actions { width: 100%; }
  .sms-order-actions form, .sms-order-actions button { flex: 1 1 100%; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .sms-dot { animation: none; opacity: .8; }
}

/* Leaderboard (SPEC v64, v65): one card per board, side by side when they fit (same auto-fit as .grid); a single
   board stays a readable width. Ranks 1–3 wear gold / silver / bronze tints behind
   the number, never colour alone (ink on every tint is over 9:1). Rows carry only rank, masked name and count. */
.lb-boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; align-items: start; }
.lb-boards.one { max-width: 720px; }
.lb-boards > .card { margin-bottom: 0; border-top: 3px solid var(--primary); }
.lb-board .card-head { margin-bottom: 4px; }
.lb-table th { white-space: normal; line-height: 1.3; }
.lb-table th.rank, .lb-table td.rank { width: 1%; white-space: nowrap; padding-right: 6px; }
.lb-table td { padding-top: 9px; padding-bottom: 9px; }
.lb-table td:nth-child(2) { font-weight: 600; color: var(--ink); }
.lb-table td.num { font-weight: 700; color: var(--ink); font-size: 1.05rem; }
.rank-badge {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface-subtle); border: 1px solid var(--border-strong); color: var(--muted);
  font-weight: 700; font-size: .85rem; line-height: 1; font-variant-numeric: tabular-nums;
}
.lb-table tr.r1 .rank-badge { background: #f9e7a3; border-color: #e3c45c; color: var(--ink); }
.lb-table tr.r2 .rank-badge { background: #e8edeb; border-color: #c3cfc9; color: var(--ink); }
.lb-table tr.r3 .rank-badge { background: #f2d3bd; border-color: #d9a98a; color: var(--ink); }
.lb-table tr.r1 td:nth-child(2) { font-weight: 700; }
.lb-table tr.r1 td.num { font-size: 1.2rem; }

/* SPEC v67 Conversation Waterfall Report (/subadmin/report, /admin/report).
   Reuses verified AA pairs: --ink on --brand-mint-soft (13:1), --danger and --warn on white (7:1+), --muted on white (6.4:1).
   Compound cells (Fraud & Clean) keep the primary count bold and the 3-way breakdown in a tabular muted sub-span. */
.waterfall-banner {
  padding: 16px 22px;
  border-left: 4px solid var(--primary);
  background: linear-gradient(160deg, var(--brand-mint-soft), #fff 68%);
}
.waterfall-line {
  margin: 0;
  font-size: .95rem;
  line-height: 1.65;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.waterfall-line .wf-op {
  color: var(--muted);
  font-weight: 700;
  margin: 0 3px;
}
.waterfall-line .wf-fraud > strong {
  color: var(--danger);
}
.waterfall-line .wf-throttled > strong {
  color: var(--warn);
}
.waterfall-line .wf-net > strong {
  color: var(--ok);
}

.conv-stats .stat { display: flex; flex-direction: column; border-left: 4px solid var(--border-strong); }
.conv-stats .stat.conv-stat-raw { border-left-color: var(--neutral-border); }
.conv-stats .stat.conv-stat-fraud { border-left-color: var(--danger-border); }
.conv-stats .stat.conv-stat-throttled { border-left-color: var(--warn-border); }
.conv-stats .stat.conv-stat-net { border-left-color: var(--primary); }
.conv-stats .big { font-size: clamp(1.65rem, 2vw, 2.05rem); white-space: nowrap; margin-top: auto; }
.conv-stats .sub { font-variant-numeric: tabular-nums; }

.conv-table th, .conv-table td { padding: 10px 8px; }
.conv-table th:first-child, .conv-table td:first-child { padding-left: 0; }
.conv-table th:last-child, .conv-table td:last-child { padding-right: 0; }
.conv-table td.name { min-width: 7.5em; }
.conv-table th.conv-split-col { white-space: normal; max-width: 11.5em; line-height: 1.25; }
.conv-table .mgr-team {
  font-weight: 500;
  font-size: .86rem;
  white-space: nowrap;
}
.conv-table td.conv-split {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.conv-table td.conv-split .split-main {
  font-weight: 700;
  color: var(--ink);
}
.conv-table td.conv-split.zero .split-main {
  font-weight: 500;
  color: var(--muted);
}
.conv-table td.conv-split .split-sub {
  color: var(--muted);
  font-weight: 500;
  font-size: .86rem;
  margin-left: 2px;
}
.conv-table td.conv-split .sep {
  color: var(--faint);
}
.conv-table tfoot td.conv-split .split-main {
  font-weight: 700;
  color: var(--ink);
}
.conv-table td.conv-leads {
  font-weight: 700;
  color: var(--ink);
}
.conv-table td.conv-leads.zero {
  font-weight: 500;
  color: var(--muted);
}

@media (max-width: 760px) {
  .waterfall-banner { padding: 14px 18px; }
  .waterfall-line { font-size: .88rem; }
  .conv-table .mgr-team { display: block; font-size: .8rem; }
}

/* SPEC v77 navigation. Jump pills under a page's filters; collapsible cards (<details class="card card-fold">: the
   sub-admin's inline add forms, the Lead Manager's per-manager VA tables) and the VA's "How leads are counted" rules.
   Each <summary> is the button; the chevron (shared with .mgr-row) is decorative and turns over when open. Jump
   targets clear the page edge (and, on phones, the sticky top bar). */
.content [id] { scroll-margin-top: 12px; }
.section-jumps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.section-jumps .pill { padding: 5px 13px; min-height: 32px; }

details.card.card-fold { padding: 0; }
.card-fold-summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 22px;
  cursor: pointer; user-select: none; border-radius: var(--radius);
}
.card-fold-summary::-webkit-details-marker, .tier-rules-summary::-webkit-details-marker { display: none; }
.card-fold-summary.card-head { flex-wrap: nowrap; margin-bottom: 0; }
.card-fold-summary:hover { background: var(--surface-subtle); }
.card-fold-summary:focus-visible, .tier-rules-summary:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.card-fold[open] > .card-fold-summary { border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.card-fold[open] > .card-fold-summary .chev, .tier-rules[open] > .tier-rules-summary .chev { transform: rotate(-135deg); margin: 4px 6px 0 0; }
.card-fold-title { font-size: 1.15rem; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; color: var(--ink); }
.card-fold-meta { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; }
/* Body padding matches .card's, so a .table-wrap inside keeps its usual negative gutters; a table placed straight in
   the fold has no padded parent, so it spans the card and keeps only the inner gutter. */
.card-fold-body { padding: 18px 22px 20px; }
.card-fold > .table-wrap { margin: 0; padding-bottom: 8px; }

/* The summary row is padded for a comfortable target; the negative margins keep the text where the plain label sat. */
.tier-rules-summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; cursor: pointer; user-select: none; border-radius: 6px; }
.compare .tier-rules .tier-rules-summary { margin: -6px 0 -2px; }
.tier-rules:not([open]) > .tier-rules-summary { margin-bottom: -6px; }
.tier-rules-summary:hover { color: var(--ink); }

@media (max-width: 760px) {
  .content [id] { scroll-margin-top: 112px; }
  .section-jumps { gap: 6px; margin-bottom: 12px; }
  .section-jumps .pill { padding: 6px 12px; min-height: 34px; }
  .card-fold-summary, .card-fold-body { padding: 14px 18px; }
}
