/* ── Per-rank pills — sidebar account badge + user-management table.
   Colour/ring only (background-color so callers can keep a caret image);
   inset box-shadow rings, never 1px borders (bowtie in screenshots). ── */
.role-squire  { color:var(--rank-squire);         background-color:color-mix(in srgb, var(--rank-squire) 12%, transparent); box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--rank-squire) 22%, transparent); }
.role-contender{ color:var(--rank-contender); background-color:color-mix(in srgb, var(--rank-contender) 10%, transparent); box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--rank-contender) 18%, transparent); }
.role-knight  { color:var(--rank-knight);   background-color:color-mix(in srgb, var(--rank-knight) 10%, transparent);   box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--rank-knight) 18%, transparent); }
.role-banneret{ color:var(--rank-banneret); background-color:color-mix(in srgb, var(--rank-banneret) 10%, transparent); box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--rank-banneret) 30%, transparent); }
.role-warden  { color:var(--rank-warden);   background-color:color-mix(in srgb, var(--rank-warden) 12%, transparent);   box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--rank-warden) 32%, transparent); }

/* ── Standalone page column (.um-page) ──────────────────────────────────────
   The bare shell. Still used AS-IS by the two billing pages (manage.html,
   payment.html), which is why it is left alone: the Warden consoles layer
   `.adm-page` on top and override it in the block below. ── */
.um-page{ min-height:100vh; background:var(--bg-primary); color:var(--text-primary); font-family:var(--font-sans); }
.um-topbar{ position:sticky; top:0; z-index:5; display:flex; align-items:center; gap:16px; padding:14px 24px; background:color-mix(in srgb, var(--bg-primary) 92%, transparent); backdrop-filter:blur(8px); box-shadow:inset 0 -1px 0 var(--border-default); }
.um-back{ display:inline-flex; align-items:center; gap:6px; color:var(--text-secondary); text-decoration:none; font-size:.8rem; padding:6px 10px; border-radius:var(--radius); transition:background-color .15s,color .15s; }
.um-back:hover{ background-color:var(--bg-tertiary); color:var(--text-primary); }
.um-title{ font-family:var(--font-display); font-weight:700; font-size:1.05rem; letter-spacing:var(--tr-heading); display:inline-flex; align-items:center; gap:8px; }
.um-crest{ color:var(--champagne); display:inline-flex; }
.um-count{ font-size:.72rem; color:var(--text-muted); font-variant-numeric:tabular-nums; }
.um-spacer{ flex:1; }
.um-wrap{ padding:20px 24px 60px; }

/* ══════════════════════════════════════════════════════════════════════════
   WARDEN CONSOLES — /watchlist/users and /watchlist/stocks
   ──────────────────────────────────────────────────────────────────────────
   HOW THESE PAGES SCROLL, AND WHY THE MARKUP LOOKS LIKE THIS.

   01-base.css locks the document for the SPA chart shell:
       html,body{height:100%;overflow:hidden;}
   so ANY standalone page taller than the viewport is clipped with no
   scrollbar to reach the rest of it. That global rule has to stay (the chart
   shell depends on it), so these consoles carry their own scrollport instead:
   `.adm-page` is a flex child of the flex <body>, stretches to body height and
   sets `overflow-y:auto`. Nothing in 01-base.css is touched.

   CONSEQUENCE FOR STICKY. `position:sticky` resolves against the nearest
   ancestor that has a scrolling box — which is now `.adm-page`, not the
   viewport. The toolbar pins at top:0 of that scrollport and the column header
   pins directly under it at top:var(--adm-bar-h). Both offsets are exact only
   because `.um-topbar` is given a FIXED height here (--adm-bar-h), including
   inside the narrow-width block where it wraps to two lines.

   It is also why `.um-board` must NOT set `overflow:hidden` any more: an
   ancestor with an overflow value becomes the sticky scrollport itself, and
   the column header would pin inside a box that never scrolls, i.e. not at
   all. The rounded card edge is drawn on the first/last row instead of being
   clipped by the board.

   DENSITY. These are operator tools: 2.75rem rows, 1.6875rem controls, mono
   tabular numerics, hairline dividers (no zebra), and columns that DROP at
   narrow widths rather than a horizontal scroller — a second scroll container
   on the X axis would unpin the header all over again.
   ══════════════════════════════════════════════════════════════════════════ */

/* Action glyphs. CSS masks painted from `currentColor`, so a button's icon
   inherits its ink (including the destructive garnet) and needs no markup
   change in users.js / stocks.js. Declared at the root because the confirm
   dialogs live outside .adm-page, as body-level siblings. */
