/* Contrast + focus layer shared by every 39charts page. Loaded last so it
   wins over each page's inline tokens without touching type sizes. Every
   value below was picked to clear WCAG AA (4.5:1) on the panel greys. */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --faint: #5c5c5c;          /* was #999 → 2.4:1, now 4.5:1 on #d8d4cb */
  --link: #0055b3;           /* was #0066cc → 4.0:1 on the footer */
}
html.dark-mode {
  --faint: #969696;          /* was #7c7c7c → 4.0:1 on the dark panels */
}

/* ── Chrome ─────────────────────────────────────────────── */
.nnd-topbar { color: #8c8c8c; }                       /* was #777 → 4.2:1, now 5.6:1 on #111 */
.nnd-topbar-right,
.nnd-topbar > span[style] { color: #a0a0a0 !important; } /* was #666 → 3.3:1; inline on some pages */
.nnd-marquee-label { background: #8a6400; }           /* white 5.4:1 */
html.dark-mode .nnd-marquee-label { background: #6e5a10; }

/* Podium headers: same bevel, one step darker so white text reads. */
.podium-gold .podium-header {
  background: linear-gradient(to bottom, #9c7208 0%, #84600a 48%, #6d4f05 52%, #7f5c07 100%);
  border-bottom-color: #4f3903;
}
.podium-silver .podium-header {
  background: linear-gradient(to bottom, #777 0%, #6a6a6a 48%, #555 52%, #626262 100%);
  border-bottom-color: #404040;
}

/* add.html Fetch button: keep the red bevel, start it darker. */
.fetch-btn {
  background: linear-gradient(to bottom, #cc3333 0%, #c01c1c 48%, #a50000 52%, #b30000 100%);
}

/* ── Vocalist chips in dark mode ───────────────────────── */
/* The preset chips keep their light-mode ink on a near-black chip, which
   drops to ~1.8:1. Lift the ink toward white from each chip's own hue,
   the same formula chip-colors.js uses for tinted chips. */
.vtag-miku   { --chip: #39c5bb; }
.vtag-rin    { --chip: #f5a623; }
.vtag-len    { --chip: #d4b800; }
.vtag-luka   { --chip: #e91e8c; }
.vtag-gumi   { --chip: #43a047; }
.vtag-ia     { --chip: #9c27b0; }
.vtag-kaito  { --chip: #3949ab; }
.vtag-meiko  { --chip: #e53935; }
.vtag-teto   { --chip: #d44466; }
.vtag-flower { --chip: #9040a0; }
.vtag-kafu   { --chip: #b48ad8; }
.vtag-una    { --chip: #e08000; }
.vtag-yuki   { --chip: #b09000; }
.vtag-rei    { --chip: #cc3080; }
.vtag-defoko { --chip: #6080a0; }
html.dark-mode .vtag:is(.vtag-miku, .vtag-rin, .vtag-len, .vtag-luka, .vtag-gumi, .vtag-ia,
  .vtag-kaito, .vtag-meiko, .vtag-teto, .vtag-flower, .vtag-kafu, .vtag-una, .vtag-yuki,
  .vtag-rei, .vtag-defoko) {
  background: color-mix(in srgb, var(--chip) 22%, #141414);
  color: color-mix(in srgb, var(--chip) 55%, #fff);
}
html.dark-mode .vtag-guest { color: #a8a8a8; }

/* Chips laid over cover art need their own backing to stay legible. */
.thumb-vtags .vtag-other { background: #f2f0eb; }
html.dark-mode .thumb-vtags .vtag { background-color: #141414; }
html.dark-mode .thumb-vtags .vtag:is(.vtag-tint, .vtag-miku, .vtag-rin, .vtag-len, .vtag-luka,
  .vtag-gumi, .vtag-ia, .vtag-kaito, .vtag-meiko, .vtag-teto, .vtag-flower, .vtag-kafu,
  .vtag-una, .vtag-yuki, .vtag-rei, .vtag-defoko) {
  background: color-mix(in srgb, var(--chip) 30%, #141414);
}

/* ── Keyboard focus ─────────────────────────────────────── */
/* Pages strip outlines from inputs and buttons; give keyboard users one
   consistent ring in the site red. Mouse clicks stay ring-free. */
:focus-visible {
  outline: 2px solid var(--red, #cc0000) !important;
  outline-offset: 2px;
}
html.dark-mode :focus-visible { outline-color: #ff5a5a !important; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; }

/* Skip link: hidden until focused. */
.skip-link {
  position: absolute; left: 8px; top: -40px; z-index: 1000;
  padding: 6px 10px; background: #111; color: #fff; font-size: 12px; font-weight: 700;
  border: 2px solid var(--red, #cc0000);
}
.skip-link:focus { top: 8px; color: #fff; text-decoration: none; }

/* Sortable header buttons inherit the header look. */
.th-sort-btn {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 3px;
  font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit;
}

/* Visually hidden but announced. */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

::selection { background: #cc0000; color: #fff; }
html.dark-mode ::selection { background: #aa1818; color: #fff; }
