/* Glympsr. Graphite console that plays: panels split by hairline seams, colour that people and media types own.
   Theme: data-theme on <html> (light | dark; none = the device's). Palettes: data-light (paper | bubblegum) and
   data-dark (graphite | midnight), set by js/early.js. Every colour is a pair, light-dark(light, dark): a palette
   swaps one half, so Auto keeps following the device whichever two palettes are picked. */

@font-face { font-family: 'Atkinson Next'; src: url('../fonts/atkinson-hyperlegible-next/AtkinsonHyperlegibleNext-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Atkinson Next'; src: url('../fonts/atkinson-hyperlegible-next/AtkinsonHyperlegibleNext-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Atkinson Next'; src: url('../fonts/atkinson-hyperlegible-next/AtkinsonHyperlegibleNext-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Gabarito'; src: url('../fonts/gabarito/Gabarito-latin.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }

[hidden] { display: none !important; }

:root {
  color-scheme: light dark;

  /* Paper (light) */
  --L-ground: #f4f5f8; --L-panel: #ffffff; --L-raise: #eceef4; --L-seam: #d6d8e1;
  --L-text: #16161c;   --L-muted: #555766;  --L-accent: #5b2ee0; --L-on-accent: #ffffff;
  --L-danger: #b3261e; --L-ok: #1b6b3a;
  --L-book: #b04500;   --L-film: #c0175d;   --L-tv: #0b5fbf;     --L-game: #2a762e; --L-now: #765500;

  /* Graphite (dark) */
  --D-ground: #121214; --D-panel: #1a1a1f;  --D-raise: #24242b;  --D-seam: #313039;
  --D-text: #ecebf3;   --D-muted: #a5a4b1;  --D-accent: #b79cff; --D-on-accent: #170f30;
  --D-danger: #ff8a80; --D-ok: #7ee0a0;
  --D-book: #ffab5e;   --D-film: #ff6f9f;   --D-tv: #6cb8ff;     --D-game: #86e07c; --D-now: #ffd84d;

  --ground:    light-dark(var(--L-ground), var(--D-ground));
  --panel:     light-dark(var(--L-panel), var(--D-panel));
  --raise:     light-dark(var(--L-raise), var(--D-raise));
  --seam:      light-dark(var(--L-seam), var(--D-seam));
  --text:      light-dark(var(--L-text), var(--D-text));
  --muted:     light-dark(var(--L-muted), var(--D-muted));
  --accent:    light-dark(var(--L-accent), var(--D-accent));
  --on-accent: light-dark(var(--L-on-accent), var(--D-on-accent));
  --danger:    light-dark(var(--L-danger), var(--D-danger));
  --ok:        light-dark(var(--L-ok), var(--D-ok));
  /* Media types own a hue each; --now means "consuming now" and nothing else. */
  --book: light-dark(var(--L-book), var(--D-book));
  --film: light-dark(var(--L-film), var(--D-film));
  --tv:   light-dark(var(--L-tv), var(--D-tv));
  --game: light-dark(var(--L-game), var(--D-game));
  --now:  light-dark(var(--L-now), var(--D-now));

  --radius: 6px;
  --font: 'Atkinson Next', system-ui, sans-serif;
  --display: 'Gabarito', 'Atkinson Next', system-ui, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-light="bubblegum"] {
  --L-ground: #fff0f6; --L-panel: #ffffff; --L-raise: #ffe2ee; --L-seam: #f1bdd4;
  --L-text: #2a0f1f;   --L-muted: #7a3c5d; --L-accent: #b0145a; --L-on-accent: #ffffff;
  --L-book: #a64200;   --L-film: #7b1fa2; --L-tv: #0b5fbf; --L-game: #22722e; --L-now: #765500;
}
/* Calm (from receipts): soft blues, sage and warm neutrals for eyes that tire of bright white. Every pair AA or better. */
:root[data-light="calm"] {
  --L-ground: #f2eee6; --L-panel: #fbf8f2; --L-raise: #ece6da; --L-seam: #d2c8b6;
  --L-text: #1e2a2f;   --L-muted: #54595a; --L-accent: #1e6078; --L-on-accent: #ffffff;
  --L-danger: #a3261e; --L-ok: #22502f;
  --L-book: #8a5a00;   --L-film: #a3305a; --L-tv: #1f5f99; --L-game: #2e7a3c; --L-now: #7a4a06;
}
:root[data-dark="midnight"] {
  --D-ground: #0c0f2e; --D-panel: #13174a; --D-raise: #1c2160; --D-seam: #2c3277;
  --D-text: #eef0ff;   --D-muted: #b0b5e2; --D-accent: #ff7ac8; --D-on-accent: #2a0420;
  --D-book: #ffb35c;   --D-film: #ff9a8a; --D-tv: #7cc7ff; --D-game: #8ff0a4; --D-now: #ffe066;
}
:root[data-dark="matrix"] {
  --D-ground: #000000; --D-panel: #030b03; --D-raise: #071a07; --D-seam: #0d3b12;
  --D-text: #00ff41;   --D-muted: #00b82e; --D-accent: #39ff14; --D-on-accent: #001a00;
  --D-danger: #ff5c5c; --D-ok: #7dff9e;
  --D-book: #d4ff3a;   --D-film: #5cffd0; --D-tv: #3affff; --D-game: #a6ff6b; --D-now: #f2ff7a;
}
/* Matrix is monospaced, in dark only (a device's light palette keeps the usual type). */
@media (prefers-color-scheme: dark) { :root[data-dark="matrix"]:not([data-theme="light"]) { --font: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; --display: var(--font); } }
:root[data-dark="matrix"][data-theme="dark"] { --font: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; --display: var(--font); }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }

/* A person's ink: theirs wherever they appear (profiles.ink). */
.ink-coral  { --ink: light-dark(#c2410c, #ff8a65); }
.ink-mango  { --ink: light-dark(#9a5b00, #ffc14d); }
.ink-lime   { --ink: light-dark(#4d7c0f, #b5e655); }
.ink-teal   { --ink: light-dark(#0f766e, #5eead4); }
.ink-sky    { --ink: light-dark(#0369a1, #7dd3fc); }
.ink-violet { --ink: light-dark(#6d28d9, #c4b5fd); }
.ink-pink   { --ink: light-dark(#be185d, #f9a8d4); }
/* Tiers only (TIER_INK_ORDER, inc/tiers.php): so ten tiers can each have their own. */
.ink-cherry { --ink: light-dark(#b91c1c, #fca5a5); }
.ink-ocean  { --ink: light-dark(#1d4ed8, #93c5fd); }
.ink-berry  { --ink: light-dark(#a21caf, #f0abfc); }

/* ── base ───────────────────────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ground); color: var(--text); font: 400 1rem/1.5 var(--font); -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--seam) var(--ground); caret-color: var(--accent); accent-color: var(--accent); }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; }
::selection { background: var(--accent); color: var(--on-accent); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 1.125rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
img { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 10; background: var(--panel); padding: 0.5rem 0.75rem;
  border: 1px solid var(--seam); border-radius: var(--radius); }
.skip:focus { top: 1rem; }
.num { font-variant-numeric: tabular-nums; }

main { flex: 1; width: 100%; }

/* ── controls ──────────────────────────────────────────────────────────────────────────────── */

button, .button { font: 600 0.9375rem/1 var(--font); border-radius: var(--radius); padding: 0.75rem 1rem; min-height: 2.75rem;
  cursor: pointer; border: 1px solid var(--seam); background: var(--panel); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; text-decoration: none;
  transition: background-color 120ms, border-color 120ms, transform 120ms var(--ease-out); }
button:hover, .button:hover { border-color: var(--muted); }
button:active, .button:active { transform: translateY(1px); }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.primary:hover:not([aria-disabled="true"], :disabled) { background: color-mix(in oklab, var(--accent) 88%, var(--text)); }
button[aria-disabled="true"], button:disabled { background: var(--raise); border-color: var(--seam); color: var(--muted); cursor: not-allowed; transform: none; }
button.link { background: none; border: 0; padding: 0.25rem 0; min-height: 1.5rem; color: var(--accent); font-weight: 400;
  text-decoration: underline; text-underline-offset: 0.18em; }
button.danger { color: var(--danger); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

.field { display: grid; gap: 0.375rem; grid-template-columns: minmax(0, 1fr); }
label { font-weight: 600; font-size: 0.9375rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="url"] {
  font: inherit; color: var(--text); background: var(--raise); border: 1px solid color-mix(in oklab, var(--muted) 65%, var(--seam)); border-radius: var(--radius);
  padding: 0.6875rem 0.75rem; min-height: 2.75rem; width: 100%; }
input::placeholder { color: var(--muted); }
input:hover { border-color: var(--muted); }
input:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); border-radius: var(--radius); }
input[aria-invalid="true"] { border-color: var(--danger); }
.field-err, .error { color: var(--danger); font-size: 0.9375rem; }
.hint { color: var(--muted); font-size: 0.875rem; }
.stack { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }   /* never wider than its container */
.flash { margin: 1rem auto 0; max-width: 72rem; padding: 0.75rem 1rem; border: 1px solid var(--seam); border-radius: var(--radius);
  background: var(--panel); width: calc(100% - 2rem); }

.pw-rules { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.25rem; font-size: 0.875rem; color: var(--muted); }
.pw-rules li { display: flex; gap: 0.5rem; align-items: center; }
.pw-rules .i-met { display: none; color: var(--ok); }
.pw-rules li.met { color: var(--text); }
.pw-rules li.met .i-met { display: inline; }
.pw-rules li.met .i-todo { display: none; }
wa-icon { font-size: 1em; flex: none; }

/* Choice cards: native radios, the whole card the label. */
.choices { display: flex; flex-wrap: wrap; gap: 0.5rem; border: 0; padding: 0; margin: 0; }
.choices legend { font-weight: 600; font-size: 0.9375rem; margin-bottom: 0.5rem; padding: 0; }
.choice { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.625rem 0.875rem; border: 1px solid var(--seam);
  border-radius: var(--radius); background: var(--raise); cursor: pointer; font-weight: 600; }
.choice:has(input:checked) { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 14%, var(--panel)); }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
/* A row of checkboxes past about two lines scrolls in place, the third line cut short to show there's more. Long lists
   with a filter (long_list(), [data-long] below) keep their own height. Padding keeps the focus ring inside. */
div.choices:not([data-long]):has(> .choice > input[type="checkbox"]) { max-height: 7.75rem; overflow-y: auto; overscroll-behavior: contain; padding: 0.25rem; margin: -0.25rem; }
.ink-dot { width: 0.875rem; height: 0.875rem; border-radius: 50%; background: var(--ink); }
.swatches { display: inline-flex; }
.swatches i { width: 0.875rem; height: 0.875rem; border-radius: 50%; border: 2px solid var(--panel); margin-left: -0.25rem; }
.swatches i:first-child { margin-left: 0; }
.sw-paper i:nth-child(1) { background: #f4f5f8; } .sw-paper i:nth-child(2) { background: #5b2ee0; }
.sw-paper i:nth-child(3) { background: #c0175d; } .sw-paper i:nth-child(4) { background: #0b5fbf; }
.sw-bubblegum i:nth-child(1) { background: #fff0f6; } .sw-bubblegum i:nth-child(2) { background: #b0145a; }
.sw-bubblegum i:nth-child(3) { background: #7b1fa2; } .sw-bubblegum i:nth-child(4) { background: #f1bdd4; }
.sw-graphite i:nth-child(1) { background: #121214; } .sw-graphite i:nth-child(2) { background: #b79cff; }
.sw-graphite i:nth-child(3) { background: #ff6f9f; } .sw-graphite i:nth-child(4) { background: #86e07c; }
.sw-midnight i:nth-child(1) { background: #0c0f2e; } .sw-midnight i:nth-child(2) { background: #ff7ac8; }
.sw-midnight i:nth-child(3) { background: #7cc7ff; } .sw-midnight i:nth-child(4) { background: #ffe066; }

/* ── wordmark ──────────────────────────────────────────────────────────────────────────────── */

.wordmark { font-family: var(--display); font-weight: 900; letter-spacing: -0.04em; line-height: 0.9; display: inline-flex; }
.wordmark span { display: inline-block; }
.wordmark.small { font-size: 1.5rem; color: var(--text); }
.wordmark.small span:nth-child(3) { color: var(--accent); }
.wordmark.big { font-size: clamp(3.5rem, 2rem + 7vw, 6rem); }
.wordmark.big span:nth-child(7n+1) { color: var(--book); }
.wordmark.big span:nth-child(7n+2) { color: var(--film); }
.wordmark.big span:nth-child(7n+3) { color: var(--accent); }
.wordmark.big span:nth-child(7n+4) { color: var(--tv); }
.wordmark.big span:nth-child(7n+5) { color: var(--game); }
.wordmark.big span:nth-child(7n+6) { color: var(--now); }
.wordmark.big span:nth-child(7n+7) { color: var(--text); }
@media (prefers-reduced-motion: no-preference) {
  .wordmark.big span { animation: rise 900ms var(--ease-out) both; }
  .wordmark.big span:nth-child(2) { animation-delay: 50ms; }
  .wordmark.big span:nth-child(3) { animation-delay: 100ms; }
  .wordmark.big span:nth-child(4) { animation-delay: 150ms; }
  .wordmark.big span:nth-child(5) { animation-delay: 200ms; }
  .wordmark.big span:nth-child(6) { animation-delay: 250ms; }
  .wordmark.big span:nth-child(7) { animation-delay: 300ms; }
  /* A glance: the y blinks once, a beat after the letters land. */
  .wordmark.big span:nth-child(3) { animation: rise 900ms var(--ease-out) 100ms both, blink 260ms ease-in-out 1.6s 1; transform-origin: 50% 60%; }
}
@keyframes rise { from { transform: translateY(0.35em); } }
@keyframes blink { 50% { transform: scaleY(0.1); } }

/* ── gate (signed out) ─────────────────────────────────────────────────────────────────────── */

.gate main { display: grid; place-items: center; grid-template-columns: minmax(0, 1fr); padding: 1.5rem 1rem; }
.gate-grid { display: grid; gap: 2.5rem; width: min(60rem, 100%); align-items: center; grid-template-columns: 1fr; }
@media (min-width: 52rem) { .gate-grid { grid-template-columns: 1.1fr 1fr; gap: 4rem; } }
.gate-panel { background: var(--panel); border: 1px solid var(--seam); border-radius: calc(var(--radius) * 2); }
.gate-panel > * { padding: 1.5rem; }
.gate-panel > * + * { border-top: 1px solid var(--seam); }
.gate-panel h1 { font-size: 1.5rem; }
.gate-panel .alt { display: grid; gap: 0.75rem; }
.gate-panel .alt button { width: 100%; }
.gate-panel .primary { width: 100%; }
.gate-note { color: var(--muted); font-size: 0.875rem; }

/* The teaser (inc/teaser.php): a still of the signed-in home under the wordmark. Drawn on a 60em canvas whose em is
   a slice of its own width, so it scales as one picture; below 26rem it becomes the phone's one column. */
.gate-show { display: grid; justify-items: start; container: gate-show / inline-size; }   /* spacing as margins, so a fold shrinks to nothing */
.teaser { display: block; width: 100%; aspect-ratio: 16 / 11; container: teaser / inline-size; overflow: hidden; background: var(--ground);
  border: 1px solid var(--seam); border-radius: calc(var(--radius) * 2); user-select: none; color: var(--text); text-decoration: none; }
.gate-panel #sign-in { scroll-margin-top: 1rem; }
/* Phones: sign-in sits below the teaser, so its panel beckons until you start on it; reduced motion keeps the ring still. */
@media (width < 52rem) {
  .gate-panel { border-color: var(--accent); }
  @media (prefers-reduced-motion: no-preference) {
    html:has(.gate-show) { scroll-behavior: smooth; }
    .gate-panel { animation: beckon 2.4s ease-in-out 3s infinite; }
    .gate-panel:focus-within { animation: none; }
  }
}
@keyframes beckon { 50% { box-shadow: 0 0 0 0.375rem color-mix(in oklab, var(--accent) 35%, transparent); } }
@container gate-show (width < 26rem) { .teaser { aspect-ratio: 2 / 3; } }   /* tall enough that sign-in just peeks below */
/* The phrase: under the teaser on a wide screen. On a phone it waits, and takes the teaser's place once sign-in is on
   screen (js/gate.js adds .is-folded and moves things with transforms, so the layout changes in one step, never mid-scroll). */
.tz-fold { width: 100%; margin-top: 2rem; }
.gate-tag { margin-top: 2rem; font: 700 clamp(1.0625rem, 0.9rem + 0.6vw, 1.375rem)/1.3 var(--display); letter-spacing: -0.01em; color: var(--muted); }
@media (width < 52rem) {
  .gate-show:not(.is-folded) .gate-tag { display: none; }
  .gate-show.is-folded .tz-fold { display: none; }
  .gate-show.is-folded .gate-tag { margin-top: 1rem; }
  /* The wordmark holds the top while you scroll down to sign in and the teaser folds away under it. */
  .gate-show > .wordmark { position: sticky; top: 0; z-index: 1; width: calc(100% + 2rem); margin: -0.75rem -1rem; padding: 0.75rem 1rem;
    background: var(--ground); }
}
@keyframes tag-in { from { opacity: 0; translate: 0 0.5rem; } }
.tz-screen { font-size: calc(100cqi / 60); height: 100%; display: grid; grid-template-rows: auto auto 1fr; line-height: 1.25; }
.tz-screen b, .tz-screen i { font-style: normal; }
.tz-bar { display: flex; align-items: center; gap: 1.25em; padding: 0.9em 1.25em; border-bottom: 1px solid var(--seam); }
.tz-bar .wordmark { font-size: 1.6em; }
.tz-nav { display: flex; gap: 0.25em; font-size: 0.9em; color: var(--muted); font-weight: 600; }
.tz-nav > * { padding: 0.4em 0.75em; border-radius: 0.4em; }
.tz-nav b { background: var(--raise); color: var(--text); }
.tz-add { margin-left: auto; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 0.85em; padding: 0.5em 1em; border-radius: 999px; }
.tz-me { display: grid; place-items: center; width: 2em; height: 2em; border-radius: 50%; background: var(--raise); border: 1px solid var(--seam);
  font: 900 1.2em/1 var(--display); color: var(--book); padding-bottom: 0.15em; }   /* you: the wordmark's own g */
.tz-tabs { display: none; }
.tz-console { display: grid; grid-template-columns: 14em 1fr 13em; gap: 1px; background: var(--seam); min-height: 0; overflow: hidden; }
.tz-panel { background: var(--ground); padding: 1.25em 1.1em; display: grid; gap: 0.9em; align-content: start; min-height: 0; overflow: hidden; }
.tz-panel.tz-wall { background: var(--panel); gap: 0; }
.tz-label { font: 800 0.75em/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tz-wall .tz-label { margin-bottom: 0.9em; }
.tz-cover { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 0.3em; background: var(--raise); }
.tz-shelf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9em 0.75em; }
.tz-now { display: grid; gap: 0.3em; align-content: start; }
.tz-now b { font-size: 0.85em; font-weight: 600; }
.tz-now i { font-size: 0.75em; color: var(--muted); }
.tz-card { display: grid; grid-template-columns: 4.25em 1fr; gap: 1em; padding: 0.9em 0; border-top: 1px solid var(--seam); }
.tz-body { display: grid; gap: 0.35em; align-content: start; min-width: 0; }
.tz-who { display: flex; align-items: center; gap: 0.4em; font-size: 0.8em; color: var(--muted); }
.tz-who b { color: var(--ink); font-weight: 700; }
.tz-avatar { display: grid; place-items: center; width: 1.9em; height: 1.9em; border-radius: 50%; font: 800 0.8em/1 var(--display);
  color: var(--ink); background: color-mix(in oklab, var(--ink) 18%, var(--panel)); border: 1px solid color-mix(in oklab, var(--ink) 60%, transparent); }
.tz-title { font: 700 1.15em/1.15 var(--display); color: var(--text); }
.tz-line { display: flex; align-items: center; gap: 0.4em; font-size: 0.78em; color: var(--muted); }
.tz-line .type-dot { width: 0.7em; height: 0.7em; }
.tz-body .rating { font-size: 0.9em; }
.tz-trend { display: grid; grid-template-columns: 2.5em 1fr; gap: 0.7em; align-items: center; }
.tz-trend b { font-size: 0.85em; font-weight: 600; }
@container teaser (width < 26rem) {
  .tz-screen { font-size: calc(100cqi / 26); }
  .tz-nav, .tz-add, .tz-shelf, .tz-trends, .tz-wall .tz-label { display: none; }
  .tz-tabs { display: flex; gap: 0.25em; padding: 0.6em 1em 0; font-size: 0.85em; font-weight: 600; color: var(--muted); }
  .tz-tabs > * { padding: 0.45em 0.8em; border-radius: 999px; }
  .tz-tabs b { background: var(--raise); color: var(--text); }
  .tz-me { margin-left: auto; }
  .tz-console { grid-template-columns: 1fr; }
  .tz-panel.tz-wall { background: var(--ground); padding-top: 0.9em; }
}
/* After the wordmark's letters land and it blinks (1.9s), it lifts and the teaser opens beneath it. The wordmark starts
   where the pair's middle will be (half the teaser's height, from its aspect ratio, plus half the gap). */
@media (prefers-reduced-motion: no-preference) {
  .gate-show > .wordmark { --tz-h: calc(100cqi * 11 / 16 + 3.75rem); animation: lift 800ms var(--ease-out) 1.9s both; }   /* + the phrase */
  @container gate-show (width < 26rem) { .gate-show > .wordmark { --tz-h: calc(100cqi * 3 / 2); } }
  .teaser { animation: open 900ms var(--ease-out) 2s both; }
  @media (width >= 52rem) { .gate-tag { animation: tag-in 700ms var(--ease-out) 2.5s both; } }
}
@keyframes lift { from { translate: 0 calc((var(--tz-h) + 2rem) / 2); } }
@keyframes open { from { opacity: 0; translate: 0 1rem; clip-path: inset(0 0 100% 0 round calc(var(--radius) * 2)); } }

/* ── top bar ───────────────────────────────────────────────────────────────────────────────── */

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 1.5rem; padding: 0.625rem 1rem;
  background: var(--panel); border-bottom: 1px solid var(--seam); }
.top-brand { text-decoration: none; display: inline-flex; }
.top-nav { display: flex; gap: 0.25rem; margin-right: auto; }
.top-nav a { color: var(--muted); text-decoration: none; font-weight: 600; padding: 0.5rem 0.75rem; border-radius: var(--radius); }
.top-nav a:hover { color: var(--text); background: var(--raise); }
.top-nav a[aria-current="page"] { color: var(--text); background: var(--raise); }
.me-menu, .nav-more { position: relative; }
.nav-more > summary { list-style: none; cursor: pointer; color: var(--muted); padding: 0.5rem 0.375rem; border-radius: var(--radius); }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary:hover, .nav-more[open] > summary { color: var(--text); background: var(--raise); }
.nav-more .me-menu-panel { z-index: 20; right: auto; left: 0; }   /* opens rightwards: it sits at the bar's left */
.me-menu summary { list-style: none; cursor: pointer; border-radius: 50%; display: block; position: relative; }
.me-menu summary::-webkit-details-marker { display: none; }
.me-menu-panel { position: absolute; right: 0; top: calc(100% + 0.5rem); min-width: 13rem; background: var(--panel);
  border: 1px solid var(--seam); border-radius: var(--radius); display: grid; padding: 0.375rem; }
.me-menu-panel a, .me-menu-panel button.link { color: var(--text); text-decoration: none; padding: 0.625rem 0.75rem;
  border-radius: calc(var(--radius) - 2px); text-align: left; width: 100%; justify-content: flex-start; font: 400 1rem/1.3 var(--font); }
.me-menu-panel a:hover, .me-menu-panel button.link:hover { background: var(--raise); }
.me-menu-panel form, .me-menu-group { border-top: 1px solid var(--seam); margin-top: 0.375rem; padding-top: 0.375rem; }
.me-menu-group { display: grid; }
.me-menu-name { padding: 0.5rem 0.75rem; color: var(--muted); font-size: 0.875rem; }
@media (max-width: 30rem) { .top { gap: 0.5rem; } .top-nav a { padding: 0.5rem; } .top-nav a[href="./"] { display: none; } }
/* The smallest phones (and wide theme fonts): the bar tightens rather than squeezing the photo or spilling over. */
.top-add, .me-menu { flex: none; }
@media (max-width: 22.5rem) { .top { padding-inline: 0.75rem; } .top-add { padding-inline: 0.625rem; } .wordmark.small { font-size: 1.25rem; } }
@media (max-width: 21.25rem) { .top { gap: 0.375rem; } .top-nav a { padding-inline: 0.25rem; } }   /* 24px+ targets still */
/* My Glymps and Pals: the word on wider screens; on a phone an icon (Pals with its count on the corner), the name kept
   for screen readers. */
.nav-pals wa-icon, .nav-mine wa-icon { display: none; }
@media (max-width: 40rem) {
  .nav-pals, .nav-mine { position: relative; display: inline-grid; place-items: center; }
  .nav-pals wa-icon, .nav-mine wa-icon { display: block; font-size: 1.125rem; }
  .nav-pals .nav-word, .nav-mine .nav-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .nav-pals .badge { position: absolute; top: -0.125rem; right: -0.375rem; margin: 0; }
}
.top-nav a { white-space: nowrap; }
.nav-search { display: inline-grid; place-items: center; font-size: 1.125rem; }

/* Search titles (search.php) */
.search-head { font-size: 1.125rem; }
.choice-text { display: grid; line-height: 1.2; }   /* a choice with a hint under its name (game platforms) */
.choice-text .hint { font-weight: 400; font-size: 0.75rem; }
.pager { display: flex; justify-content: space-between; gap: 1rem; }
.pager a { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2.75rem; font-weight: 600; }

.avatar { border-radius: 50%; display: block; object-fit: cover; background: var(--raise);
  outline: 2px solid var(--ink, var(--seam)); outline-offset: 1px; }
/* The shape someone picked for their photo (profiles.avatar_shape). The photo itself is always square. */
.avatar.shape-squircle { border-radius: 28%; }
.avatar.shape-square { border-radius: 3px; }
.me-menu summary:has(.shape-squircle) { border-radius: 28%; }
.me-menu summary:has(.shape-square) { border-radius: 3px; }

/* ── home: shelf / wall / trends ───────────────────────────────────────────────────────────── */

.console { display: grid; gap: var(--console-gap, 1px); background: var(--console-seam, var(--seam)); padding: var(--console-pad, 0);
  border-bottom: 1px solid var(--seam); grid-template-columns: 1fr; min-height: calc(100dvh - 3.6rem); }
@media (min-width: 48rem) { .console { grid-template-columns: minmax(15rem, 20rem) 1fr; } .console .trends { grid-column: 1 / -1; } }
@media (min-width: 72rem) { .console { grid-template-columns: minmax(16rem, 21rem) 1fr minmax(14rem, 17rem); } .console .trends { grid-column: auto; } }
.console > section { background-color: var(--console-col, var(--ground)); padding: 1.25rem 1rem 2rem; display: grid; gap: 1.25rem; align-content: start;
  background-image: var(--console-col-image, none); background-size: var(--card-size, cover); background-position: center; border-radius: var(--console-radius, 0); }
.console > .wall { background-color: var(--console-wall, var(--panel)); }
/* With a page picture (inc/themes.php sets the --console-* values) the columns part and fill like your home cards. */
.panel-title { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 800; }

.shelf-type { display: grid; gap: 0.5rem; }
.shelf-type h3 { font-family: var(--font); font-size: 0.9375rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; }
.shelf-type h3::before { content: ''; width: 0.625rem; height: 0.625rem; border-radius: 2px; background: var(--hue); }
.t-book { --hue: var(--book); } .t-film { --hue: var(--film); } .t-tv { --hue: var(--tv); } .t-game { --hue: var(--game); }
.slots { display: grid; grid-template-columns: repeat(4, minmax(0, 4.5rem)); gap: 0.5rem; }
.slots span { aspect-ratio: 2 / 3; border-radius: 4px; border: 1px dashed color-mix(in oklab, var(--hue) 55%, transparent);
  background: color-mix(in oklab, var(--hue) 8%, transparent); }
.empty { color: var(--muted); font-size: 0.9375rem; max-width: 34rem; }
.wall-empty { display: grid; gap: 0.75rem; justify-items: start; max-width: 36rem; }
.wall-empty .lead { font: 800 1.75rem/1.15 var(--display); letter-spacing: -0.02em; }

/* ── profile ───────────────────────────────────────────────────────────────────────────────── */

.page { max-width: 72rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; display: grid; gap: 1.5rem; }
.profile-head { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; padding-bottom: 1.5rem; border-bottom: 1px solid var(--seam); }
.profile-head .avatar { width: 6rem; height: 6rem; outline-width: 3px; outline-offset: 3px; }
.profile-head h1 { font-size: clamp(2rem, 1.5rem + 2vw, 3rem); }
.profile-head h1 .at { color: var(--ink); }
.profile-meta { display: flex; gap: 0.75rem; align-items: center; color: var(--muted); font-size: 0.9375rem; flex-wrap: wrap; }
.profile-head .actions { margin-left: auto; }
@media (max-width: 30rem) { .profile-head .actions { margin-left: 0; } }
.pill { border: 1px solid var(--seam); border-radius: 999px; padding: 0.125rem 0.625rem; font-size: 0.8125rem; color: var(--muted); }
.shelves { display: grid; gap: 1px; background: var(--seam); border: 1px solid var(--seam); border-radius: calc(var(--radius) * 2);
  overflow: hidden; grid-template-columns: 1fr; }
@media (min-width: 40rem) { .shelves { grid-template-columns: 1fr 1fr; } }
.shelves > section { background: var(--panel); padding: 1.25rem; display: grid; gap: 0.75rem; align-content: start; }

/* ── settings ──────────────────────────────────────────────────────────────────────────────── */

.narrow { max-width: 40rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; display: grid; gap: 1.5rem; }
.card { background: var(--panel); border: 1px solid var(--seam); border-radius: calc(var(--radius) * 2); padding: 1.25rem; display: grid; gap: 1rem; }
.card > h2 { scroll-margin-top: 5rem; }
.photo-row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.photo-row .avatar { width: 4rem; height: 4rem; }
input[type="file"] { font: inherit; color: var(--muted); max-width: 100%; min-width: 0; flex: 1 1 12rem; }
input[type="file"]::file-selector-button { font: 600 0.9375rem var(--font); border: 1px solid var(--seam); border-radius: var(--radius);
  background: var(--raise); color: var(--text); padding: 0.5rem 0.875rem; margin-right: 0.75rem; cursor: pointer; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; }
.rows li { display: flex; gap: 0.75rem; align-items: center; padding: 0.625rem 0; border-top: 1px solid var(--seam); flex-wrap: wrap; }
.rows li:first-child { border-top: 0; }
.rows .grow { flex: 1; min-width: 10rem; overflow-wrap: anywhere; }
/* MFA setup (mfa-add.php): QR codes need dark on light, so the light theme's panel in both themes. */
.totp-qr { display: block; width: 12rem; max-width: 100%; height: auto; margin: 0.5rem 0; padding: 0.5rem; background: var(--L-panel); border-radius: var(--radius); }
.totp-secret { overflow-wrap: anywhere; }
/* A person and what's happening with them (Pals, group invites): one centred line, not two baselines. */
.rows .grow:has(> .person, > wa-icon) { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; }
.rows .grow:has(> wa-icon:first-child) { flex-wrap: nowrap; }   /* an icon and its label: one line, the label wraps */
.icon-btn { min-height: 2.5rem; min-width: 2.5rem; padding: 0.5rem; background: none; border-color: transparent; }
.icon-btn:hover { background: var(--raise); }
.icon-btn.is-on { color: var(--accent); }

/* Reactions on a pal's Glymps (reaction_bar(), inc/social.php; js/react.js). */
.reactions { display: flex; flex-wrap: wrap; gap: 0.375rem; align-items: center; }
.reactions form { display: contents; }
.react-chip { display: inline-flex; align-items: center; gap: 0.25rem; min-height: 2rem; padding: 0.125rem 0.5rem; border-radius: 999px;
  border: 1px solid var(--seam); background: var(--panel); color: var(--text); font: 600 0.875rem/1 var(--font); }
button.react-chip { cursor: pointer; }
.react-chip[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 16%, var(--panel)); }
.react-pick[open] { flex-basis: 100%; }   /* opens in place under the chips, so it wraps inside the card on a phone */
.react-pick > summary { list-style: none; cursor: pointer; color: var(--muted); }
.react-pick > summary::-webkit-details-marker { display: none; }
/* The React menu (one form): rows of choices (Common, Recent, a group's own), then the search (js/emoji-search.js). */
.reactions form.react-menu { display: grid; gap: 0.375rem; margin-top: 0.25rem; padding: 0.5rem; max-width: min(100%, 26rem);
  background: var(--panel); border: 1px solid var(--seam); border-radius: calc(var(--radius) * 2); }
.react-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; }
.react-row-name { flex-basis: 100%; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.react-search { display: grid; gap: 0.375rem; }
.react-search[hidden], .emoji-pick[hidden] { display: none; }
.emoji-results { display: flex; flex-wrap: wrap; gap: 0.25rem; max-height: 12rem; overflow-y: auto; }
.emoji-results:empty { display: none; }
.tone-pick { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.tone-pick .tone { min-width: 2.25rem; min-height: 2.25rem; padding: 0.125rem; font-size: 1.125rem; line-height: 1; border-radius: var(--radius); }
.tone-pick .tone[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 16%, var(--panel)); }
/* Emoji in each device's own colour font (inc/emoji.php); a group's own emoji are small pictures. */
.emoji { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif; font-weight: 400; }
.emoji-img { display: inline-block; width: 1.25em; height: 1.25em; object-fit: contain; vertical-align: -0.2em; }
.react-option .emoji-img { width: 1.5rem; height: 1.5rem; }
.react-option { min-width: 2.5rem; min-height: 2.5rem; padding: 0.25rem; font-size: 1.25rem; line-height: 1; border-radius: var(--radius); }
.react-option[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 16%, var(--panel)); }
@media (pointer: coarse) { .react-chip { min-height: 2.75rem; } .react-option, .tone-pick .tone { min-width: 2.75rem; min-height: 2.75rem; } }   /* on (in your Up next): tap to arm, tap again to take off */
/* Flagging and moderation (inc/moderation.php, moderation.php). */
.wall-act { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.25rem; }
/* The flag's form drops down under its card (or the Glymps page's actions row) over what follows: the icons stay put. */
.wall-card, .actions:has(.flag-pick) { position: relative; }
.flag-pick[open] .flag-form { position: absolute; z-index: 30; top: calc(100% + 0.25rem); margin: 0;
  box-shadow: 0 8px 24px color-mix(in oklab, var(--text) 25%, transparent); }
.wall-card .flag-pick[open] .flag-form { left: 0; right: 0; max-width: none; }
.actions .flag-pick[open] .flag-form { right: 0; width: min(32rem, calc(100vw - 2rem)); }
/* A profile's background flag (sql/090): the form spans the header, so it never runs off a phone's edge. */
.profile-head { position: relative; }
.profile-head .actions:has(.flag-pick) { position: static; }
.profile-head .flag-pick[open] .flag-form { left: 0; right: 0; width: auto; max-width: 32rem; margin-left: auto; }
.flag-pick > summary { list-style: none; cursor: pointer; color: var(--muted); }
.flag-pick > summary::-webkit-details-marker { display: none; }
.flag-form { display: grid; gap: 0.5rem; margin-top: 0.5rem; padding: 0.75rem; background: var(--panel); border: 1px solid var(--seam);
  border-radius: calc(var(--radius) * 2); max-width: 32rem; }
.flag-form textarea, .case-act textarea { font: inherit; color: var(--text); background: var(--raise); border: 1px solid var(--seam); border-radius: var(--radius);
  padding: 0.5rem 0.75rem; width: 100%; }
.case-picture { display: block; width: 100%; max-width: 20rem; max-height: 14rem; object-fit: contain; border: 1px solid var(--seam); border-radius: var(--radius); background: var(--raise); }
.flag-done { display: inline-flex; align-items: center; min-height: 2.75rem; padding-inline: 0.5rem; color: var(--accent); }
.notice-banner { margin: 1rem auto 0; max-width: 72rem; width: calc(100% - 2rem); padding: 0.75rem 1rem; border: 1px solid var(--danger);
  border-left-width: 4px; border-radius: var(--radius); background: var(--panel); display: grid; gap: 0.5rem; }
.notice-banner p { margin: 0; overflow-wrap: anywhere; }
.notice-banner ul { margin: 0; padding-left: 1.25rem; overflow-wrap: anywhere; }
.terms-banner { border-color: var(--accent); }
.mod-hidden { color: var(--danger); font-weight: 600; margin: 0; }
.page.moderation { max-width: 52rem; }   /* a readable queue on a wide screen */
.moderation section { margin-block: 1.5rem 2rem; }
.moderation h2 { margin-bottom: 0.75rem; }
.moderation .tabset { margin-top: 1rem; }
.cases { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.case { border: 1px solid var(--seam); border-radius: var(--radius); background: var(--panel); }
/* Group emoji to check (moderation.php, sql/086): each picture with its name and a remove button. */
.emoji-case { display: grid; gap: 0.5rem; padding: 0.75rem 1rem; }
.emoji-case h3 { margin: 0; font-size: 1rem; }
.emoji-check { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 0.5rem; }
.emoji-check li { display: flex; align-items: center; gap: 0.5rem; min-width: 0; padding: 0.25rem 0.25rem 0.25rem 0.5rem; border: 1px solid var(--seam); border-radius: var(--radius); }
.emoji-check .emoji-img { flex: none; width: 3rem; height: 3rem; }
.emoji-check-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 0.8125rem; }
.emoji-pending { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 4px; background: var(--raise); color: var(--muted); font-size: 0.75rem; }
.case > summary { display: grid; gap: 0.25rem; padding: 0.75rem 1rem; cursor: pointer; list-style: none; }
.case > summary::-webkit-details-marker { display: none; }
.case > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius); }
.case[open] > summary { border-bottom: 1px solid var(--seam); }
.case-head, .case-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; min-width: 0; overflow-wrap: anywhere; }
.case-title { font-size: 1rem; }
.case-meta { font-size: 0.875rem; }
.case-meta .late { color: var(--danger); font-weight: 600; }
.case-body { display: grid; gap: 0.75rem; padding: 0.75rem 1rem 1rem; }
.case-body p { margin: 0; overflow-wrap: anywhere; }
.case-take { margin: 0; padding-left: 0.75rem; border-left: 3px solid var(--seam); white-space: pre-wrap; overflow-wrap: anywhere; }
.case-flags { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.case-flags > li { display: grid; gap: 0.125rem; padding: 0.5rem 0.75rem; background: var(--raise); border-radius: var(--radius); }
.case-flags p { margin: 0; overflow-wrap: anywhere; }
.case-flags button.link { justify-self: start; }
.case-act { display: grid; gap: 0.5rem; }
.case-act label { font-weight: 600; }
.pager { justify-content: space-between; margin-top: 0.75rem; }
.row-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.row-form input[type="text"] { flex: 1 1 12rem; width: auto; min-width: 0; }
.add-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--seam); }
.add-form label { flex-basis: 100%; font-weight: 600; }
.team, .reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.team > li { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.25rem 0.25rem 0.25rem 0.75rem;
  border: 1px solid var(--seam); border-radius: var(--radius); background: var(--panel); }
.reason-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.375rem; background: var(--panel);
  border: 1px solid var(--seam); border-radius: var(--radius); }
.reason-row > .row-form { flex: 1 1 14rem; min-width: 0; }
.reason-row.retired input { color: var(--muted); }
.arrange-moves { display: flex; margin-left: auto; }
.hist-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem 0.75rem; margin-bottom: 1rem; }
.hist-field { display: grid; gap: 0.25rem; flex: 1 1 10rem; min-width: 0; }
.hist-field label { font-weight: 600; font-size: 0.875rem; }
.hist-go { display: flex; align-items: center; gap: 0.75rem; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--seam); border: 1px solid var(--seam);
  border-radius: var(--radius); overflow: hidden; }
.history > li { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.75rem; padding: 0.625rem 0.875rem; background: var(--panel); overflow-wrap: anywhere; }
.history .hist-note { margin: 0.25rem 0 0; color: var(--muted); white-space: pre-wrap; }
@media (max-width: 30rem) { .history > li { grid-template-columns: 1fr; gap: 0.125rem; } }
.icon-btn.armed, button.danger.armed { background: var(--danger); border-color: var(--danger); color: var(--panel); }
/* js/arm.js: the confirmation beside an armed delete. */
.arm-bubble { position: fixed; z-index: 40; max-width: min(22rem, calc(100vw - 16px)); padding: 0.5rem 0.75rem; font-size: 0.875rem;
  line-height: 1.35; background: var(--text); color: var(--ground); border-radius: var(--radius); pointer-events: none; }
.copy-field { display: flex; gap: 0.5rem; }
.copy-field input { font-family: var(--font); font-size: 0.875rem; }

/* ── superuser ─────────────────────────────────────────────────────────────────────────────── */

.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--seam); border: 1px solid var(--seam);
  border-radius: var(--radius); overflow: hidden; }
.log li { background: var(--panel); padding: 0.75rem 1rem; display: grid; gap: 0.25rem; }
.log .meta { color: var(--muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; display: flex; gap: 0.75rem; flex-wrap: wrap; }
.log .lvl-error, .log .lvl-exception, .log .lvl-fatal { color: var(--danger); font-weight: 700; }
.log pre { margin: 0; font-size: 0.75rem; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }
.icon-btn.copied { color: var(--ok); }

/* ── adding and showing Glymps ─────────────────────────────────────────────────────────────── */

.top-add { min-height: 2.5rem; padding: 0.5rem 0.875rem; }
@media (max-width: 40rem) { .top-add-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } }
.top-add[aria-current="page"] { outline: 2px solid var(--accent); outline-offset: 2px; }

textarea { font: inherit; color: var(--text); background: var(--raise); border: 1px solid color-mix(in oklab, var(--muted) 65%, var(--seam)); border-radius: var(--radius);
  padding: 0.6875rem 0.75rem; width: 100%; resize: vertical; min-height: 8rem; }
textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.check { display: flex; gap: 0.5rem; align-items: flex-start; font-weight: 400; font-size: 0.9375rem; color: var(--muted); }
.check input { margin-top: 0.25rem; }
.search-row { display: flex; gap: 0.5rem; }
/* Progress through a book or game (inc/progress.php): the latest, its remove button beside it; the add form in one
   row when the column has room, stacked on a phone. */
.progress-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; }
.progress-row .choices { margin: 0; }
.progress-row input[type="number"] { width: 6rem; }   /* a page or a percent: short, so Add fits the row */
/* Started and Finished on (glymps_fields()) side by side when there's room; one alone takes the row. */
.date-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.progress-now { display: flex; align-items: center; gap: 0.5rem; }
.progress-now p { margin: 0; flex: 1; }
/* Suggestions as you type (js/suggest-list.js): the site's own list, labelled, so it doesn't pass for browser autofill. */
.has-suggest { position: relative; }
.suggest { position: absolute; z-index: 30; max-width: calc(100vw - 2rem); background: var(--panel); border: 1px solid var(--seam);
  border-radius: var(--radius); box-shadow: 0 8px 24px color-mix(in oklab, var(--text) 25%, transparent); overflow: hidden; }
.suggest-head { margin: 0; padding: 0.375rem 0.75rem; font: 700 0.75rem var(--display); color: var(--muted); border-bottom: 1px solid var(--seam); }
.suggest ul { list-style: none; margin: 0; padding: 0.25rem 0; max-height: 22rem; overflow-y: auto; }
.suggest li { min-height: 2.75rem; display: flex; align-items: center; padding: 0.375rem 0.75rem; line-height: 1.3; cursor: pointer; }
.suggest li:hover, .suggest li[aria-selected="true"] { background: color-mix(in oklab, var(--accent) 16%, var(--panel)); }
.suggest li[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--accent); }
.type-dot { width: 0.625rem; height: 0.625rem; border-radius: 2px; background: var(--hue); }

/* A cover: the stored picture, or the type's tinted blank with the title on it. */
.cover, .thumb { aspect-ratio: 2 / 3; width: 100%; height: auto; border-radius: 4px; object-fit: cover; display: block; background: var(--raise); }
.cover.blank, .thumb.blank { display: grid; place-items: end start; padding: 0.5rem; font: 700 0.8125rem/1.2 var(--display);
  background: color-mix(in oklab, var(--hue) 22%, var(--panel)); border: 1px solid color-mix(in oklab, var(--hue) 45%, transparent);
  color: var(--text); overflow: hidden; overflow-wrap: anywhere; }

.chosen { display: grid; grid-template-columns: 7rem 1fr; gap: 1.25rem; align-items: start; }
@media (min-width: 40rem) { .chosen { grid-template-columns: 9rem 1fr; } }
.chosen h1, .chosen h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem); }
.by { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.by a { display: inline-flex; gap: 0.375rem; align-items: center; color: var(--ink); font-weight: 700; text-decoration: none; }
.by .avatar { width: 1.5rem; height: 1.5rem; outline-width: 1px; }

.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--seam); border: 1px solid var(--seam);
  border-radius: calc(var(--radius) * 2); overflow: hidden; }
.results li { background: var(--panel); }
.result { display: grid; grid-template-columns: 3rem 1fr; gap: 0.875rem; align-items: center; padding: 0.625rem 0.875rem; width: 100%;
  color: var(--text); text-decoration: none; text-align: left; border: 0; border-radius: 0; background: none; font: inherit; min-height: 0; }
.result:hover { background: var(--raise); }
.result strong { display: block; font-weight: 700; }
.result .hint { display: block; }
.result-form { margin: 0; }
.manual { color: var(--muted); }

/* Columns at least 5.5rem, sharing the spare width: three covers across a phone. (A fixed maximum here made auto-fill
   count columns at that maximum, leaving a third of a phone row empty.) */
.shelf-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: 0.75rem; }
.shelf-heading { font-size: 1.25rem; margin-top: 0.5rem; }
/* My Month (inc/month.php): nine covers in one seamed panel, each captioned with its type's colour. */
.month { display: grid; gap: 0.5rem; max-width: 24rem; }
.month-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.month-head .shelf-heading { margin: 0; }
.month-steps { display: flex; gap: 0.25rem; }
.month-steps [aria-disabled="true"] { color: var(--muted); opacity: 0.45; display: inline-grid; place-items: center; }
.month-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--seam); border: 1px solid var(--seam); border-radius: calc(var(--radius) * 2); overflow: hidden; }
.month-tile { background: var(--panel); min-width: 0; }
.month-tile a { display: grid; color: var(--text); text-decoration: none; height: 100%; }
.month-tile .cover { border-radius: 0; }
.month-title { display: flex; align-items: center; gap: 0.375rem; min-width: 0; padding: 0.375rem 0.5rem; font-size: 0.75rem; font-weight: 600;
  line-height: 1.25; }
.month-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.month-title .type-dot { flex: none; }
.month-tile a:hover .month-title, .month-tile a:focus-visible .month-title { box-shadow: inset 0 -3px var(--hue); }
.month-tile a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.month-tile.empty { min-height: 100%; background: color-mix(in oklab, var(--raise) 60%, var(--panel)); }
.month-tile.empty::before { content: ""; display: block; aspect-ratio: 2 / 3; }
.card-g { display: grid; gap: 0.375rem; align-content: start; color: var(--text); text-decoration: none;
  min-width: 0; }   /* never wider than its column: a long rating row would push into the next card */
.card-g .card-title, .card-g .card-take { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-g .card-title { font-size: 0.8125rem; font-weight: 600; line-height: 1.25; }
/* On a card: one star and the number ("★ 7"), readable at a glance; the full row of stars is on the Glymps. */
.card-g .rating { font-size: 0.8125rem; min-width: 0; gap: 0.25rem; }
.card-g .stars-shown i:not(:first-child) { display: none; }
.card-g .card-take { font-size: 0.75rem; line-height: 1.3; color: var(--muted); }
.card-g:hover .card-title { text-decoration: underline; }

.rating { display: inline-flex; gap: 0.375rem; align-items: center; color: var(--text); font-weight: 700; }
.rating .rating-name { color: var(--text); }
.rating wa-icon { font-size: 0.875em; }
article .rating { font-size: 1.125rem; }
.take { font: 700 clamp(1.25rem, 1.1rem + 0.6vw, 1.625rem)/1.3 var(--display); }
.note { max-width: 65ch; line-height: 1.6; }

/* Rating field: the star row (below). */
.rate { border: 0; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.rate > legend { font-weight: 600; font-size: 0.9375rem; margin-bottom: 0.5rem; padding: 0; }
.push-end { margin-left: auto; }

.title-link { color: inherit; text-decoration: none; }
.title-link:hover { text-decoration: underline; }

/* The type in its own hue, wherever a title is named. */
/* Baseline from the label, not the dot, so "TV show" lines up with the " · 2025" beside it. */
.type-tag { display: inline-flex; align-items: baseline; gap: 0.375rem; }
.type-tag .type-dot { align-self: center; }
/* Status choices: one row of three, even on a phone. */
.status-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.status-choices .choice { justify-content: center; text-align: center; padding-inline: 0.5rem; }
.status-choices .choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }   /* the card's own highlight shows the pick */

/* Framing a new photo (js/avatar-crop.js): always a square, whatever shape it's shown in. */
.crop { display: grid; gap: 0.75rem; justify-items: start; margin-top: 0.5rem; }
.crop-view { width: min(18rem, 100%); aspect-ratio: 1; position: relative; overflow: hidden; border: 1px solid var(--seam);
  border-radius: var(--radius); background: var(--raise); cursor: grab; touch-action: none; user-select: none; }
.crop-view:active { cursor: grabbing; }
.crop-view:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.crop-img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.crop-zoom { width: min(18rem, 100%); }
.crop-zoom input { width: 100%; }
.shape-choices .avatar { width: 2rem; height: 2rem; outline-width: 1px; }
.shape-blank { display: inline-block; background: var(--ink); }

/* The framing preview wears the shape picked under "Photo shape" (or a group's "Picture shape"); the photo is still framed and kept square. */
form:has(input:is([name="avatar_shape"], [name="image_shape"])[value="circle"]:checked) .crop-view { border-radius: 50%; }
form:has(input:is([name="avatar_shape"], [name="image_shape"])[value="squircle"]:checked) .crop-view { border-radius: 28%; }
form:has(input:is([name="avatar_shape"], [name="image_shape"])[value="square"]:checked) .crop-view { border-radius: 3px; }

/* Star pickers: native radios in a row; every star up to the chosen (or hovered) one fills. CSS alone. */
.star-row { display: grid; gap: 0.25rem; width: min(100%, 26rem); }
.stars-10 .star-row { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.star { display: grid; place-items: center; min-height: 2.75rem; cursor: pointer; color: color-mix(in oklab, var(--muted) 65%, var(--seam)); font-size: 1.5rem;
  transition: color 120ms var(--ease-out), transform 120ms var(--ease-out); }
.star input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-row:has(input:checked) .star { color: var(--accent); }
.star-row .star:has(input:checked) ~ .star { color: color-mix(in oklab, var(--muted) 65%, var(--seam)); }
.star-row:hover .star { color: color-mix(in oklab, var(--accent) 70%, var(--panel)); }
.star-row .star:hover ~ .star { color: color-mix(in oklab, var(--muted) 65%, var(--seam)); }
.star:hover { transform: scale(1.12); }
.star:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { .star { transition: none; } .star:hover { transform: none; } }

/* A rating as shown: stars filled to the value, at text size. */
.stars-shown { display: inline-flex; gap: 0.0625rem; }
.stars-shown i { color: color-mix(in oklab, var(--muted) 65%, var(--seam)); font-style: normal; }
.stars-shown i.on { color: var(--accent); }

/* TV seasons and episodes (inc/tv.php). */
.seasons { margin-top: 1rem; }
.season { border: 1px solid var(--seam); border-radius: calc(var(--radius) * 2); background: var(--panel); }
.season > summary { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; padding: 0.875rem 1rem; cursor: pointer; list-style: none; }
.season > summary::-webkit-details-marker, .ep-fold > summary::-webkit-details-marker { display: none; }
.season > summary::before, .ep-fold > summary::before { content: ''; width: 0.5rem; height: 0.5rem; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); transition: transform 160ms var(--ease-out); }
.season[open] > summary::before, .ep-fold[open] > summary::before { transform: rotate(45deg); }
.season-name { font: 700 1rem var(--display); }
.season-rating { margin-left: auto; }
.season-summary { padding: 0 1rem 0.75rem; display: grid; gap: 0.25rem; }
.season-body { padding: 0 1rem 1rem; display: grid; gap: 0.75rem; }
.season-actions { justify-content: space-between; align-items: flex-start; }
.ep-fold { border-top: 1px solid var(--seam); }
.ep-fold > summary { display: flex; gap: 0.5rem; align-items: center; padding: 0.625rem 0; cursor: pointer; list-style: none; font-weight: 700; }
.ep-fold > .season-body { padding: 0 0 0.75rem; }
.episodes { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--seam); border: 1px solid var(--seam); border-radius: var(--radius); overflow: hidden; }
.episodes li { background: var(--panel); display: grid; grid-template-columns: 2.75rem 1fr; gap: 0 0.5rem; align-items: center; padding: 0.375rem 0.75rem 0.375rem 0.375rem; }
.episodes li > .ep-more, .episodes li > .part-edit { grid-column: 2; }
.ep-name .num { color: var(--muted); margin-right: 0.25rem; }
.episodes li > .num { color: var(--muted); }   /* a show's media page: number (or year) in the tick's place */
.is-watched .ep-name { color: var(--text); }
.ep-more, .season-summary { font-size: 0.875rem; display: grid; gap: 0.25rem; padding: 0.25rem 0; }
.part-take { font-weight: 700; }
.part-note { color: var(--muted); }
.tick { margin: 0; }
.tick-btn { color: var(--seam); border: 1px solid var(--seam); background: var(--raise); }
.tick-btn[aria-pressed="true"] { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.tick-shown { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; color: var(--accent); }
.part-edit > summary { font-size: 0.875rem; color: var(--accent); cursor: pointer; padding: 0.25rem 0; }
.part-edit[open] { padding-bottom: 0.75rem; }
.part-edit form { margin-top: 0.5rem; }
.card-progress { font-size: 0.75rem; color: var(--muted); }
/* Up next (inc/tv.php): the episode after the furthest one ticked, one tap to mark it. */
.up-next { display: grid; gap: 0.5rem; padding: 0.875rem 1rem; border: 1px solid var(--accent); border-radius: calc(var(--radius) * 2); background: var(--panel); }
.up-next p { margin: 0; font-size: 1.0625rem; }
.up-next .hint { margin-right: 0.25rem; }
.up-next .actions { align-items: center; }
.season-tick { display: inline-flex; color: var(--accent); }
.catch-up { grid-column: 2; margin: 0 0 0.25rem; }
/* A show on your own Glympsing now shelf: the card, then its next episode to tick. */
.card-next { display: grid; gap: 0.375rem; align-content: start; min-width: 0; }
.card-next form { margin: 0; }
.card-next button { width: 100%; justify-content: center; min-height: 2.25rem; padding: 0.25rem 0.5rem; font-size: 0.8125rem; white-space: nowrap; }
/* Your own Glymps, changed in place (glymps.php my_take_section()): the take keeps the weight it has when shown. */
.my-take input[name="take"] { font: 700 1.125rem/1.3 var(--display); }

/* Unsaved changes (js/unsaved.js): the form's Save gets a ring; while it's off screen, a bar offers the same Save. */
button.needs-save { box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 35%, transparent); }
.save-bar { position: fixed; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20;
  display: flex; gap: 1rem; align-items: center; padding: 0.5rem 0.5rem 0.5rem 1rem; width: max-content; max-width: calc(100% - 2rem);
  background: var(--panel); border: 1px solid var(--accent); border-radius: calc(var(--radius) * 2); }
.save-bar-text { font-weight: 700; }
@media (prefers-reduced-motion: no-preference) {
  .save-bar:not([hidden]) { animation: bar-up 220ms var(--ease-out); }
}
@keyframes bar-up { from { transform: translate(-50%, 1rem); opacity: 0; } }

/* The wall (index.php): newest Glymps, a card each. */
.wall-list { display: grid; gap: 1px; background: var(--seam); border: 1px solid var(--seam); border-radius: calc(var(--radius) * 2); overflow: hidden; max-width: 44rem; }
.wall-card { background: var(--panel); display: grid; grid-template-columns: 4.5rem 1fr; gap: 1rem; padding: 1rem; align-items: start; }
@media (min-width: 40rem) { .wall-card { grid-template-columns: 5.5rem 1fr; } }
.wall-body { display: grid; gap: 0.375rem; min-width: 0; container-type: inline-size; }
.wall-body .rating { font-size: min(1.125rem, calc(100cqi / 12.5)); }   /* ten stars fit a 320px phone */
.wall-who { display: flex; flex-wrap: wrap; gap: 0.375rem; align-items: center; font-size: 0.875rem; color: var(--muted); }
.wall-who a { display: inline-flex; gap: 0.375rem; align-items: center; color: var(--ink); font-weight: 700; text-decoration: none; }
.wall-who .avatar { width: 1.75rem; height: 1.75rem; outline-width: 1px; }
.wall-card h3 { font-size: 1.125rem; }
.wall-card h3 a { color: var(--text); text-decoration: none; }
.wall-card h3 a:hover { text-decoration: underline; }
.wall-take { font: 700 1rem/1.35 var(--display); }

/* Steam stats on a game Glymps (inc/steam.php). */
.steam { margin-top: 0.5rem; padding: 1rem; border: 1px solid var(--seam); border-radius: calc(var(--radius) * 2); background: var(--panel); }
.steam h2 { display: flex; gap: 0.5rem; align-items: center; font-size: 1.125rem; }
.steam h3 { font-size: 0.9375rem; }
.steam-facts { display: flex; flex-wrap: wrap; gap: 1rem 2rem; margin: 0; }
.steam-facts dt { font-size: 0.8125rem; color: var(--muted); }
.steam-facts dd { margin: 0; font-weight: 700; font-size: 1.125rem; display: flex; gap: 0.5rem; align-items: center; }
.steam meter { width: 6rem; height: 0.5rem; }
.steam meter::-webkit-meter-bar { background: var(--raise); border: 1px solid var(--seam); border-radius: 4px; }
.steam meter::-webkit-meter-optimum-value, .steam meter::-webkit-meter-suboptimum-value, .steam meter::-webkit-meter-even-less-good-value { background: var(--accent); border-radius: 4px; }
.steam meter::-moz-meter-bar { background: var(--accent); }
.unlocks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; font-size: 0.9375rem; }
.unlocks li { display: flex; justify-content: space-between; gap: 1rem; }
.unlocks-all > summary { color: var(--accent); cursor: pointer; font-size: 0.875rem; }
.steam-who { display: flex; gap: 0.5rem; align-items: center; }
.steam-who img { border-radius: 4px; }

/* Pals and groups. */
/* The heading row: this page, and on a phone the other one beside it as a tab (pals_groups_tabs(), inc/social.php). */
.page-tabs { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; view-transition-name: page-tabs; }
.page-tab { display: none; }
@media (max-width: 40rem) {
  .page-tabs h1 { padding-bottom: 0.125rem; border-bottom: 3px solid var(--accent); }
  .page-tab { display: inline; font: 800 clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem)/1.15 var(--display); letter-spacing: -0.02em;
    color: var(--muted); text-decoration: none; padding-bottom: 0.125rem; border-bottom: 3px solid transparent; }
  .page-tab:hover, .page-tab:focus-visible { color: var(--accent); }
}
.find-form { display: grid; gap: 0.75rem; }
.find-mode { min-width: 0; }
.find-mode .choice { padding: 0.5rem 0.75rem; white-space: nowrap; }
.badge { display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; padding: 0 0.3rem; margin-left: 0.25rem;
  border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 0.75rem; font-weight: 700; }
.badge[hidden] { display: none; }
.nav-narrow { display: none; }
@media (max-width: 40rem) {
  .top-nav .nav-wide { display: none; }
  .top-nav a.is-section { color: var(--text); background: var(--raise); }   /* Pals, on the Groups page */
  .me-menu-panel .nav-narrow { display: block; }
}
.person { display: inline-flex; gap: 0.375rem; align-items: center; color: var(--ink, var(--text)); font-weight: 700; text-decoration: none; }
.person .avatar { width: 1.5rem; height: 1.5rem; outline-width: 1px; }
.rows form { margin: 0; }
.group-head { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.group-head h1 { display: flex; gap: 0.5rem; align-items: center; }
.group-grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 60rem) { .group-grid { grid-template-columns: 1fr 22rem; } }
.group-title { gap: 1rem; }
.group-title .chosen { grid-template-columns: 5rem 1fr; }
.group-title h3 { font-size: 1.25rem; }
.group-title h3 a { color: var(--text); text-decoration: none; }
.group-review { display: grid; gap: 0.5rem; padding: 0.75rem 0; border-top: 1px solid var(--seam); border-bottom: 1px solid var(--seam); }
.member-ratings { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.member-ratings li { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; font-size: 0.9375rem; }
.member-glymps { text-decoration: none; }

/* Home tabs on a phone (js/tabs.js). */
.home-tabs { display: flex; position: sticky; top: 3.55rem; z-index: 4; background: var(--panel); border-bottom: 1px solid var(--seam); }
.home-tabs[hidden] { display: none; }
.home-tabs [role="tab"], .tabs [role="tab"] { flex: 1; border: 0; border-radius: 0; background: none; color: var(--muted); font-weight: 700;
  border-bottom: 2px solid transparent; min-height: 2.75rem; padding: 0.5rem; }
.home-tabs [role="tab"][aria-selected="true"], .tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.home-tabs [role="tab"]:hover, .tabs [role="tab"]:hover { color: var(--text); transform: none; }
.wall-more { text-align: center; padding: 1rem; background: var(--panel); color: var(--muted); }

/* Superuser numbers: stat tiles, bars by type, columns by week. One series each, so one colour (the accent); marks
   are thin with rounded data ends; bar lengths are classes in 5% steps (the CSP refuses inline styles). */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1px; background: var(--panel);
  border: 1px solid var(--seam); border-radius: calc(var(--radius) * 2); overflow: hidden; margin: 0; }
/* The dividers are each tile's own ring (not the gap showing a seam-coloured ground), so an empty last cell stays blank. */
.tiles > div { background: var(--panel); padding: 1rem; box-shadow: 0 0 0 1px var(--seam); }
.tiles dt { color: var(--muted); font-size: 0.8125rem; }
/* Superuser's person report: their photo and About above the numbers. */
.person-head { display: flex; gap: 1rem; align-items: flex-start; }
.person-head .avatar { flex: none; }
.person-bio { margin: 0; max-width: 65ch; line-height: 1.6; overflow-wrap: anywhere; }
.tiles dd { margin: 0.25rem 0 0; font: 800 2rem/1 var(--display); }
.tiles dd.hint { margin-top: 0.5rem; font: inherit; font-size: 0.8125rem; color: var(--muted); }   /* "Last month …" under a number */
.small-tiles dd:not(.hint) { font-size: 1.5rem; }
/* A section heading with its action beside it (Superuser › This month and its download), wrapping on a phone. */
.section-head { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between; }
.section-head h2 { margin: 0; }
/* Superuser › This month: the Users number opens the list of everyone (js/people-dialog.js); it looks like the number. */
.tile-button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline dotted var(--muted) 2px; text-underline-offset: 0.2em; }
.tile-button:hover { text-decoration-color: var(--accent); }
.people-dialog { width: min(32rem, calc(100vw - 2rem)); max-height: min(40rem, calc(100dvh - 2rem)); padding: 0;
  color: var(--text); background: var(--panel); border: 1px solid var(--seam); border-radius: calc(var(--radius) * 2); }
.people-dialog[open] { display: flex; flex-direction: column; }
.people-dialog::backdrop, .theme-picker::backdrop { background: color-mix(in oklab, var(--ground) 60%, transparent); }
/* Theme pickers (inc/themes.php theme_picker(), js/theme-picker.js): a button with the chosen theme's swatch, opening a
   dialog of swatches, each a small page in its theme (.tt-<key>). Without JavaScript the swatches show in place. */
.theme-pick-field { display: grid; gap: 0.375rem; justify-items: start; }
.theme-pick-label { font-weight: 600; font-size: 0.9375rem; }
.theme-pick { display: inline-flex; align-items: center; gap: 0.625rem; }
.sw-mini { width: 2.25rem; height: 1.5rem; border-radius: 4px; border: 1px solid var(--seam); flex: none;
  background: linear-gradient(135deg, var(--ground) 0 50%, var(--accent) 50% 100%); }
.theme-picker { width: min(44rem, calc(100vw - 2rem)); max-height: min(44rem, calc(100dvh - 2rem)); padding: 0; --sw-ring: var(--accent);
  color: var(--text); background: var(--panel); border: 1px solid var(--seam); border-radius: calc(var(--radius) * 2); }
.theme-picker[open] { display: flex; flex-direction: column; }
.theme-swatches { border: 0; margin: 0; padding: 0.5rem 1rem 1rem; overflow: auto; min-height: 0; display: grid; gap: 0.5rem; }
.sw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: 0.75rem; }
.theme-swatch { display: grid; gap: 0.375rem; cursor: pointer; position: relative; }
.theme-swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw-page { display: grid; align-content: end; aspect-ratio: 4 / 3; padding: 0.5rem; border-radius: var(--radius); border: 2px solid var(--seam);
  background-color: var(--ground); background-image: var(--page-image, none); background-size: var(--page-size, cover); background-position: center; }
.theme-swatch:has(input:checked) .sw-page { outline: 3px solid var(--sw-ring); outline-offset: 2px; }
.theme-swatch:has(input:focus-visible) .sw-page { outline: 3px solid var(--sw-ring); outline-offset: 4px; }
.sw-card { display: grid; gap: 0.25rem; padding: 0.375rem; border-radius: var(--radius); border: var(--card-border-w, 1px) solid var(--seam);
  background-color: var(--card-fill, var(--panel)); background-image: var(--card-image, none); background-size: var(--card-size, cover); }
.sw-line { height: 0.3125rem; width: 80%; border-radius: 2px; background: var(--text); }
.sw-line.short { width: 50%; background: var(--muted); }
.sw-foot { display: flex; justify-content: space-between; align-items: center; }
.sw-pill { width: 1.5rem; height: 0.5rem; border-radius: 999px; background: var(--accent); }
.sw-dots { display: flex; gap: 3px; }
.sw-dots > span { width: 0.4375rem; height: 0.4375rem; border-radius: 2px; background: var(--hue); }
.sw-name { font-size: 0.8125rem; font-weight: 600; }
html:not(.js) .theme-pick { display: none; }
html:not(.js) .theme-picker { display: block; position: static; width: auto; max-height: none; border: 0; background: none; }
html:not(.js) .theme-picker .dialog-head { display: none; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.75rem 1rem 0; }
.dialog-head h2 { margin: 0; }
.dialog-head form { margin: 0; }
.dialog-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.75rem 1rem 0; }
.dialog-tools .filter-box { flex: 1 1 12rem; }
.people-dialog .filter-status { margin: 0.25rem 1rem 0; min-height: 1.25em; }
.people-dialog > form { overflow: auto; min-height: 0; flex: 1; padding: 0.5rem 1rem 1rem; }
.people-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.people-list button { display: grid; justify-content: stretch; justify-items: start; gap: 0.125rem; width: 100%; min-height: 2.75rem; padding: 0.5rem 0.75rem; text-align: start;
  font: inherit; color: inherit; background: var(--raise); border: 0; border-radius: var(--radius); cursor: pointer; }
.people-list button:hover { background: color-mix(in oklab, var(--accent) 12%, var(--raise)); }
.people-who { font-weight: 700; overflow-wrap: anywhere; }
.chart-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.chart { margin: 0; padding: 1rem; background: var(--panel); border: 1px solid var(--seam); border-radius: calc(var(--radius) * 2); display: grid; gap: 0.75rem; }
.chart figcaption { font-weight: 700; }
.bars { display: grid; gap: 0.5rem; margin: 0; }
.bar-row { display: grid; grid-template-columns: 5rem 1fr; gap: 0.75rem; align-items: center; }
.bar-row dt { font-size: 0.875rem; }
.wide-labels .bar-row { grid-template-columns: 7.5rem 1fr; }   /* provider names (Superuser) */
.bar-row dd { margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.bar { display: block; height: 0.625rem; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar.w-0 { min-width: 0; }
.bar-row:hover .bar { background: color-mix(in oklab, var(--accent) 80%, var(--text)); }
.columns { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2px; height: 8rem; align-items: end;
  border-bottom: 1px solid var(--seam); }
.col { height: 100%; display: flex; align-items: flex-end; }
.col-bar { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.col:hover .col-bar { background: color-mix(in oklab, var(--accent) 80%, var(--text)); }
.col-axis { display: flex; justify-content: space-between; margin: 0; }
.w-0 { width: 0%; } .w-5 { width: 5%; } .w-10 { width: 10%; } .w-15 { width: 15%; } .w-20 { width: 20%; } .w-25 { width: 25%; } .w-30 { width: 30%; } .w-35 { width: 35%; } .w-40 { width: 40%; } .w-45 { width: 45%; } .w-50 { width: 50%; } .w-55 { width: 55%; } .w-60 { width: 60%; } .w-65 { width: 65%; } .w-70 { width: 70%; } .w-75 { width: 75%; } .w-80 { width: 80%; } .w-85 { width: 85%; } .w-90 { width: 90%; } .w-95 { width: 95%; } .w-100 { width: 100%; } 
.h-0 { height: 0%; } .h-5 { height: 5%; } .h-10 { height: 10%; } .h-15 { height: 15%; } .h-20 { height: 20%; } .h-25 { height: 25%; } .h-30 { height: 30%; } .h-35 { height: 35%; } .h-40 { height: 40%; } .h-45 { height: 45%; } .h-50 { height: 50%; } .h-55 { height: 55%; } .h-60 { height: 60%; } .h-65 { height: 65%; } .h-70 { height: 70%; } .h-75 { height: 75%; } .h-80 { height: 80%; } .h-85 { height: 85%; } .h-90 { height: 90%; } .h-95 { height: 95%; } .h-100 { height: 100%; } 
.invite-group { display: grid; gap: 0.5rem; }
.invite-group h3 { font-size: 0.9375rem; }
.invite-when { flex-basis: 100%; }

/* Footer credit (inc/layout.php page_foot), as on raceHQ and receipts. */
.site-foot { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--seam); color: var(--muted); font-size: 0.8125rem; }
.site-foot a { color: inherit; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 1rem; }   /* Privacy and Terms share the first column */

/* Wall filters (wall_filters(), inc/media.php): type links, then whose wall. */
.wall-filters { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; max-width: 44rem; }
.filter-types { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.filter-types a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.875rem; padding: 0.375rem 0.625rem; border-radius: 999px; border: 1px solid transparent; }
.filter-types a:hover { color: var(--text); background: var(--raise); }
.filter-types a[aria-current="true"] { color: var(--text); border-color: var(--accent); background: color-mix(in oklab, var(--accent) 16%, var(--panel)); }
.filter-who { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; font-size: 0.875rem; }
.filter-who select { min-width: 0; max-width: 100%; }
/* Lists that grow (long_list(), inc/layout.php; js/filter-list.js): past 8 items they scroll in place under a filter. */
[data-long] { max-height: min(20rem, 55vh); overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--seam);
  border-radius: var(--radius); padding: 0.25rem 0.5rem; margin: 0; width: 100%; box-sizing: border-box; }
.choices[data-long] { display: grid; gap: 0.375rem; justify-items: start; }   /* one per line, so a filtered list reads cleanly */
.filter-box input { font: inherit; color: var(--text); background: var(--raise); border: 1px solid color-mix(in oklab, var(--muted) 65%, var(--seam));
  border-radius: var(--radius); padding: 0.5rem 0.75rem; min-height: 2.75rem; width: 100%; }
.filter-status:empty { display: none; }
.pick { display: inline-flex; align-items: center; gap: 0.5rem; min-width: 0; max-width: 100%; }   /* a label and its picker stay together */   /* two pickers on a phone: wrap, never widen the page */
.filter-who label { color: var(--muted); }
.filter-who select { font: inherit; color: var(--text); background: var(--raise); border: 1px solid color-mix(in oklab, var(--muted) 65%, var(--seam)); border-radius: var(--radius);
  padding: 0.375rem 0.5rem; min-height: 2.25rem; max-width: 12rem; }

/* "Want to" on a wall card: under the text on phones, its own column when there's room. */
.wall-act { grid-column: 2; margin-top: -0.5rem; }
@media (min-width: 40rem) { .wall-card { grid-template-columns: 5.5rem 1fr auto; } .wall-act { grid-column: 3; grid-row: 1; margin-top: 0; } }
.wall-act .pill { white-space: nowrap; }
.pill wa-icon { vertical-align: -0.125em; }

/* Favourite toggle, and friends on the same title. */
button[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.on-it { display: flex; flex-wrap: wrap; gap: 0.375rem; align-items: center; padding: 0.75rem 1rem; border: 1px solid var(--seam); border-radius: var(--radius); background: var(--panel); }
.friend-g { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.friend-g .grow { color: var(--text); text-decoration: none; }

/* Your earlier Glymps of a title, on add?media=… */
.earlier-head { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* Series (series.php): place, title, your status, take out. */
.series-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--seam); border: 1px solid var(--seam); border-radius: calc(var(--radius) * 2); overflow: hidden; }
.series-list li { background: var(--panel); display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; padding: 0.625rem 0.875rem; }
.series-pos { width: 3.5rem; text-align: center; font-weight: 700; color: var(--muted); }
input.series-pos { font: inherit; color: var(--text); background: var(--raise); border: 1px solid var(--seam); border-radius: var(--radius); padding: 0.375rem; min-height: 2.5rem; }
.series-title { flex: 1; min-width: 12rem; display: grid; grid-template-columns: 2.5rem 1fr; gap: 0.75rem; align-items: center; color: var(--text); text-decoration: none; }
.series-title:hover strong { text-decoration: underline; }
.series-title strong { display: block; }
.pill.done { color: var(--ok); border-color: currentColor; }
.series-add { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: end; }
.series-add .field { flex: 1; min-width: 14rem; }

/* Book formats on a Glymps. */
.formats { display: flex; flex-wrap: wrap; gap: 0.375rem; }

/* Lists inside a card keep the card's side padding (.rows resets padding). */
.rows.card { padding: 0.25rem 1.25rem; gap: 0; }

/* A group's icon on its colour (group_badge(), inc/social.php); plain groups use the muted ink. */
.group-badge { display: inline-grid; place-items: center; width: 2rem; height: 2rem; flex: none; border-radius: 28%;
  color: var(--ink, var(--muted)); background: color-mix(in oklab, var(--ink, var(--muted)) 18%, var(--panel)); }
.ink-none { --ink: var(--muted); }
.group-link { display: flex; align-items: center; gap: 0.75rem; }
.group-head h1 .group-badge { width: 5.5rem; height: 5.5rem; font-size: 2.75rem; }
.group-head .actions { flex: 1 1 20rem; justify-content: flex-end; }
.icon-choices .choice { padding: 0.5rem; min-width: 2.75rem; justify-content: center; }

/* Recommendations (rec_row(), inc/social.php): on Pals with the cover, on the title page without. */
.rec { align-items: center; }
.rec-cover { width: 2.5rem; flex: none; }
.rec-note { display: block; margin-top: 0.25rem; color: var(--muted); font-style: italic; }
.recs-here { margin-bottom: 1rem; }

/* A select in a form field (title page: Add to a group), sized like the text inputs. */
.field select { font: inherit; color: var(--text); background: var(--raise); border: 1px solid color-mix(in oklab, var(--muted) 65%, var(--seam)); border-radius: var(--radius);
  padding: 0.6875rem 0.75rem; min-height: 2.75rem; width: 100%; }

/* Tabs over sections (js/tabset.js): the tab names the section, so its own heading is for screen readers only. */
.tabset { margin-top: 1.5rem; }
.tabs { display: flex; border-bottom: 1px solid var(--seam); margin-bottom: 1rem; }
.tabs[hidden] { display: none; }
.tabs [role="tab"] { font-size: 0.9375rem; }
.tabset.tabbed [role="tabpanel"] > h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* Tier lists (tiers.php, js/tiers.js): a coloured label column, then the row's cards; the tray last. */
/* Rows share the board's label column (subgrid): as narrow as the longest word in it, at least a tap wide. */
.tier-board { display: grid; grid-template-columns: minmax(2.75rem, min-content) minmax(0, 1fr); gap: 2px 0; background: var(--seam); border: 1px solid var(--seam); border-radius: calc(var(--radius) * 2); overflow: hidden; }
.tier-row { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; background: var(--tier-row-bg, var(--panel)); min-height: 5.5rem; }
.tier-head { display: grid; place-items: center; padding: 0.5rem; text-align: center; font: 900 1.5rem/1 var(--display);
  color: var(--ink); background: var(--tier-head-bg, color-mix(in oklab, var(--ink) 16%, var(--panel))); max-width: 8rem; overflow-wrap: break-word; }
.scale-stars .tier-head { font-size: 0.8125rem; letter-spacing: -0.05em; }
.scale-rank .tier-head, .tier-tray .tier-head { font: 700 0.8125rem/1.2 var(--font); color: var(--muted); background: var(--raise); }
.tier-items { list-style: none; margin: 0; padding: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem; align-content: flex-start; min-height: 5rem; }
.scale-rank .tier-items { flex-direction: column; flex-wrap: nowrap; counter-reset: rank; }
.tier-card { display: grid; grid-template-columns: auto 2.5rem minmax(0, 1fr); gap: 0.25rem 0.5rem; align-items: center; width: 15rem; max-width: 100%;
  padding: 0.375rem 0.5rem; border: 1px solid var(--seam); border-radius: var(--radius); background: var(--ground); }
.tier-board:not(.is-own) .tier-card { grid-template-columns: 2.5rem minmax(0, 1fr); }
.scale-rank .tier-items[data-tier="rank"] .tier-card { width: 100%; counter-increment: rank; }
.scale-rank .tier-items[data-tier="rank"] .tier-card::before { content: counter(rank); font: 900 1.125rem/1 var(--display); color: var(--accent); min-width: 1.5rem; }
.scale-rank .tier-items[data-tier="rank"] .tier-card { grid-template-columns: auto auto 2.5rem minmax(0, 1fr); }
.tier-board:not(.is-own).scale-rank .tier-items[data-tier="rank"] .tier-card { grid-template-columns: auto 2.5rem minmax(0, 1fr); }
.tier-card .thumb { width: 2.5rem; }
.tier-ep { display: grid; place-items: center; width: 2.5rem; aspect-ratio: 1; border-radius: 4px; background: var(--raise); font-size: 0.6875rem; font-weight: 700; color: var(--muted); text-align: center; line-height: 1.1; }
.tier-name { min-width: 0; font-size: 0.8125rem; line-height: 1.25; }
.tier-name strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tier-name .hint { display: block; font-size: 0.75rem; }
.tier-grip { grid-row: span 2; display: grid; place-items: center; width: 1.75rem; min-height: 2.75rem; color: var(--muted); cursor: grab; touch-action: none; }
.tier-move { grid-column: -2 / -1; display: flex; gap: 0.375rem; align-items: center; flex-wrap: wrap; }
.tier-move select, .tier-place { font: inherit; font-size: 0.8125rem; color: var(--text); background: var(--raise); border: 1px solid var(--seam);
  border-radius: var(--radius); padding: 0.25rem 0.375rem; min-height: 2rem; }
.tier-place { width: 4rem; }
/* Edit tiers (tiers.php): one row a tier, its colour, name, moves and Remove; wraps on a phone. */
.tier-edit { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.tier-edit li { display: flex; flex-wrap: wrap; align-items: start; gap: 0.5rem; }   /* start: an opened Colours grows down, not the row */
.tier-edit input[type="text"] { flex: 0 1 12rem; width: auto; min-width: 0; }
.tier-edit .check { flex: 1 0 11rem; min-height: 2.75rem; align-items: center; }   /* same basis every row, so all rows break alike */
.tier-swatch { width: 0.75rem; height: 2.75rem; border-radius: var(--radius); background: var(--ink); }
.tier-edit-moves { display: inline-flex; align-items: center; gap: 0.25rem; min-width: 5.5rem; min-height: 2.75rem; }
/* A tier's colours, folded under its name (tier_colour_fields()): Text, Name background and Row background, Light and Dark. */
.tier-colours-fold { flex-basis: 100%; }
/* Where there's room, each tier's Colours sit at the end of its row, so a tier opened shows among the rest; a phone wraps them below. */
.tier-edit .tier-colours-fold { flex: 1 1 20rem; }
.tier-edit .tier-colours-fold summary { line-height: 2.75rem; }   /* level with the row; display stays list-item, keeping the marker */
.tier-scheme .grow { flex: 0 0 6.5rem; min-height: 2.75rem; display: flex; align-items: center; gap: 0.25rem; }
.tier-colours-fold summary { font-size: 0.875rem; color: var(--muted); cursor: pointer; min-height: 2rem; }
.tier-colours { display: flex; flex-wrap: wrap; align-items: end; gap: 0.5rem 1rem; padding-top: 0.5rem; }
.tier-ink { display: inline-flex; align-items: center; gap: 0.5rem; flex-basis: 100%; font-size: 0.875rem; }
html:not(.js) .tier-ink { display: none; }   /* fills the pickers through js/tier-colours.js; posts nothing itself */
.tier-colour-grid { border-collapse: collapse; font-size: 0.875rem; }
.tier-colour-grid th { padding: 0 0.5rem 0.25rem 0; font-weight: 600; text-align: start; vertical-align: middle; }
.tier-colour-grid thead th { max-width: 6rem; vertical-align: bottom; }   /* "Name background" wraps rather than widening a phone */
.tier-colour-grid td { padding: 0 0.5rem 0.375rem 0; }
.tier-sample { display: grid; place-items: center; width: 2.75rem; min-height: 2.75rem; border-radius: var(--radius); font: 900 1rem/1 var(--display);
  color: var(--ink); background: var(--tier-head-bg, color-mix(in oklab, var(--ink) 16%, var(--panel))); box-shadow: inset 0 0 0 1px var(--seam); }
#look-tier > summary { cursor: pointer; font-weight: 600; min-height: 2.75rem; display: flex; align-items: center; }
.tier-colour-grid input[type="color"] { width: 2.75rem; height: 2.75rem; padding: 0.125rem; border: 1px solid var(--seam); border-radius: var(--radius); background: var(--raise); }
.tier-contrast { flex-basis: 100%; margin: 0; }
.tier-move button { min-height: 2rem; padding: 0.25rem 0.625rem; font-size: 0.8125rem; }
.tier-card.is-dragging { opacity: 0.35; }
/* Arranging a list by hand (js/arrange.js: favourites on profile › Arrange, flag reasons on moderation.php): a grip and
   Earlier / Later per row. The drop line is a box-shadow, so nothing moves while dragging. */
.fav-arrange { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.375rem; max-width: 32rem; }
.fav-row { display: grid; grid-template-columns: auto 2.5rem minmax(0, 1fr) auto; gap: 0.5rem; align-items: center;
  padding: 0.25rem; background: var(--panel); border: 1px solid var(--seam); border-radius: var(--radius); }
.fav-row .thumb { width: 2.5rem; }
.fav-name { font-weight: 600; overflow-wrap: break-word; hyphens: auto; }
.fav-moves { display: grid; }   /* Earlier over Later: the title keeps the width on a phone */
.arrange-grip { cursor: grab; touch-action: none; }
.arrange-row.is-dragging { opacity: 0.35; }
.arrange-row.drop-before { box-shadow: inset 0 3px 0 var(--accent); }
.arrange-row.drop-after { box-shadow: inset 0 -3px 0 var(--accent); }
.arrange-ghost { position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; margin: 0;
  box-shadow: 0 8px 24px color-mix(in oklab, var(--text) 25%, transparent); }
body.is-arranging { user-select: none; cursor: grabbing; }
@media (pointer: coarse) { .arrange-row .icon-btn { min-width: 2.75rem; min-height: 2.75rem; } }
.tier-ghost { position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; box-shadow: 0 8px 24px color-mix(in oklab, var(--text) 25%, transparent); }
.tier-marker { width: 0.25rem; min-height: 3.5rem; border-radius: 2px; background: var(--accent); }
.scale-rank .tier-marker { width: 100%; min-height: 0.25rem; }
.tier-badge { display: inline-grid; place-items: center; min-width: 2rem; padding: 0.125rem 0.375rem; border-radius: var(--radius); font-weight: 900;
  color: var(--ink); background: color-mix(in oklab, var(--ink) 16%, var(--panel)); }
.aired .tier-ep { width: auto; aspect-ratio: auto; padding: 0.25rem 0.375rem; }
.tier-mine { color: var(--accent); white-space: nowrap; }   /* a search result you have a Glymps of (tiers.php) */
@media (max-width: 30rem) { .tier-card { width: 100%; } }
/* A ranking's one row and the tray carry their label as a strip on top, not a narrow side column. */
.scale-rank .tier-row, .tier-row.tier-tray { grid-template-columns: 1fr; min-height: 0; }
.scale-rank .tier-head, .tier-tray .tier-head { place-items: center start; padding: 0.5rem 0.75rem; max-width: none; }
/* Tiers with names (tiers.php .named): every row's name in a strip on top, in its colour, so a word never breaks. */
.tier-board.named .tier-row { grid-template-columns: 1fr; min-height: 0; }
.tier-board.named .tier-head { place-items: center start; text-align: start; padding: 0.375rem 0.75rem; font-size: 1rem; line-height: 1.2; overflow-wrap: break-word; max-width: none; }
/* Names beside each row (tier_lists.tier_names, sql/068) when some are long: smaller, wrapping between words. */
.tier-board.names-beside .tier-head { place-items: center start; text-align: start; padding: 0.5rem 0.625rem; font-size: 1rem; line-height: 1.2; overflow-wrap: break-word; }

/* Settings › Share links. */
.share-make { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; }
.share-make .field { flex: 1 1 10rem; }
input[type="date"] { font: inherit; color: var(--text); background: var(--raise); border: 1px solid color-mix(in oklab, var(--muted) 65%, var(--seam)); border-radius: var(--radius); padding: 0.625rem 0.75rem; min-height: 2.75rem; width: auto; max-width: 100%; justify-self: start; }
/* A number box's base: a page or a count, never the whole row. :where() keeps it at zero specificity, so the boxes that
   size their own (.tier-place, .series-pos, .goal-fields, .pick-form…) still win. */
:where(input[type="number"]) { font: inherit; color: var(--text); background: var(--raise); border: 1px solid color-mix(in oklab, var(--muted) 65%, var(--seam));
  border-radius: var(--radius); padding: 0.625rem 0.75rem; min-height: 2.75rem; width: 8rem; max-width: 100%; justify-self: start; }
.share-make input[type="date"] { width: 100%; }   /* fills its share of the row beside "Lasts" */
.rows li.is-expired .copy-field { opacity: 0.55; }
/* Page columns may shrink below their content's natural width (a file picker reports ~350px), so nothing pushes the page
   wider than a phone. */
.page, .narrow { grid-template-columns: minmax(0, 1fr); }

/* Challenges (challenges.php): a bar per goal on a track; a met goal turns the OK colour. One series, one colour. */
.challenge-bars .bar-row { grid-template-columns: 5.5rem 1fr; }
.challenge-bars dd { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; }
.bar-track { display: block; height: 0.625rem; border-radius: 4px; background: var(--raise); overflow: hidden; }
.bar-track .bar { height: 100%; border-radius: 0 4px 4px 0; }
.challenge-bars .is-met .bar { background: var(--ok); }
.challenge-bars .num { font-size: 0.875rem; white-space: nowrap; }
.challenge-bars.compact { gap: 0.25rem; }
.challenge-bars.compact .bar-row dt, .challenge-bars.compact .num { font-size: 0.8125rem; }
.challenge-row, .rows li.challenge-row { display: grid; gap: 0.375rem; align-items: stretch; }
.challenge-row > a { color: var(--text); text-decoration: none; }
.challenge-row > a:hover { text-decoration: underline; }
.goal-fields { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: 0.5rem 0.75rem; }
.goal-fields legend { font-weight: 600; font-size: 0.9375rem; margin-bottom: 0.5rem; }
.goal-fields label { display: grid; gap: 0.25rem; font-size: 0.875rem; }
.goal-fields input, .date-pair input { font: inherit; color: var(--text); background: var(--raise); border: 1px solid var(--seam); border-radius: var(--radius); padding: 0.5rem 0.625rem; min-height: 2.75rem; width: 100%; }
.date-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.75rem; }
/* Challenge goals in a genre, and picked titles (challenges.php). */
.genre-goals { border: 0; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.genre-goals legend { font-weight: 600; font-size: 0.9375rem; margin-bottom: 0.5rem; }
.genre-goal { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.genre-goal input { width: 5rem; }
.genre-goal :is(input, select) { font: inherit; color: var(--text); background: var(--raise); border: 1px solid var(--seam); border-radius: var(--radius);
  padding: 0.5rem 0.625rem; min-height: 2.75rem; max-width: 100%; }
.pick-what { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; }
.pick-what .grow { flex: 1 1 12rem; }
.pick-episode { display: grid; grid-template-columns: repeat(2, minmax(0, 8rem)); gap: 0.75rem; }
.pick-form:not(:has(#pick_type option[value="tv"]:checked)) .pick-episode { display: none; }   /* seasons and episodes: shows only */
.pick-form :is(select, input[type="number"]) { font: inherit; color: var(--text); background: var(--raise); border: 1px solid var(--seam);
  border-radius: var(--radius); padding: 0.5rem 0.625rem; min-height: 2.75rem; max-width: 100%; }
.pick-row { flex-wrap: wrap; }
.pick-row.is-done .grow a { text-decoration: line-through; text-decoration-color: var(--ok); }
.pick-who summary { cursor: pointer; font-size: 0.875rem; }
.pick-who ul { list-style: none; margin: 0.25rem 0 0; padding: 0; font-size: 0.875rem; display: grid; gap: 0.125rem; }
.home-challenges { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }

/* Trending on Home (inc/trending.php): a few titles per tier, each with Up next and Hide. */
.trend-lists { display: grid; gap: 0.75rem; }
.trend-head { font-family: var(--font); font-size: 0.9375rem; font-weight: 700; }
.trend-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.trend-row { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: 0.625rem; align-items: center; }
.trend-text { display: grid; gap: 0.125rem; min-width: 0; }
.trend-text a { color: var(--text); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.trend-text a:hover { text-decoration: underline; }
.trend-meta { display: flex; align-items: center; gap: 0.25rem; }
.trend-meta .hint { flex: 1; font-size: 0.8125rem; }
.you-have { display: inline-grid; place-items: center; min-width: 2.5rem; min-height: 2.5rem; color: var(--accent); }

/* Genres (inc/genres.php): chips on a title's page, the list on the superuser page. */
.genres { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; }
.genre-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.375rem; }
.genre-chips .pill { display: inline-flex; align-items: center; gap: 0.125rem; color: var(--text); }
.genre-chips form { display: contents; }
.genre-chips .icon-btn { min-height: 1.5rem; min-width: 1.5rem; padding: 0.125rem; margin-right: -0.375rem; font-size: 0.75rem; color: var(--muted); }
.genre-add select { max-width: 12rem; }
.suggest-list, .genre-admin { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.suggest-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0.5rem 0.75rem; align-items: center;
  padding-bottom: 0.5rem; border-bottom: 1px solid var(--seam); }
.suggest-row > div { display: grid; gap: 0.125rem; }
@media (max-width: 30rem) { .suggest-row { grid-template-columns: minmax(0, 1fr) auto; } .suggest-row > div { grid-column: 1 / -1; } }
.genre-admin { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.genre-box { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.125rem 0.25rem; padding: 0.125rem 0.125rem 0.125rem 0.75rem;
  border: 1px solid var(--seam); border-radius: var(--radius); background: var(--panel); }
.genre-box .genre-name { margin-right: 0.25rem; }
.genre-box > form:last-child { margin-left: 0.375rem; }   /* a gap before the destructive one */
.genre-rename > summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; border-radius: var(--radius); }
.genre-rename > summary::-webkit-details-marker { display: none; }
.genre-rename[open] { flex-basis: 100%; order: 3; }
.genre-rename form { padding: 0.25rem 0.5rem 0.375rem 0; }
.genre-rename input { min-height: 2.25rem; padding: 0.375rem 0.5rem; width: 12rem; }
.profile-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }

/* A heading with a small link at its right (Settings › Passkeys: "What are passkeys?"). */
.heading-row { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: baseline; justify-content: space-between; }
.heading-aside { font-size: 0.875rem; }

/* An on/off switch: a native checkbox (role="switch") drawn as a track and thumb from tokens. */
.switch { display: inline-flex; align-items: center; gap: 0.75rem; min-height: 2.75rem; font-weight: 600; cursor: pointer; }
.switch input { appearance: none; width: 2.75rem; height: 1.5rem; margin: 0; flex: none; border-radius: 999px; position: relative; cursor: pointer;
  background: var(--raise); border: 1px solid var(--muted); transition: background 0.15s; }
.switch input::before { content: ""; position: absolute; top: 2px; left: 2px; width: 1.125rem; height: 1.125rem; border-radius: 50%;
  background: var(--muted); transition: translate 0.15s; }
.switch input:checked { background: var(--accent); border-color: var(--accent); }
.switch input:checked::before { translate: 1.25rem 0; background: var(--on-accent); }
.switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .switch input, .switch input::before { transition: none; } }
.challenge-name { display: flex; align-items: center; gap: 0.625rem; }
.challenge-title { display: flex; align-items: center; gap: 0.75rem; }
.challenge-title .group-badge { width: 2.75rem; height: 2.75rem; font-size: 1.375rem; }

/* Show password (field(), js/reveal.js): the eye sits inside the input's right edge. */
.reveal-wrap { position: relative; display: block; }
.reveal-wrap input { padding-right: 3rem; }
.reveal { position: absolute; top: 0; right: 0; height: 100%; min-height: 2.75rem; width: 2.75rem; padding: 0; display: grid; place-items: center;
  background: none; border: 0; color: var(--muted); }
.reveal:hover, .reveal[aria-pressed="true"] { color: var(--text); background: none; }
.reveal:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Feed blocks stand apart, each on its own surface (room for people's own looks later), in a centred column. */
.console > .wall { background: var(--ground); }
.wall-list, .wall .wall-filters { width: 100%; max-width: 40rem; margin-inline: auto; }
.wall-feed { display: grid; gap: 1.25rem; }
.results li[id] { scroll-margin-top: 5rem; }   /* "More results" lands below the sticky top bar */
[aria-busy="true"] { opacity: 0.6; transition: opacity 120ms; }
.wall-list { display: grid; gap: 0.75rem; background: none; border: 0; border-radius: 0; overflow: visible; }
.wall-card { border: 1px solid var(--seam); border-radius: calc(var(--radius) * 2); }
.wall-more { background: none; padding: 0.5rem; }
.wall-empty { margin-inline: auto; }
.profile-page { max-width: 56rem; margin-inline: auto; }
.shelves { gap: 1rem; background: none; border: 0; border-radius: 0; overflow: visible; }
@media (min-width: 40rem) { .shelves { grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); } }
.shelves > section { border: 1px solid var(--seam); border-radius: calc(var(--radius) * 2); }
/* Signed out past the gate: just the wordmark and Sign in. */
.top-out { justify-content: space-between; }

/* About (about.php) and the quiet links to it. */
.about { gap: 1.75rem; }
.about-lead { font: 800 clamp(1.375rem, 1.1rem + 1vw, 1.875rem)/1.25 var(--display); letter-spacing: -0.01em; max-width: 30ch; }
.about section > h2 { margin-bottom: 0.375rem; }
.about p { max-width: 65ch; line-height: 1.6; }
.thanks { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.375rem; }
.about-link { text-align: center; font-size: 0.875rem; padding: 1rem; }
.danger-zone { border-color: color-mix(in oklab, var(--danger) 45%, var(--seam)); }
/* Footer: Privacy left, About centred, the credit right. */
.site-foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; }
.site-foot > :nth-child(2) { justify-self: center; }
.site-foot > :last-child { justify-self: end; text-align: right; white-space: nowrap; }
.site-foot { gap: 0.75rem; }
/* A phone: Privacy and About on one row, the credit centred below, so "About" never runs into it. */
@media (max-width: 30rem) {
  .site-foot { grid-template-columns: 1fr auto; }
  .site-foot > :nth-child(2) { justify-self: end; }
  .site-foot > :last-child { grid-column: 1 / -1; justify-self: center; text-align: center; }
}


/* Themes (inc/themes.php, theme-css): a themed area re-reads its own font and text colour, its page picture, and its
   cards' border width and picture. Without a theme these fall back to today's look. */
[class^="th-"], [class*=" th-"], [class^="tt-"], [class*=" tt-"] { font-family: var(--font); color: var(--text); }   /* tt-: a list's own theme */
body:is([class*="th-"], [class*="tt-"]), :root[class*="th-"] body { background-color: var(--ground); background-image: var(--page-image, none);
  background-size: var(--page-size, cover); background-repeat: var(--page-repeat, no-repeat); background-attachment: fixed; background-position: center; }
.card, .wall-card, .shelves > section { border-width: var(--card-border-w, 1px); background-color: var(--card-fill, var(--panel));
  background-image: var(--card-image, none); background-size: var(--card-size, cover); background-position: center; }
/* Cards per place (inc/themes.php CARD_PLACES): the base --card-* are your home's on your own pages and the owner's
   "elsewhere" inside their theme; a profile has its own. A new place is one more rule like this. */
.profile-page :is(.card, .wall-card, .shelves > section), .theme-preview .preview-card {
  background-color: var(--card-fill-profile, var(--card-fill, var(--panel))); background-image: var(--card-image-profile, var(--card-image, none));
  background-size: var(--card-size-profile, var(--card-size, cover)); }
.theme-preview .preview-elsewhere { background-color: var(--card-fill-elsewhere, var(--card-fill, var(--panel)));
  background-image: var(--card-image-elsewhere, var(--card-image, none)); background-size: var(--card-size-elsewhere, var(--card-size, cover)); }
/* Text straight on a theme's page picture gets a snug backing in the page colour, so it reads over any picture. The
   values come from theme-css only when the theme has a page picture; otherwise they're zero and nothing changes. Cards
   and panels have their own background. The list is the text found sitting on the page, checked page by page. */
:is(.page, .narrow) > :is(h1, h2, p, ul, .profile-links):not(.card), .about > section > :is(h2, p, ul), .profile-head .stack > *,
.group-head > h1, :is(.page, .narrow, .group-grid) > section.stack > :is(h2, p), .glymps-page article > p,
.chosen .stack > :is(h1, h2, p), .favourites .card-title {
  background-color: var(--plate, transparent); padding: var(--plate-y, 0) var(--plate-x, 0); margin-inline: calc(var(--plate-x, 0px) * -1);
  border-radius: var(--radius); width: fit-content; max-width: calc(100% + 2 * var(--plate-x, 0px)); }
.filter-types a, :is(.profile-head, .glymps-page) .pill { background-color: var(--plate, transparent); }

/* Theme builder (themes.php, js/theme-builder.js): controls beside a live preview; stacked on a phone. */
.builder-grid { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 60rem) { .builder-grid { grid-template-columns: minmax(20rem, 26rem) 1fr; } .builder-preview-wrap { position: sticky; top: 5rem; } }
.builder-colours { border: 0; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.builder-colours legend, .builder-image legend { font-weight: 600; font-size: 0.9375rem; margin-bottom: 0.5rem; }
.builder-image { border: 0; padding: 0; margin: 0; }
/* Only the controls for the chosen background and card fill show (themes.php, sql/089). */
.builder-page:has([name="page_mode"][value="colour"]:checked) .when-page-image,
.builder-page:has([name="page_mode"][value="image"]:checked) .when-page-colour,
.builder-card:not(:has(.card-place [value="image"]:checked)) .when-card-image,
.builder-card:not(:has(.card-place :is([value="image"], [value="page"]):checked)) .when-card-picture,
.builder-card:not(:has(.card-place [value="colour"]:checked)) .when-colour-used,
#builder:has([name="page_mode"][value="colour"]:checked) .when-page-picture { display: none; }
.card-place legend .hint { display: block; font-weight: 400; }
.builder-sub { font-weight: 600; font-size: 0.9375rem; margin: 0; }
.colour-row { display: grid; grid-template-columns: 1fr 3rem auto; gap: 0.75rem; align-items: center; }
.colour-row input[type="color"] { width: 3rem; height: 2.5rem; padding: 0.125rem; border: 1px solid var(--seam); border-radius: var(--radius); background: var(--raise); cursor: pointer; }
.range-field label { display: flex; justify-content: space-between; }
.range-field input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 2.75rem; }
.contrast { display: flex; flex-wrap: wrap; gap: 0.375rem; margin: 0.25rem 0 0; }
.badge-contrast { font-size: 0.75rem; padding: 0.125rem 0.5rem; border-radius: 999px; border: 1px solid currentColor; }
.badge-contrast.is-good { color: var(--ok); }
.badge-contrast.is-warn { color: var(--now); }
.badge-contrast.is-bad { color: var(--danger); font-weight: 700; }
.choice.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; }
.theme-preview { display: grid; gap: 1rem; padding: 1.25rem; border: 1px solid var(--seam); border-radius: calc(var(--radius) * 2);
  background-color: var(--ground); background-image: var(--page-image, none); background-size: var(--page-size, cover);
  background-repeat: var(--page-repeat, no-repeat); background-position: center; color: var(--text); }
.preview-where { margin: 0 0 -0.5rem; font-size: 0.8125rem; font-weight: 600; color: var(--text); background-color: var(--plate, transparent); width: fit-content; padding: 0 var(--plate-x, 0); border-radius: var(--radius); }
.preview-head { display: flex; align-items: center; gap: 0.75rem; font: 800 1.25rem/1.2 var(--display); }
.preview-avatar { width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--accent); flex: none; }
.preview-covers { display: grid; grid-template-columns: repeat(3, minmax(0, 5rem)); gap: 0.75rem; }
.preview-wall .cover { width: 100%; }
.theme-preview .button { pointer-events: none; }

/* The notice a background save shows (js/ajax.js): bottom centre, gone after a few seconds. */
.notice { position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom)); translate: -50% 0; z-index: 60; max-width: min(28rem, calc(100vw - 2rem));
  margin: 0; padding: 0.75rem 1rem; border-radius: calc(var(--radius) * 2); background: var(--text); color: var(--ground);
  font-weight: 600; box-shadow: 0 8px 24px color-mix(in oklab, var(--text) 25%, transparent); }
[aria-busy="true"] { opacity: 0.7; transition: opacity 0.2s; }

/* About @name on a profile: folded away until opened. */
.bio { border: var(--card-border-w, 1px) solid var(--seam); border-radius: calc(var(--radius) * 2); background: var(--panel); padding: 0.75rem 1rem; }
.bio summary { cursor: pointer; font-weight: 700; min-height: 1.75rem; display: flex; align-items: center; }
.bio p { margin: 0.5rem 0 0; max-width: 65ch; line-height: 1.6; overflow-wrap: anywhere; }
.bio summary, .fold > summary { list-style: none; gap: 0.5rem; }
.bio summary::-webkit-details-marker, .fold > summary::-webkit-details-marker { display: none; }
.bio summary::after, .fold > summary::after { content: ""; margin-left: auto; width: 0.5rem; height: 0.5rem; border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor; rotate: 45deg; translate: 0 -2px; transition: rotate 0.15s; flex: none; }
.bio[open] summary::after, .fold[open] > summary::after { rotate: 225deg; translate: 0 2px; }
@media (prefers-reduced-motion: reduce) { .bio summary::after, .fold > summary::after { transition: none; } }
/* A card folded to its heading (settings): the whole heading row opens it. */
.fold > summary { display: flex; align-items: center; cursor: pointer; min-height: 2.75rem; margin: -0.75rem -0.5rem; padding: 0.75rem 0.5rem;
  border-radius: var(--radius); }
.fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fold > summary h2 { margin: 0; scroll-margin-top: 5rem; }
.fold :target { scroll-margin-top: 5rem; }   /* a link into a fold (js/open-target.js) lands below the sticky top bar */
.cover-missing { margin: 0.5rem 0 0; padding-left: 1.25rem; display: grid; gap: 0.75rem; }   /* Superuser › Covers: titles still without one */
.cover-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.25rem; }
.cover-upload input[type="file"] { flex: 1 1 12rem; min-width: 0; }
.cover-manual { margin: 0.5rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; }
.cover-manual li { display: flex; align-items: center; gap: 0.75rem; }
.cover-manual a { flex: 1; min-width: 0; }
.cover-manual .thumb { width: 2.5rem; flex: none; }
/* Each section's icon, for a little colour in the list; the heading carries the name (the icon is aria-hidden). */
.fold > summary > wa-icon { flex: none; width: 1.25em; font-size: 1.125rem; color: var(--accent); }
.danger-zone > summary > wa-icon { color: var(--danger); }
/* A plain block, not the card's grid: inside <details> a grid lets content grow wider than the card, and its gap never
   reaches the content anyway, so the spacing is margins. */
.fold { display: block; }
.fold > :not(summary) { margin-top: 1rem; }
/* Fields for an option that isn't picked stay out of the way (a browser without :has() shows them all). */
@supports selector(:has(a)) {
  form:has(input[name="status"]) :is(.finished-on, .started-on) { display: none; }
  form:has(input[name="status"][value="done"]:checked) .finished-on,
  form:has(input[name="status"]:is([value="now"], [value="done"]):checked) .started-on { display: grid; }
  .date-field:has(input[type="checkbox"]:checked) input[type="date"] { display: none; }   /* "I don’t remember" */
  .share-make .share-date, .tier-new :is(.tier-series, .tier-show) { display: none; }
  .share-make:has(option[value="date"]:checked) .share-date,
  .tier-new:has(input[name="source"][value="series"]:checked) .tier-series,
  .tier-new:has(input[name="source"][value="show"]:checked) .tier-show { display: grid; }
}

/* Live group review (js/review-live.js): who's in the box, and how saving is going. */
.review-who { margin: 0; font-size: 0.8125rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0.375rem; align-items: center; }
.who-chip { padding: 0.125rem 0.5rem; border-radius: 999px; font-weight: 700; color: var(--ink, var(--text)); background: color-mix(in oklab, var(--ink, var(--muted)) 16%, var(--panel)); }
.review-status { font-size: 0.8125rem; }
/* A see-through layer over the live review box: who wrote what while editing together, and the others' cursors. It
   copies the box's type, padding, border and wrapping, so every mark lands on its words; clicks pass through it. */
.review-pad { position: relative; }
.review-pad textarea { display: block; }
.review-marks { position: absolute; inset: 0; overflow: hidden; padding: 0.6875rem 0.75rem; border: 1px solid transparent;
  border-radius: var(--radius); color: transparent; white-space: pre-wrap; overflow-wrap: break-word; pointer-events: none; }
.review-marks .mark-by { background: color-mix(in oklab, var(--ink) 16%, transparent); text-decoration: underline 2px var(--ink);
  text-underline-offset: 0.2em; }
.review-marks .mark-caret { position: relative; border-left: 2px solid var(--ink); margin: 0 -1px; }
.review-marks .mark-caret::after { content: attr(data-name); position: absolute; bottom: 100%; left: -2px; padding: 0 0.25rem;
  border-radius: 3px 3px 3px 0; font-size: 0.6875rem; font-weight: 700; line-height: 1.4; white-space: nowrap;
  color: var(--panel); background: var(--ink); }
.review-marks .mark-caret.flip::after { bottom: auto; top: 100%; border-radius: 0 3px 3px 3px; }

/* The review box's toolbar (review_tools(), js/review-tools.js) and what its markers become (review_html()). Text and
   highlight colours are the ink names, so they have light and dark values like everything else. */
.rt-tools { display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.rt-tools[hidden] { display: none; }
.rt-btn { min-height: 2.75rem; min-width: 2.75rem; padding: 0.5rem; display: inline-grid; place-items: center; background: none;
  border: 1px solid transparent; border-radius: var(--radius); color: var(--text); cursor: pointer; list-style: none; }
.rt-btn::-webkit-details-marker { display: none; }
.rt-btn:hover, .rt-pop[open] > .rt-btn { background: var(--raise); }
.rt-btn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.rt-pop { position: relative; }
.rt-swatches { position: absolute; z-index: 5; top: 100%; left: 0; display: grid; gap: 1px; min-width: 9rem; padding: 0.25rem;
  background: var(--panel); border: 1px solid var(--seam); border-radius: var(--radius); box-shadow: 0 6px 18px color-mix(in oklab, var(--text) 18%, transparent); }
.rt-swatch { display: flex; gap: 0.5rem; align-items: center; min-height: 2.5rem; padding: 0.25rem 0.5rem; text-align: start;
  background: none; border: 0; border-radius: var(--radius); color: var(--text); cursor: pointer; }
.rt-swatch:hover { background: var(--raise); }
.rt-dot { width: 0.875rem; height: 0.875rem; border-radius: 50%; background: var(--ink); flex: none; }
.rt-wide { display: none; }
@media (min-width: 60rem) { .rt-wide { display: inline-grid; } }   /* only where the People column sits beside the box */
.group-grid.wide { grid-template-columns: 1fr; }
.group-grid.wide > aside { display: none; }
.rt-mode { margin-left: auto; min-width: 5.5rem; font-weight: 600; border-color: var(--seam); }   /* Edit ⇄ Preview, at the toolbar's end */
form.previewing .review-pad, form.previewing textarea { display: none; }
form.previewing .rt-tools > :not(.rt-mode, .rt-wide) { display: none; }
.rt-preview { display: grid; gap: 0.25rem; }
.rt-preview[hidden] { display: none; }
.rt-preview h4 { margin: 0; font-size: 0.8125rem; color: var(--muted); }
.rt-preview .note { padding: 0.6875rem 0.75rem; border: 1px dashed var(--seam); border-radius: var(--radius); min-height: 9rem; }
.rt-fg { color: var(--ink); }
.rt-bg { background: color-mix(in oklab, var(--ink) 28%, transparent); color: inherit; padding: 0 0.1em; border-radius: 2px; }
.note ul { margin: 0.25rem 0; padding-left: 1.25rem; }

/* Between pages: a quick cross-fade (the browser's own view transition; nothing for reduced motion, and browsers
   without it just change page). The top bar is matched across pages, so it holds still while the page fades. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 120ms; }
}
.top { view-transition-name: top-bar; }

/* Your own lists (inc/lists.php, lists.php). The favourite button's arrow opens your lists under it (favourite_button()). */
.split-button { position: relative; display: inline-flex; }
.split-button > form > button { border-start-end-radius: 0; border-end-end-radius: 0; }
.split-more > summary { list-style: none; border-start-start-radius: 0; border-end-start-radius: 0; margin-inline-start: -1px; padding-inline: 0.75rem; cursor: pointer; }
.split-more > summary::-webkit-details-marker { display: none; }
.split-more[open] > summary { background: var(--raise); }
.menu-pop { position: absolute; z-index: 30; top: calc(100% + 0.25rem); left: 0; width: max-content; min-width: 14rem; max-width: min(22rem, calc(100vw - 2rem));
  padding: 0.375rem; background: var(--panel); border: 1px solid var(--seam); border-radius: calc(var(--radius) * 2);
  box-shadow: 0 8px 24px color-mix(in oklab, var(--text) 25%, transparent); }
.menu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.125rem; }
.menu-item { display: flex; align-items: center; gap: 0.5rem; width: 100%; min-height: 2.75rem; padding: 0.5rem 0.75rem; text-align: start;
  font-weight: 500; color: var(--text); background: none; border: 0; text-decoration: none; }
.menu-item:hover { background: var(--raise); }
.menu-item[aria-pressed="true"] { font-weight: 700; }
.menu-item .hint { margin-inline-start: auto; }
/* A list's card on a profile wears the list's theme: its own panel, so the theme shows. */
.list-card[class*=" tt-"] { padding: 0.375rem; background: var(--panel); border-radius: var(--radius); }
.list-empty { place-items: center; font-size: 1.5rem; color: var(--muted); aspect-ratio: 2 / 3; }
.list-card .hint { font-size: 0.75rem; }
.list-shelf[class*="tt-"] { padding: 0.75rem; background: var(--ground); color: var(--text); border-radius: calc(var(--radius) * 2); }
.fav-moves .push-end { margin-top: 0.5rem; }   /* a gap before Remove */
/* A group's own picture in place of its icon (group_badge(), sql/071), in the shape its admins picked. */
.group-pic { object-fit: cover; padding: 0; background: var(--raise); }
.group-pic.shape-circle { border-radius: 50%; }
.group-pic.shape-square { border-radius: 3px; }
/* An emoji in place of a group's or challenge's icon (group_badge()), and a group's own emoji (group.php). */
.emoji-badge .emoji { font-size: 1.125rem; line-height: 1; }
.challenge-title .emoji-badge .emoji { font-size: 1.5rem; }
.group-head h1 .emoji-badge .emoji { font-size: 3rem; }
.icon-emoji { width: 5rem; font-size: 1.25rem; text-align: center; }
.emoji-pick { display: grid; gap: 0.375rem; margin-top: 0.375rem; }
.group-emoji { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 0.25rem 0.75rem; }
.group-emoji li { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.group-emoji .grow { overflow-wrap: anywhere; font-size: 0.875rem; }
.react-option.own { border: 2px solid var(--accent); }   /* a group's own emoji in the search (js/emoji-search.js) */

/* Now listening (Last.fm, inc/lastfm.php; js/listening.js): the art, the track and artist, a link to the profile. */
.listening { display: grid; gap: 0.5rem; padding: 0.75rem; margin-bottom: 1rem; }
.listening[hidden] { display: none; }
.listening:empty { height: 1px; padding: 0; margin: 0; border: 0; background: none; }   /* nothing playing: still watched */
.listening-title { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin: 0; font-size: 1rem; }
.listening-title time { font-size: 0.8125rem; font-weight: 400; }
.listening-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--ok); }
.listening-now { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.listening-art { flex: none; width: 4rem; height: 4rem; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); background: var(--raise); }
.listening-art.blank { display: grid; place-items: center; font-size: 1.5rem; color: var(--muted); }
.listening-text { display: grid; gap: 0.125rem; min-width: 0; }
.listening-track { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.listening-artist, .listening-album { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.listening-album { font-size: 0.8125rem; }
.listening-who { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.875rem; min-height: 2.75rem; }
.shelf > .listening:last-child { margin: 1rem 0 0; }   /* placed under what you're glympsing (Settings › Last.fm) */
/* A group's own emoji in a review (::name::, review_html()): on the line with the text. */
.note .emoji-img { vertical-align: -0.2em; }
.rt-emoji { width: min(20rem, calc(100vw - 3rem)); max-height: 20rem; overflow: auto; }
.rt-tools { position: relative; }
.rt-pop.emoji-fold { position: static; }   /* the emoji search opens from the toolbar's start, so it fits on a phone */