:root{
  --adm-ic-trash: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' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M8 6V4h8v2'/%3E%3Cpath d='M18.5 6 17.6 20H6.4L5.5 6'/%3E%3Cpath d='M10 10.5v6M14 10.5v6'/%3E%3C/svg%3E");
  --adm-ic-key: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' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7.5' cy='15.5' r='4.6'/%3E%3Cpath d='M10.8 12.2 21 2'/%3E%3Cpath d='m17 6 3.2 3.2'/%3E%3C/svg%3E");
  --adm-ic-revoke: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' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M5.6 5.6 18.4 18.4'/%3E%3C/svg%3E");
  --adm-ic-pause: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'%3E%3Cpath d='M9 5v14M15 5v14'/%3E%3C/svg%3E");
  --adm-ic-play:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M7 4.4v15.2L20 12z'/%3E%3C/svg%3E");
}

/* ── 1 · Shell + scrollport ─────────────────────────────────────────────── */
.adm-page{
  flex:1 1 auto; min-width:0; min-height:0;
  height:100%;
  overflow-y:auto; overflow-x:hidden;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
  /* ONE grid definition, read by the header strip AND by every body row, so
     the two can never drift apart. The breakpoints at the end of this block
     rewrite it in the same rule that hides a column. */
  --adm-cols:2.5fr 2.1fr 1.45fr .95fr .95fr .62fr 1.6fr;
  --adm-bar-h:3rem;
  --adm-row-h:2.75rem;
  --adm-gut:clamp(0.75rem, 1.5vw, 1.75rem);
}
.adm-page.st-page{ --adm-cols:1.8fr .95fr 2.6fr .62fr .95fr 1.35fr; }

/* ── 2 · Toolbar: breadcrumb · count · search · filter/bulk action ──────── */
.adm-page .um-topbar{
  z-index:6;
  height:var(--adm-bar-h);
  padding:0 var(--adm-gut);
  gap:.5rem;
  /* Opaque, not translucent: it scrolls over live rows, and a blurred bar
     smears the data sliding under it. */
  background:var(--bg-primary);
  backdrop-filter:none;
  box-shadow:inset 0 -1px 0 var(--border-default);
}
.adm-page .um-back,
.mpbc-crumb .um-back{
  gap:.3125rem; font-size:.75rem; font-weight:500;
  color:var(--text-muted);
  padding:.25rem .375rem; margin-left:-.375rem;
}
.adm-page .um-back:hover,
.mpbc-crumb .um-back:hover{ color:var(--text-primary); background:var(--bg-tertiary); }
/* The SPA detail views' breadcrumb (MPDom.crumb, fix/back-buttons
   2026-10-25): "<list> ›" before the item's title, same link look as the
   consoles above. It never shrinks: the title truncates first. */
.mpbc-crumb{ flex:none; display:inline-flex; align-items:center; gap:.25rem; min-width:0; margin-left:-.375rem; white-space:nowrap; }
/* Owner review 2026-10-25 (the faint crumb was missed): the list part is a
   clear back control: chevron + name at the tab labels' size (--mpt-fs),
   secondary text, the standard hover. The consoles' .um-back above keep
   their own look. */
.mpbc-crumb .um-back{ margin-left:0; min-height:var(--ctl-floor, 24px); box-sizing:border-box;
  gap:.25rem; padding:.25rem .5rem .25rem .3125rem; font-size:var(--mpt-fs, 12px); color:var(--text-secondary); }
.mpbc-crumb .um-back:hover{ color:var(--text-primary); background:var(--bg-tertiary); }
.mpbc-crumb .mpbc-crumb-i{ width:12px; height:12px; }
.mpbc-crumb .um-back:focus-visible{ outline:1px solid var(--accent); outline-offset:-1px; }
.adm-sep{ color:var(--text-xmuted); font-size:.8125rem; line-height:1; user-select:none; }
.adm-page .um-title{
  font-family:var(--font-sans); font-weight:600; font-size:.8125rem;
  letter-spacing:0; color:var(--text-primary); gap:0;
}
.adm-page .um-count{
  display:inline-flex; align-items:center; white-space:nowrap; margin-left:.75rem;
  font-family:var(--font-mono); font-size:max(.6875rem, var(--fs-floor)); font-weight:500;
  font-variant-numeric:tabular-nums;
}
.adm-search{ position:relative; display:flex; align-items:center; flex:0 1 21rem; min-width:6.5rem; color:var(--text-muted); }
.adm-search > svg{ position:absolute; left:.5625rem; width:.8125rem; height:.8125rem; pointer-events:none; }
.adm-page .um-search{
  width:100%; height:1.875rem;
  padding:0 .625rem 0 1.75rem;
  font-size:.75rem;
}
.adm-page .um-topbar .um-btn{ height:1.875rem; padding:0 .6875rem; }

.um-search{ width:min(340px,42vw); padding:8px 12px; background:var(--bg-tertiary); color:var(--text-primary); border:none; box-shadow:inset 0 0 0 1px var(--border-default); border-radius:var(--radius); font-size:.8rem; font-family:var(--font-sans); }
.um-search:focus{ outline:none; box-shadow:inset 0 0 0 1px var(--accent); }
/* Plain text field (the grant note) — same chrome, no search affordances. */
.um-field{ width:100%; box-sizing:border-box; height:1.875rem; padding:0 .625rem; background:var(--bg-tertiary); color:var(--text-primary); border:none; box-shadow:inset 0 0 0 1px var(--border-default); border-radius:var(--radius); font-size:.75rem; font-family:var(--font-sans); }
.um-field:focus{ outline:none; box-shadow:inset 0 0 0 1px var(--accent); }
.adm-label{ display:block; font-size:max(.6875rem, var(--fs-floor)); font-weight:600; color:var(--text-muted); margin-bottom:.3125rem; }
.um-modal .um-field{ margin-bottom:1.125rem; }

/* ── 3 · The board ──────────────────────────────────────────────────────── */
.adm-page .um-wrap{ padding:var(--adm-gut) var(--adm-gut) 3.5rem; }
.um-board{
  width:100%;
  border-radius:var(--radius-lg);
  background:var(--bg-secondary);
  box-shadow:inset 0 0 0 1px var(--border-default), var(--shadow-pop);
  /* NO overflow here — see the sticky note at the top of this block. */
}
.um-row{
  display:grid;
  grid-template-columns:var(--adm-cols);
  align-items:center;
  gap:clamp(.5rem, 1.1vw, 1.125rem);
  min-height:var(--adm-row-h);
  padding:.375rem var(--adm-gut);
  background:transparent;
  transition:background-color .1s linear;
}
/* Column header: solid fill (a sticky header must never be see-through) and
   pinned right under the toolbar. */
.um-row.um-head{
  position:sticky; top:var(--adm-bar-h); z-index:4;
  min-height:2rem; padding-top:0; padding-bottom:0;
  font-family:var(--font-sans); font-size:max(.625rem, var(--fs-floor)); font-weight:700;
  letter-spacing:var(--tr-caps); text-transform:uppercase;
  background:var(--bg-tertiary);
  border-radius:var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow:inset 0 -1px 0 var(--border-default);
}
.um-row.um-head > :last-child{ text-align:right; }
.adm-page #um-rows .um-row + .um-row,
.adm-page #st-rows .um-row + .um-row{ box-shadow:inset 0 1px 0 var(--border-subtle); }
.adm-page #um-rows .um-row:last-child,
.adm-page #st-rows .um-row:last-child{ border-radius:0 0 var(--radius-lg) var(--radius-lg); }
.adm-page #um-rows .um-row:hover,
.adm-page #st-rows .um-row:hover{ background:var(--bg-row-hover); }
/* The warden's own row: a champagne edge rail, not a decorative gradient. */
.adm-page #um-rows .um-row.is-self{
  background:color-mix(in srgb, var(--champagne) 6%, transparent);
  box-shadow:inset 0 1px 0 var(--border-subtle);
}
.adm-page #um-rows .um-row.is-self:hover{ background:color-mix(in srgb, var(--champagne) 11%, transparent); }
/* Counts right-align, header cell included, so the digits stack. A hidden
   column keeps its slot in the child list, so these indexes survive every
   breakpoint at the end of this block. */
.adm-page:not(.st-page) .um-row > :nth-child(6){ text-align:right; font-variant-numeric:tabular-nums; }
.adm-page.st-page .um-row > :nth-child(4){ text-align:right; font-variant-numeric:tabular-nums; }

/* ── 4 · Users: identity, rank, meta ────────────────────────────────────── */
.um-user{ display:flex; align-items:center; gap:.5rem; min-width:0; }
.um-avatar-fb{ width:1.625rem; height:1.625rem; border-radius:50%; display:grid; place-items:center; background:var(--bg-elevated); color:var(--champagne); font-weight:700; font-size:max(.6875rem, var(--fs-floor)); flex-shrink:0; box-shadow:inset 0 0 0 1px var(--border-strong); }
.um-uname{ display:flex; flex-direction:column; min-width:0; }
.um-name{ font-weight:600; font-size:.75rem; line-height:1.3; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.um-self-tag{ font-size:max(.5625rem, var(--fs-floor)); font-weight:700; color:var(--champagne); letter-spacing:.06em; margin-left:.375rem; }
.um-handle{ font-family:var(--font-mono); font-size:max(.625rem, var(--fs-floor)); line-height:1.3; }
.um-email{ font-size:.72rem; color:var(--text-secondary); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.um-cell-muted{ font-family:var(--font-mono); font-size:max(.6875rem, var(--fs-floor)); font-variant-numeric:tabular-nums; }
/* Rank cell: dropdown + provenance badge sit SIDE BY SIDE while the column is
   wide enough and stack only when it isn't — one row of height either way. */
.um-rankcell{ display:flex; flex-wrap:wrap; align-items:center; gap:.25rem .3125rem; min-width:0; }
.um-rank{ position:relative; display:inline-flex; }
.um-rank::after{ content:'▾'; position:absolute; right:.4375rem; top:50%; transform:translateY(-50%); font-size:max(.5rem, var(--fs-floor)); color:var(--text-muted); pointer-events:none; }
.um-rank-sel{ appearance:none; -webkit-appearance:none; border:none; cursor:pointer; font-family:var(--font-sans); font-size:max(.625rem, var(--fs-floor)); font-weight:700; letter-spacing:.05em; text-transform:uppercase; padding:.1875rem 1.125rem .1875rem .5625rem; border-radius:999px; }
.um-rank-sel:focus{ outline:none; }
.um-rank-sel:disabled{ opacity:.55; cursor:not-allowed; }
/* Rank source badges — where a rank came from (Stripe, a warden, or the code) */
.um-rank-badge{ display:inline-flex; align-items:center; font-size:max(.5375rem, var(--fs-floor)); font-weight:700; letter-spacing:.06em; text-transform:uppercase; padding:.125rem .4375rem; border-radius:999px; white-space:nowrap; }
.um-rank-badge-paid{ color:var(--accent); background:var(--accent-dim); box-shadow:inset 0 0 0 1px var(--accent-glow); }
.um-rank-badge-comp{ color:var(--champagne); background:var(--champagne-dim); box-shadow:inset 0 0 0 1px var(--champagne-ring); }
.um-rank-badge-admin{ color:var(--amber); background:color-mix(in srgb, var(--amber) 12%, transparent); box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--amber) 32%, transparent); }
/* Manual-grant audit trail, under the username. */
/* `granted by` can be a raw Auth0 sub (one 40-char unbreakable token), so this
   has to be allowed to break mid-word or it bleeds into the next column. */
.um-audit{ font-size:max(.5875rem, var(--fs-floor)); line-height:1.3; color:var(--text-muted); margin-top:.125rem; overflow-wrap:anywhere; }

/* ── 5 · Buttons + row actions ──────────────────────────────────────────── */
.um-actions{ display:flex; gap:.3125rem; justify-content:flex-end; align-items:center; }
.um-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:.3125rem;
  height:1.6875rem; min-height:var(--ctl-floor); padding:0 .5625rem;
  border:none; border-radius:var(--radius);
  font-family:var(--font-sans); font-size:max(.6875rem, var(--fs-floor)); font-weight:600; line-height:1;
  white-space:nowrap; cursor:pointer;
  color:var(--text-secondary); background:var(--bg-elevated);
  box-shadow:inset 0 0 0 1px var(--border-default);
  transition:color .12s,background-color .12s,box-shadow .12s;
}
.um-btn:hover:not(:disabled){ color:var(--text-primary); background:var(--bg-tertiary); box-shadow:inset 0 0 0 1px var(--border-strong); }
.um-btn:disabled{ opacity:.35; cursor:not-allowed; }
/* Destructive controls read destructive AT REST — garnet ink on a garnet
   wash — instead of only revealing it on hover, so Delete / Purge / Reap can
   never be mistaken for the neutral button next to them. Hover inverts to a
   solid garnet fill, i.e. the danger gets LOUDER as the cursor lands. */
.um-btn-danger{
  color:var(--red);
  background:var(--red-dim);
  box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--red) 28%, transparent);
}
.um-btn-danger:hover:not(:disabled){
  color:var(--on-accent-bright); background:var(--red);
  box-shadow:inset 0 0 0 1px var(--red);
}
.um-btn-grant{ color:var(--accent); background:var(--accent-dim); box-shadow:inset 0 0 0 1px var(--accent-glow); }
.um-btn-grant:hover:not(:disabled){ color:var(--on-accent); background:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); }
/* Filter toggle active state — teal ring + tinted background */
.um-filter-toggle{ transition:color .12s,background-color .12s,box-shadow .12s; }
.um-filter-active{ color:var(--accent); background:var(--accent-dim); box-shadow:inset 0 0 0 1px var(--accent-glow); }
.um-filter-active:hover:not(:disabled){ background:var(--accent-dim); color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); }
/* Account type segmented control (Users / Bots / All). One inset ring around
   the group, the active segment is a FILLED background (no underline, no
   stripe). */
.um-seg{
  display:inline-flex; align-items:center; gap:.125rem; height:1.875rem; padding:.1875rem;
  box-sizing:border-box; border-radius:var(--radius);
  background:var(--bg-elevated); box-shadow:inset 0 0 0 1px var(--border-default);
}
.um-seg-btn{
  height:100%; min-height:0; padding:0 .625rem; border:none; border-radius:calc(var(--radius) - 2px);
  font-family:var(--font-sans); font-size:max(.6875rem, var(--fs-floor)); font-weight:600; line-height:1;
  color:var(--text-muted); background:transparent; cursor:pointer;
  transition:color .12s,background-color .12s;
}
.um-seg-btn:hover{ color:var(--text-primary); background:var(--bg-tertiary); }
.um-seg-btn[aria-pressed="true"],
.um-seg-btn[aria-pressed="true"]:hover{ color:var(--accent); background:var(--accent-dim); }
.um-seg-btn:focus-visible{ outline:none; box-shadow:inset 0 0 0 1px var(--accent); }

.um-act-revoke::before,.um-act-reset::before,.um-act-del::before,
.st-act-toggle::before,.st-act-purge::before,
#st-reap::before,.um-modal .um-btn-danger::before{
  content:''; width:.75rem; height:.75rem; flex:none;
  background-color:currentColor;
  -webkit-mask:var(--adm-ic) center / contain no-repeat;
          mask:var(--adm-ic) center / contain no-repeat;
}
.um-act-del::before,.st-act-purge::before,
#st-reap::before,.um-modal .um-btn-danger::before{ --adm-ic:var(--adm-ic-trash); }
.um-act-reset::before{ --adm-ic:var(--adm-ic-key); }
.um-act-revoke::before{ --adm-ic:var(--adm-ic-revoke); }
.st-act-toggle[data-to="paused"]::before{ --adm-ic:var(--adm-ic-pause); }
.st-act-toggle[data-to="active"]::before{ --adm-ic:var(--adm-ic-play); }

/* ── 6 · Empty + first-load states ──────────────────────────────────────── */
.um-empty{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:.3125rem; padding:3rem 1.5rem; text-align:center;
  border-radius:0 0 var(--radius-lg) var(--radius-lg);
}
/* display:flex above would otherwise beat the UA's [hidden]{display:none}. */
.um-empty[hidden]{ display:none; }
.um-empty b{ font-family:var(--font-sans); font-size:.8125rem; font-weight:600; color:var(--text-secondary); }
.um-empty span{ font-size:max(.6875rem, var(--fs-floor)); color:var(--text-muted); max-width:24rem; line-height:1.55; }
/* First paint: show the SHAPE of the table rather than a blank slab. The class
   is dropped in the `finally` of load(), so a failed fetch can't leave the
   page shimmering forever. */
.um-board.is-loading > #um-rows,
.um-board.is-loading > #st-rows{
  position:relative; overflow:hidden;
  height:calc(var(--adm-row-h) * 8);
  border-radius:0 0 var(--radius-lg) var(--radius-lg);
  background:repeating-linear-gradient(to bottom,
    transparent 0, transparent calc(var(--adm-row-h) - 1px),
    var(--border-subtle) calc(var(--adm-row-h) - 1px), var(--border-subtle) var(--adm-row-h));
}
.um-board.is-loading > #um-rows::after,
.um-board.is-loading > #st-rows::after{
  content:''; position:absolute; inset:0;
  background:linear-gradient(90deg, transparent, color-mix(in srgb, var(--text-primary) 6%, transparent), transparent);
  animation:adm-skel 1.15s linear infinite;
}
@keyframes adm-skel{ from{transform:translateX(-100%);} to{transform:translateX(100%);} }

/* ── 7 · Toast / billing alert / dialogs ────────────────────────────────── */
.um-toast{ position:fixed; bottom:24px; left:50%; transform:translateX(-50%) translateY(20px); opacity:0; pointer-events:none; background:var(--bg-elevated); color:var(--text-primary); padding:10px 18px; border-radius:var(--radius); box-shadow:var(--shadow-rail),inset 0 0 0 1px var(--border-strong); font-size:.8rem; transition:opacity .2s,transform .2s; z-index:50; }
.um-toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }
.um-toast.err{ box-shadow:var(--shadow-rail),inset 0 0 0 1px var(--red); }

/* Billing alert: a styled, dismissable heads-up (e.g. demoting a payer). */
.um-alert{ position:fixed; bottom:24px; left:50%; transform:translateX(-50%) translateY(20px); opacity:0; pointer-events:none; display:flex; align-items:flex-start; gap:.7rem; width:min(30rem,calc(100vw - 2rem)); padding:.9rem 1rem; background:var(--bg-elevated); color:var(--text-primary); border-radius:var(--radius-lg); box-shadow:var(--shadow-modal), inset 0 0 0 1px var(--champagne-ring); font-size:.8rem; line-height:1.5; transition:opacity .22s var(--ease-out),transform .22s var(--ease-out); z-index:60; }
.um-alert.show{ opacity:1; transform:translateX(-50%) translateY(0); pointer-events:auto; }
.um-alert-icon{ color:var(--amber); flex-shrink:0; margin-top:1px; }
.um-alert-msg{ flex:1; }
.um-alert-ok{ flex-shrink:0; align-self:flex-start; background:var(--bg-tertiary); color:var(--text-secondary); border:none; box-shadow:inset 0 0 0 1px var(--border-default); border-radius:var(--radius); padding:5px 12px; font-family:var(--font-sans); font-size:.72rem; font-weight:600; cursor:pointer; transition:color .12s,background-color .12s; }
.um-alert-ok:hover{ color:var(--text-primary); background:var(--bg-hover); }

.um-modal-back{ position:fixed; inset:0; background:var(--scrim-sheet); display:none; align-items:center; justify-content:center; padding:1.5rem; z-index:60; }
.um-modal-back.show{ display:flex; }
.um-modal{ background:var(--bg-secondary); border-radius:var(--radius-lg); box-shadow:var(--shadow-modal),inset 0 0 0 1px var(--border-strong); padding:1.125rem 1.25rem 1.25rem; width:min(28rem,92vw); }
.um-modal-head{ display:flex; align-items:center; gap:.5rem; margin-bottom:.5rem; }
.um-modal-ic{ display:inline-flex; flex:none; color:var(--red); }
.um-modal h3{ margin:0; font-family:var(--font-sans); font-size:.875rem; font-weight:700; letter-spacing:0; }
.um-modal p{ margin:0 0 1.125rem; font-size:.75rem; color:var(--text-secondary); line-height:1.55; }
.um-modal-actions{ display:flex; gap:.5rem; justify-content:flex-end; }
.um-modal-actions .um-btn{ height:1.875rem; padding:0 .875rem; }
/* Inside a confirm dialog the destructive choice is a SOLID garnet button, so
   it can never be mistaken for the safe default. Cancel stays neutral, and
   users.js / stocks.js put focus on it when the dialog opens. */
.um-modal .um-btn-danger{ color:var(--on-accent-bright); background:var(--red); box-shadow:inset 0 0 0 1px var(--red); }
.um-modal .um-btn-danger:hover:not(:disabled){ color:var(--on-accent-bright); background:var(--red); filter:brightness(1.12); }
.um-modal .um-btn-grant{ color:var(--on-accent); background:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); }

/* ── 8 · Tracked-stocks console (/watchlist/stocks) ─────────────────────── */
.st-stock{ display:flex; align-items:center; gap:.5rem; min-width:0; }
.st-logo{ width:1.5rem; height:1.5rem; border-radius:.3125rem; object-fit:cover; background:var(--logo-plate); box-shadow:inset 0 0 0 1px var(--border-strong); flex-shrink:0; }
.st-logo-fb{ width:1.5rem; height:1.5rem; border-radius:.3125rem; display:grid; place-items:center; background:var(--bg-elevated); color:var(--champagne); font-weight:700; font-size:max(.625rem, var(--fs-floor)); flex-shrink:0; box-shadow:inset 0 0 0 1px var(--border-strong); }
.st-sym-wrap{ display:flex; flex-direction:column; min-width:0; }
.st-sym{ font-family:var(--font-mono); font-weight:700; font-size:.75rem; line-height:1.3; }
.st-name{ font-size:max(.625rem, var(--fs-floor)); line-height:1.3; color:var(--text-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.st-status{ display:inline-flex; align-items:center; gap:.375rem; font-size:max(.5625rem, var(--fs-floor)); font-weight:700; letter-spacing:normal; text-transform:none; padding:.125rem .5rem; border-radius:999px; }
.st-status::before{ content:''; width:.3125rem; height:.3125rem; border-radius:50%; background:currentColor; flex-shrink:0; }
.st-status-active{ color:var(--accent); background:var(--accent-dim); box-shadow:inset 0 0 0 1px var(--accent-glow); }
.st-status-paused{ color:var(--rank-squire); background:color-mix(in srgb, var(--rank-squire) 12%, transparent); box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--rank-squire) 22%, transparent); }
.st-status-backfilling{ color:var(--champagne); background:var(--champagne-dim); box-shadow:inset 0 0 0 1px var(--champagne-ring); }
.st-watchers{ display:flex; flex-wrap:wrap; gap:.25rem; align-items:center; }
.st-chip{ display:inline-flex; align-items:center; gap:.3125rem; font-size:max(.625rem, var(--fs-floor)); padding:.0625rem .4375rem .0625rem .125rem; border-radius:999px; background:var(--bg-elevated); box-shadow:inset 0 0 0 1px var(--border-default); color:var(--text-secondary); max-width:9.5rem; }
.st-chip-dot{ width:.9375rem; height:.9375rem; border-radius:50%; display:grid; place-items:center; font-size:max(.5rem, var(--fs-floor)); font-weight:800; flex-shrink:0; }
.st-chip-name{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.st-none{ font-size:max(.6875rem, var(--fs-floor)); color:var(--text-muted); }

/* ── 9 · Narrow widths — drop columns, never scroll sideways ─────────────
   A horizontal scroller would become the sticky scrollport and unpin the
   header, so the low-value columns are hidden instead. Each breakpoint hides
   the cell AND restates --adm-cols in the same rule, which is what keeps the
   header strip and the body rows in lockstep.

   TRAP: `display:none` takes a cell out of the grid ENTIRELY, so the survivors
   re-flow into tracks 1..n. The template must therefore list ONLY the tracks
   that are still there, in order — never a placeholder 0 for the hidden one,
   which silently shifts every column right of it into the wrong slot.
   Users order:  1 User · 2 Email · 3 Rank · 4 Joined · 5 Last seen · 6 Watching · 7 Actions
   Stocks order: 1 Stock · 2 Status · 3 Watchers · 4 Tweets · 5 Added · 6 Actions */
@media (max-width:1180px){
  /* drop "Last seen" / "Added" */
  .adm-page:not(.st-page){ --adm-cols:2.5fr 2.1fr 1.45fr .95fr .62fr 1.6fr; }
  .adm-page:not(.st-page) .um-row > :nth-child(5){ display:none; }
  .adm-page.st-page{ --adm-cols:1.8fr .95fr 2.6fr .62fr 1.35fr; }
  .adm-page.st-page .um-row > :nth-child(5){ display:none; }
}
@media (max-width:1040px){
  /* also drop "Joined" / "Tweets" */
  .adm-page:not(.st-page){ --adm-cols:2.5fr 2.1fr 1.45fr .62fr 1.6fr; }
  .adm-page:not(.st-page) .um-row > :nth-child(4){ display:none; }
  .adm-page.st-page{ --adm-cols:1.8fr .95fr 2.6fr 1.35fr; }
  .adm-page.st-page .um-row > :nth-child(4){ display:none; }
}
@media (max-width:900px){
  /* also drop "Watching" */
  .adm-page:not(.st-page){ --adm-cols:2.5fr 2.1fr 1.5fr 1.7fr; }
  .adm-page:not(.st-page) .um-row > :nth-child(6){ display:none; }
}
@media (max-width:780px){
  /* also drop "Email" — the @handle under the name still identifies the row */
  .adm-page:not(.st-page){ --adm-cols:2.6fr 1.5fr 1.8fr; }
  .adm-page:not(.st-page) .um-row > :nth-child(2){ display:none; }
  /* stocks: drop "Status" — the Pause/Resume button already states it */
  .adm-page.st-page{ --adm-cols:1.8fr 2.4fr 1.35fr; }
  .adm-page.st-page .um-row > :nth-child(2){ display:none; }
}
@media (max-width:560px){
  /* The toolbar deliberately NEVER wraps: --adm-bar-h is what the column
     header pins against, so a bar that grew a second line would leave the
     header floating with a gap under it. Room is bought by dropping the count
     (the table states it anyway) and letting the search field shrink, not by
     wrapping. */
  .adm-page .um-count{ display:none; }
  .adm-search{ min-width:4rem; }
}

/* ── Username onboarding (/watchlist/welcome) ── */
.wel-page{ min-height:100vh; display:grid; place-items:center; background:var(--bg-primary); color:var(--text-primary); font-family:var(--font-sans); padding:24px; }
.wel-card{ width:min(440px,100%); background:var(--bg-secondary); border-radius:var(--radius-lg); box-shadow:var(--shadow-modal), inset 0 0 0 1px var(--border-default); padding:32px; }
/* QA 2026-11-13: 94vw plus the page's 24px padding ran 2px past a 360 wide
   phone and sat off centre (24px left, none right). The card now fills the
   padded page; on a phone both paddings tighten so the form keeps room. */
@media (max-width:480px){ .wel-page{ padding:16px; } .wel-card{ padding:24px 20px; } }
.wel-crest{ color:var(--champagne); display:flex; justify-content:center; margin-bottom:14px; }
.wel-title{ font-family:var(--font-display); font-weight:700; font-size:1.4rem; letter-spacing:var(--tr-heading); text-align:center; margin:0 0 6px; }
.wel-sub{ font-size:.82rem; color:var(--text-secondary); text-align:center; margin:0 0 22px; line-height:1.5; }
.wel-field{ position:relative; }
.wel-at{ position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--text-muted); font-size:.9rem; pointer-events:none; }
.wel-input{ width:100%; box-sizing:border-box; padding:11px 12px 11px 26px; background:var(--bg-tertiary); color:var(--text-primary); border:none; box-shadow:inset 0 0 0 1px var(--border-default); border-radius:var(--radius); font-size:.95rem; font-family:var(--font-mono); }
.wel-input:focus{ outline:none; box-shadow:inset 0 0 0 1px var(--accent); }
.wel-input.is-good{ box-shadow:inset 0 0 0 1px var(--accent); }
.wel-input.is-bad{ box-shadow:inset 0 0 0 1px var(--red); }
.wel-status{ min-height:18px; margin:8px 2px 0; font-size:.74rem; }
.wel-status.ok{ color:var(--accent); }
.wel-status.bad{ color:var(--red); }
.wel-status.muted{ color:var(--text-muted); }
.wel-btn{ width:100%; margin-top:18px; padding:11px; border:none; border-radius:var(--radius); background:var(--accent); color:var(--on-accent); font-weight:800; font-size:.9rem; cursor:pointer; transition:opacity .15s, background-color .15s; }
.wel-btn:disabled{ opacity:.4; cursor:not-allowed; }
.wel-hint{ margin-top:14px; font-size:max(.68rem, var(--fs-floor)); color:var(--text-muted); text-align:center; }
.wel-consent{ display:flex; align-items:flex-start; gap:9px; margin-top:18px; cursor:pointer; }
.wel-consent-box{ flex:0 0 auto; width:16px; height:16px; margin-top:1px; accent-color:var(--accent); cursor:pointer; }
.wel-consent-text{ font-size:.78rem; color:var(--text-secondary); line-height:1.45; }
.wel-consent-text a{ color:var(--accent); text-decoration:none; }
.wel-consent-text a:hover{ text-decoration:underline; }

/* ── Billing upgrade confirmation toast ── */
.billing-upgrade-toast{
  position:fixed; bottom:24px; left:50%; transform:translateX(-50%) translateY(16px);
  opacity:0; pointer-events:none;
  background:var(--accent-dim); color:var(--accent);
  padding:10px 20px; border-radius:var(--radius);
  box-shadow:var(--shadow-rail),inset 0 0 0 1px var(--accent-glow);
  font-size:.82rem; font-weight:600;
  transition:opacity .25s,transform .25s; z-index:100;
}
.billing-upgrade-toast.billing-upgrade-toast-in{
  opacity:1; transform:translateX(-50%) translateY(0);
}

/* ── A11y: visible focus + readable muted text for the perms/admin UI ── */
.um-rank-sel:focus-visible,
.um-btn:focus-visible{ outline:none; box-shadow:inset 0 0 0 1px var(--accent); }
.adm-page .um-search:focus-visible,
.um-field:focus-visible{ outline:none; box-shadow:inset 0 0 0 1px var(--accent); }
.adm-page .um-back:focus-visible{ outline:1px solid var(--accent); outline-offset:-1px; }
/* Lift muted text so it clears 4.5:1 on the dark table rows (was #6b7c93). */
.um-head, .um-count, .um-cell-muted, .um-handle, .um-empty{ color:var(--text-secondary); }
.um-search::placeholder{ color:var(--text-secondary); opacity:1; }
@media (prefers-reduced-motion: reduce){
  /* .account-menu dropped: the account panel is MPMenu now and owns its own
     prefers-reduced-motion block in css/lib/menu.css. */
  .um-toast, .um-row, .um-btn, .um-seg-btn, .um-back, .account-caret{ transition:none; }
  .um-board.is-loading > #um-rows::after,
  .um-board.is-loading > #st-rows::after{ animation:none; }
}
