/* BFCM dashboard styles. Fonts, tokens and text styles copied from the theme (assets/tokens.css +
   assets/base.css) through the Rivo x2 CS list template. Flat CSS, no build step.
   No font-variant-numeric: tabular-nums anywhere: Unica 77's tnum switches to mono-style glyphs. */

/* ---------- Fonts (same files as the theme) ---------- */
@font-face {
  font-family: "Unica 77";
  src: url("https://cdn.shopify.com/s/files/1/0229/9415/7645/files/Unica77LLWeb-Regular.woff2?v=1686537941")
    format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Unica 77";
  src: url("https://cdn.shopify.com/s/files/1/0563/1082/5030/files/Unica77LLWeb-Medium.woff2?v=1649784250")
    format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Unica 77 Mono";
  src: url("https://cdn.shopify.com/s/files/1/0563/1082/5030/files/Unica77MonoLLWeb-Regular.woff2?v=1649784233")
    format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* ---------- Tokens (from assets/tokens.css) ---------- */
:root {
  color-scheme: light;

  --grid-size: 0.25rem;
  --space-xs: 0.25rem;
  --space-sm: 0.375rem;
  --space-base: 0.5rem;
  --space-med: 0.75rem;
  --space-lg: 1rem;
  --space-xl: 1.25rem;
  --space-2xl: 1.5rem;
  --space-3xl: 2rem;
  --space-5xl: 3rem;
  --space-7xl: 4rem;

  --site-padding-inline: var(--space-med);

  --font-sans: "Unica 77", sans-serif;
  --font-mono: "Unica 77 Mono", monospace;
  --text-10: 0.625rem;
  --text-12: 0.75rem;
  --text-13: 0.8125rem;
  --text-14: 0.875rem;
  --text-15: 0.9375rem;
  --text-16: 1rem;
  --text-18: 1.125rem;
  --text-24: 1.5rem;
  --text-28: 1.75rem;
  --text-32: 2rem;
  --text-40: 2.5rem;
  --text-56: 3.5rem;
  --text-72: 4.5rem;

  --font-headline: var(--text-32);
  --font-title-lg: var(--text-24);
  --font-body-lg: var(--text-16);
  --font-body: var(--text-15);
  --font-body-sm: var(--text-13);
  --font-caption: var(--text-12);
  --font-label: var(--text-12);
  --font-label-sm: var(--text-10);

  --ls-neg-1: -.01em;
  --ls-neg-2: -.02em;
  --lh-xs: .9em;
  --lh-sm: 1em;
  --lh-base: 1.15em;
  --lh-md: 1.25em;
  --lh-lg: 1.3em;
  --lh-xl: 1.4em;

  --site-background: #fff;
  --site-nested-background: #f5f5f5;
  --color-white: #fff;
  --color-black: #000;
  --color-neutral-100: #f3f3f3;
  --color-neutral-200: #e3e3e3;
  --color-neutral-300: #bebebe;
  --color-neutral-500: #808080;
  --color-neutral-600: #5c5c5c;
  --color-alert-red: #bd0707;
  --border-opaque: #e4e4e4;
  --border-black: #000;
  --text-primary: var(--color-black);
  --text-primary-inv: var(--color-white);
  --text-secondary: var(--color-neutral-500);
  --text-tertiary: var(--color-neutral-300);
  --border-max: 999vw;
  --ss-bezier-1: cubic-bezier(0.2, 0.14, 0.1, 1.01);
  --focus-ring-color: var(--color-black);
  --focus-ring-width: 2px;
  --focus-ring-offset: 2px;

  /* Class Wars colors (theme tokens). Idol's yellow is too light for a thin mark on white, so every
     Idol mark also gets a darker edge. */
  --class-scholar: #221f20;
  --class-noble: #3154a1;
  --class-idol: #fbd865;
  --class-idol-edge: #a8850f;
  --class-warrior: #da3832;
}
@media (min-width: 51.25rem) {
  :root {
    --site-padding-inline: var(--space-lg);
    --font-headline: var(--text-40);
    --font-body-sm: var(--text-14);
  }
}
@media (min-width: 64rem) {
  :root {
    --font-body: var(--text-16);
    --font-body-lg: var(--text-18);
  }
}
@media (min-width: 80rem) {
  :root {
    --site-padding-inline: var(--space-3xl);
  }
}
@supports (width: round(1px, 1px)) {
  :root {
    --lh-xs: round(0.9em, var(--grid-size));
    --lh-sm: round(1em, var(--grid-size));
    --lh-base: round(1.15em, var(--grid-size));
    --lh-md: round(1.25em, var(--grid-size));
    --lh-lg: round(1.3em, var(--grid-size));
    --lh-xl: round(1.4em, var(--grid-size));
  }
}

/* ---------- Text styles (from assets/base.css) ---------- */
.headline {
  font-size: var(--font-headline);
  font-weight: 500;
  letter-spacing: var(--ls-neg-2);
  line-height: var(--lh-sm);
}
.title-lg {
  font-size: var(--font-title-lg);
  letter-spacing: var(--ls-neg-1);
  line-height: var(--lh-sm);
}
.body-lg {
  font-size: var(--font-body-lg);
  letter-spacing: var(--ls-neg-1);
  line-height: var(--lh-lg);
}
.body {
  font-size: var(--font-body);
  letter-spacing: var(--ls-neg-1);
  line-height: var(--lh-lg);
}
.body-sm {
  font-size: var(--font-body-sm);
  line-height: var(--lh-base);
}
.caption {
  font-size: var(--font-caption);
  letter-spacing: var(--ls-neg-2);
  line-height: var(--lh-md);
}
.label {
  font-size: var(--font-label);
  letter-spacing: var(--ls-neg-2);
  line-height: var(--lh-base);
}
.label-sm {
  font-size: var(--font-label-sm);
  line-height: var(--lh-base);
}
.bold {
  font-weight: 500;
}
.text-upper {
  text-transform: uppercase;
}
.mono {
  font-family: var(--font-mono);
}

/* ---------- Page ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--site-background);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
h4,
p,
ol,
ul,
dl,
dd {
  margin: 0;
}
ol,
ul {
  padding: 0;
  list-style: none;
}
a {
  color: inherit;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
/* The logo's one <symbol>: in the page but never drawn itself. */
.db-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
/* First focusable element; off screen until it gets focus. */
.db-skip {
  position: absolute;
  top: var(--space-med);
  left: var(--space-med);
  z-index: 20;
  padding: var(--space-sm) var(--space-med);
  border: 1px solid var(--border-black);
  border-radius: var(--border-max);
  background: var(--site-background);
  text-decoration: none;
  transform: translateY(-300%);
}
.db-skip:focus {
  transform: none;
}
.db-link {
  text-underline-offset: 0.2em;
}
.db-link:hover {
  text-decoration-thickness: 2px;
}

/* ---------- Sign-in, message and loading: the full-page layout ---------- */
.db-page {
  max-width: 100rem;
  margin: 0 auto;
  padding: var(--space-3xl) var(--site-padding-inline) var(--space-7xl);
  display: grid;
  gap: var(--space-5xl);
}
.db-page > * {
  min-width: 0;
}

/* ---------- Header ---------- */
.db-head {
  display: grid;
  gap: var(--space-lg);
}
.db-head__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-med);
  margin-bottom: var(--space-2xl);
}
.db-head__logo {
  display: block;
  width: 9rem;
  height: auto;
  aspect-ratio: 2318 / 209;
}
.db-head__eyebrow {
  color: var(--text-secondary);
}
.db-head__lede {
  max-width: 40rem;
  line-height: var(--lh-xl);
  text-wrap: pretty;
}
@media (min-width: 51.25rem) {
  .db-head__logo {
    width: 12rem;
  }
}

/* ---------- Shell: the menu beside the content from 64rem; below that, a top bar and a drawer ---------- */
/* --bar-h: the sticky bar at the top (the top bar below 64rem, the page bar beside the menu). A block keeps
   that much room above it when a link scrolls to it. */
:root {
  --bar-h: 3.25rem;
}
@media (min-width: 64rem) {
  :root {
    --bar-h: 3.5rem;
  }
  .db-shell {
    display: grid;
    grid-template-columns: 13rem minmax(0, 1fr);
    align-items: start;
  }
}
@media (min-width: 80rem) {
  .db-shell {
    grid-template-columns: 15rem minmax(0, 1fr);
  }
}
/* While the drawer is open the page behind it doesn't scroll (app.js sets the class, never a style). */
html.db-drawer-open {
  overflow: hidden;
}

/* Top bar (below 64rem): the logo and the Menu button, with a red dot while something is broken. */
.db-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-med);
  min-height: var(--bar-h);
  padding: var(--space-xs) var(--site-padding-inline);
  background: var(--site-background);
  border-bottom: 1px solid var(--border-black);
}
.db-topbar__logo {
  display: block;
  width: 7rem;
  height: auto;
  aspect-ratio: 2318 / 209;
}
.db-topbar__dot:empty {
  display: none;
}
.db-topbar__mark {
  display: block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--color-alert-red);
}
@media (min-width: 64rem) {
  .db-topbar {
    display: none;
  }
}

/* Menu. --nav-pad lines up the logo, the rows and the bottom part. Below 64rem it is a drawer from the left:
   closed, visibility:hidden takes its links out of the tab order. That switch waits for the slide when it
   closes and is instant when it opens, so a link can take focus at once. From 64rem it is the sidebar. */
.db-nav {
  --nav-pad: var(--site-padding-inline);
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  width: min(20rem, 86vw);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
  padding: 0 0 var(--space-xl);
  background: var(--site-background);
  border-right: 1px solid var(--border-black);
  visibility: hidden;
  transform: translateX(-100%);
  transition: transform 300ms var(--ss-bezier-1), visibility 0s linear 300ms;
}
.db-drawer-open .db-nav {
  visibility: visible;
  transform: none;
  transition: transform 300ms var(--ss-bezier-1);
}
@media (min-width: 64rem) {
  .db-nav {
    --nav-pad: var(--space-med);
    position: sticky;
    inset: 0 auto auto;
    z-index: auto;
    width: auto;
    height: 100vh;
    height: 100dvh;
    padding: var(--space-2xl) 0 var(--space-xl);
    visibility: visible;
    transform: none;
    transition: none;
  }
}
@media (min-width: 80rem) {
  .db-nav {
    --nav-pad: var(--space-lg);
  }
}
/* 40% black over the page while the drawer is open; a tap on it closes the drawer. */
.db-scrim {
  position: fixed;
  inset: 0;
  z-index: 9;
  background: color-mix(in srgb, var(--color-black) 40%, transparent);
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms var(--ss-bezier-1), visibility 0s linear 300ms;
}
.db-drawer-open .db-scrim {
  opacity: 1;
  visibility: visible;
  transition: opacity 300ms var(--ss-bezier-1);
}
@media (min-width: 64rem) {
  .db-scrim {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .db-nav,
  .db-drawer-open .db-nav,
  .db-scrim,
  .db-drawer-open .db-scrim {
    transition: none;
  }
}
.db-nav__top {
  display: grid;
  gap: var(--space-med);
  padding-inline: var(--nav-pad);
}
/* The drawer's first row is as tall as the top bar, so its logo sits where the top bar's was. */
.db-nav__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-med);
  min-height: var(--bar-h);
}
.db-nav__logo {
  display: block;
  width: 7rem;
  max-width: 100%;
  height: auto;
  aspect-ratio: 2318 / 209;
}
@media (min-width: 64rem) {
  .db-nav__brand {
    min-height: 0;
  }
  .db-nav__logo {
    width: 9rem;
    margin-bottom: var(--space-sm);
  }
  /* Two classes: .db-btn (further down) sets display too. */
  .db-nav__brand .db-nav__close {
    display: none;
  }
}
.db-nav__eyebrow {
  color: var(--text-secondary);
  text-wrap: balance;
}
.db-nav__campaign {
  display: grid;
}
.db-nav__campaign:empty {
  display: none;
}
.db-nav__list {
  display: grid;
}
.db-nav__link {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-sm);
  min-height: 2.5rem;
  padding: var(--space-xs) var(--nav-pad);
  text-decoration: none;
  transition: background-color 150ms var(--ss-bezier-1);
}
.db-nav__link:hover {
  background: var(--color-neutral-100);
}
.db-nav__link:focus-visible {
  outline-offset: -2px;
}
.db-nav__link[aria-current="page"] {
  box-shadow: inset 2px 0 0 var(--color-black);
  font-weight: 500;
}
.db-nav__num {
  color: var(--text-secondary);
}
.db-nav__badge:empty {
  display: none;
}
.db-nav__badge .db-badge {
  padding: 0 var(--space-sm);
}
.db-nav__sub {
  display: grid;
  padding: 0 var(--nav-pad) var(--space-sm) calc(var(--nav-pad) + 1.5rem + var(--space-sm));
}
.db-nav__sublink {
  display: block;
  padding: var(--space-xs) 0;
  color: var(--text-secondary);
  text-decoration: none;
}
.db-nav__sublink:hover {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.db-nav__foot {
  display: grid;
  justify-items: start;
  gap: var(--space-med);
  margin-top: auto;
  padding: var(--space-lg) var(--nav-pad) 0;
  border-top: 1px solid var(--border-black);
}
.db-nav__links:empty,
.db-nav__who:empty {
  display: none;
}
.db-nav__ext {
  text-decoration: none;
}
.db-nav__ext:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.db-nav__ext-arrow {
  color: var(--text-secondary);
}
.db-nav__who {
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

/* Content pane: the container every block's layout reads (@container content), not the window. It holds no
   position:fixed element, because containment would pin it to this pane. */
.db-main {
  container: content / inline-size;
  display: grid;
  align-content: start;
  gap: var(--space-3xl);
  min-width: 0;
  padding: 0 var(--site-padding-inline) var(--space-7xl);
}
.db-main > * {
  min-width: 0;
}
.db-main:focus {
  outline: none;
}

/* Page bar: number + h1 on the left, freshness and Refresh on the right. Sticky beside the menu. Below 64rem
   it wraps: the title, the campaign line, then the two freshness lines with Mock data and Refresh. */
.db-pagebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-base) var(--space-xl);
  min-height: var(--bar-h);
  margin-inline: calc(-1 * var(--site-padding-inline));
  padding: var(--space-base) var(--site-padding-inline);
  background: var(--site-background);
  border-bottom: 1px solid var(--border-black);
}
@media (min-width: 64rem) {
  .db-pagebar {
    position: sticky;
    top: 0;
    z-index: 3;
  }
}
.db-pagebar__title {
  display: flex;
  align-items: baseline;
  gap: var(--space-med);
  min-width: 0;
}
.db-pagebar__num {
  color: var(--text-secondary);
}
.db-pagebar__h1 {
  font-weight: 500;
}
.db-pagebar__campaign {
  flex-basis: 100%;
  color: var(--text-secondary);
}
.db-pagebar__campaign:empty {
  display: none;
}
.db-pagebar__side {
  flex-basis: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  align-items: end;
  gap: var(--space-base) var(--space-med);
}
@media (min-width: 64rem) {
  .db-pagebar__campaign {
    display: none;
  }
  .db-pagebar__side {
    flex-basis: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-base) var(--space-lg);
  }
}
.db-pg {
  display: grid;
  gap: var(--space-5xl);
  max-width: 100rem;
}
.db-pg > * {
  min-width: 0;
}

/* Freshness in the page bar: below 64rem two lines whose labels and times line up, from 64rem one line. */
.db-fresh {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-xs) var(--space-sm);
}
.db-fresh__item {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: center;
  justify-items: start;
}
@media (min-width: 64rem) {
  .db-fresh {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs) var(--space-xl);
  }
  .db-fresh__item {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
  }
}
.db-fresh__label {
  color: var(--text-secondary);
}

.db-alert {
  padding: var(--space-med) var(--space-lg);
  background: color-mix(in srgb, var(--color-alert-red) 8%, var(--color-white));
  color: var(--color-alert-red);
  border-left: 2px solid var(--color-alert-red);
}

/* ---------- Buttons ---------- */
.db-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-med);
  border: 1px solid var(--border-black);
  border-radius: var(--border-max);
  background: transparent;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms var(--ss-bezier-1), color 150ms var(--ss-bezier-1);
}
.db-btn:hover {
  background: var(--color-neutral-100);
}
.db-btn[aria-pressed="true"],
.db-btn--solid {
  background: var(--color-black);
  color: var(--text-primary-inv);
}
.db-btn--solid:hover {
  background: var(--color-neutral-600);
}
.db-btn:disabled {
  cursor: default;
  opacity: 0.5;
}

/* ---------- Views: sign-in, message, loading ---------- */
.db-view {
  display: grid;
  gap: var(--space-xl);
  max-width: 32rem;
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-black);
}
.db-view__text {
  color: var(--color-neutral-600);
  line-height: var(--lh-xl);
  text-wrap: pretty;
}
.db-view__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}
.db-login__form {
  display: grid;
  gap: var(--space-med);
}
.db-login__label {
  color: var(--text-secondary);
}
.db-input {
  width: 100%;
  padding: var(--space-base) 0;
  border: 0;
  border-bottom: 1px solid var(--border-black);
  border-radius: 0;
  background: transparent;
}
.db-input::placeholder {
  color: var(--text-secondary);
}
.db-login__form .db-btn {
  justify-self: start;
}
.db-login__msg:empty {
  display: none;
}
.db-login__msg {
  color: var(--color-alert-red);
}

/* ---------- Blocks ---------- */
.db-section__body {
  display: grid;
  gap: var(--space-5xl);
}
.db-section__body > * {
  min-width: 0;
}

.db-block {
  display: grid;
  gap: var(--space-lg);
  align-content: start;
  /* A link that scrolls here leaves the block clear of the sticky bar. */
  scroll-margin-top: calc(var(--bar-h) + var(--space-lg));
}
.db-block > * {
  min-width: 0;
}
.db-block__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-sm) var(--space-lg);
  padding-bottom: var(--space-base);
  border-bottom: 1px solid var(--border-black);
}
.db-block__title {
  margin: 0;
}
.db-block__aside {
  color: var(--text-secondary);
}
.db-note {
  color: var(--color-neutral-600);
  text-wrap: pretty;
  max-width: 48rem;
}
.db-wait {
  padding: var(--space-med) var(--space-lg);
  background: var(--site-nested-background);
  color: var(--color-neutral-600);
}
.db-empty {
  color: var(--text-secondary);
  padding: var(--space-xl) 0;
}

.db-split {
  display: grid;
  gap: var(--space-5xl);
}
.db-split > * {
  min-width: 0;
}
@container content (min-width: 64rem) {
  .db-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3xl);
  }
}

/* ---------- Stats: read-only numbers, no boxes ---------- */
.db-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3xl) var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-black);
}
.db-stats__item {
  display: grid;
  align-content: start;
  gap: var(--space-base);
  min-width: 0;
}
.db-stats__label {
  color: var(--text-secondary);
}
.db-stats__value {
  font-size: var(--text-32);
  font-weight: 500;
  letter-spacing: var(--ls-neg-2);
  line-height: var(--lh-sm);
  overflow-wrap: anywhere;
}
.db-stats__hint {
  color: var(--text-secondary);
  text-wrap: pretty;
}
.db-stats__item--lead {
  grid-column: 1 / -1;
}
.db-stats__item--lead .db-stats__value {
  font-size: var(--text-56);
  letter-spacing: -0.035em;
  line-height: var(--lh-xs);
}
/* Narrow layout with a lead stat: the lead keeps the full row and the other stats share the next row
   (auto-fit), so a 1024 window doesn't leave the last stat alone on a third row. Phones keep 2 columns. */
@container content (min-width: 36rem) {
  .db-stats--lead {
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  }
}
@container content (min-width: 51.25rem) {
  .db-stats {
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    align-items: end;
  }
  .db-stats__item {
    align-content: end;
  }
  /* Lead stat takes double width; flex because a 2fr track can't sit next to repeat(auto-fit, …). */
  .db-stats--lead {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
  }
  .db-stats--lead > .db-stats__item {
    flex: 1 1 9rem;
  }
  .db-stats--lead > .db-stats__item--lead {
    flex: 2 1 20rem;
  }
  .db-stats__value {
    font-size: var(--text-40);
  }
  .db-stats__item--lead {
    grid-column: auto;
  }
  .db-stats__item--lead .db-stats__value {
    font-size: var(--text-72);
  }
}

/* ---------- 00 Overview: Needs a look ---------- */
/* One whole-row link per issue: badge, text + sub, arrow. The hover fill bleeds past the text, so the text
   still lines up with the block heading; the hairline sits on the <li> and doesn't bleed. */
.db-issues {
  display: grid;
}
.db-issues__item {
  border-bottom: 1px solid var(--border-opaque);
}
.db-issue {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: var(--space-xs) var(--space-med);
  margin-inline: calc(-1 * var(--space-base));
  padding: var(--space-med) var(--space-base);
  text-decoration: none;
}
a.db-issue {
  transition: background-color 150ms var(--ss-bezier-1);
}
a.db-issue:hover {
  background: var(--color-neutral-100);
}
a.db-issue:focus-visible {
  outline-offset: -2px;
}
.db-issue__body {
  display: grid;
  gap: var(--space-xs);
  min-width: 0;
}
.db-issue__sub {
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}
.db-issue__go {
  color: var(--text-secondary);
}
a.db-issue:hover .db-issue__go {
  color: var(--text-primary);
}

/* ---------- 00 Overview: KPI grid ---------- */
/* One column per topic page: a head link, then 3 tiles. 3-up from a 45rem pane; below that the columns stack
   and each one's tiles sit side by side. A tile is one link: its label's <a> stretches over the tile. */
.db-kpi {
  display: grid;
  gap: var(--space-3xl) var(--space-xl);
}
.db-kpi__col {
  display: grid;
  align-content: start;
  gap: var(--space-xs);
  min-width: 0;
}
.db-kpi__head {
  padding-bottom: var(--space-base);
  border-bottom: 1px solid var(--border-black);
}
.db-kpi__head-link {
  text-decoration: none;
}
.db-kpi__head-link:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.db-kpi__num {
  color: var(--text-secondary);
}
.db-kpi__tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  column-gap: var(--space-xl);
}
.db-kpi__tile {
  position: relative;
  margin-inline: calc(-1 * var(--space-base));
  padding: var(--space-med) var(--space-base);
  transition: background-color 150ms var(--ss-bezier-1);
}
.db-kpi__tile:hover {
  background: var(--color-neutral-100);
}
.db-kpi .db-stats__value {
  font-size: var(--text-32);
}
.db-kpi .db-stats__item {
  align-content: start;
}
/* On the baseline, the swatch + name sat 3px lower than a plain number and grew the line. */
.db-kpi .db-stats__value .db-class-tag {
  vertical-align: top;
}
.db-kpi__link {
  text-decoration: none;
}
.db-kpi__link::after {
  content: "";
  position: absolute;
  inset: 0;
}
.db-kpi__tile:hover .db-kpi__link {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.db-kpi__link:focus-visible {
  outline: none;
}
.db-kpi__link:focus-visible::after {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: -2px;
}
/* 3-up: the columns share their 4 rows (head + 3 tiles) through subgrid, so tiles still line up across the
   columns when a hint wraps. Without subgrid each column simply stacks. */
@container content (min-width: 45rem) {
  .db-kpi {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: var(--space-xs);
  }
  .db-kpi__col {
    grid-row: span 4;
    grid-template-rows: subgrid;
  }
  .db-kpi__tiles {
    grid-row: span 3;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: subgrid;
  }
}

/* ---------- Class identity ---------- */
.db-c--scholar {
  --c: var(--class-scholar);
  --c-edge: var(--class-scholar);
}
.db-c--noble {
  --c: var(--class-noble);
  --c-edge: var(--class-noble);
}
.db-c--idol {
  --c: var(--class-idol);
  --c-edge: var(--class-idol-edge);
}
.db-c--warrior {
  --c: var(--class-warrior);
  --c-edge: var(--class-warrior);
}
.db-c--none {
  --c: var(--color-neutral-300);
  --c-edge: var(--color-neutral-500);
}
.db-swatch {
  display: inline-block;
  flex: none;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 2px;
  background: var(--c);
  box-shadow: inset 0 0 0 1px var(--c-edge);
}
.db-class-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  white-space: nowrap;
}
.db-stats__value .db-class-tag {
  gap: var(--space-base);
}
.db-stats__value .db-swatch {
  width: 0.5em;
  height: 0.5em;
  border-radius: 0.08em;
}

/* Quiz takers by class */
.db-classes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2xl) var(--space-xl);
}
@container content (min-width: 51.25rem) {
  .db-classes {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.db-class {
  display: grid;
  align-content: start;
  gap: var(--space-base);
  min-width: 0;
}
.db-class__name {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.db-class__value {
  font-size: var(--text-32);
  font-weight: 500;
  letter-spacing: var(--ls-neg-2);
  line-height: var(--lh-sm);
}
.db-class__hint,
.db-class__active {
  color: var(--text-secondary);
}
.db-meter {
  position: relative;
  height: 0.5rem;
  margin-top: var(--space-xs);
  border-radius: var(--border-max);
  background: var(--color-neutral-100);
  overflow: hidden;
}
.db-meter__fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: var(--border-max);
  background: var(--c);
  box-shadow: inset 0 0 0 1px var(--c-edge);
}

/* ---------- Legends ---------- */
.db-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-xl);
}
.db-legend__item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  white-space: nowrap;
}
.db-legend__value {
  color: var(--text-secondary);
}
.db-legend__line {
  display: inline-block;
  width: 1.25rem;
  height: 0;
  border-top: 2px solid var(--c, var(--color-neutral-600));
}
.db-legend__line--edge {
  border-top-width: 3px;
  border-top-color: var(--c);
  box-shadow: 0 1px 0 var(--c-edge), 0 -1px 0 var(--c-edge);
}
.db-legend__line--dash {
  border-top-style: dashed;
  border-top-color: var(--color-neutral-600);
}

/* ---------- Charts (inline SVG drawn by app.js) ---------- */
.db-chart {
  position: relative;
  min-height: 12rem;
}
.db-chart:focus-visible {
  outline-offset: 4px;
}
.db-chart__svg {
  display: block;
  max-width: 100%;
  overflow: visible;
  touch-action: pan-y;
}
.db-chart__svg text {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: -0.01em;
  fill: var(--text-secondary);
}
.db-chart__svg .db-cap {
  fill: var(--text-primary);
  font-weight: 500;
}
.db-chart__svg .db-band__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: uppercase;
  fill: var(--color-neutral-600);
}
.db-chart__svg .db-end {
  fill: var(--text-primary);
}
.db-grid {
  stroke: var(--color-neutral-200);
  stroke-width: 1;
  shape-rendering: crispEdges;
}
.db-grid--base {
  stroke: var(--color-neutral-300);
}
.db-band {
  fill: var(--site-nested-background);
}
.db-band__edge {
  stroke: var(--color-neutral-300);
  stroke-width: 1;
  shape-rendering: crispEdges;
}
.db-hl {
  fill: var(--color-neutral-100);
}
.db-cross {
  stroke: var(--color-neutral-600);
  stroke-width: 1;
  shape-rendering: crispEdges;
}
.db-hit {
  fill: transparent;
  cursor: crosshair;
}
.db-summary {
  color: var(--color-neutral-600);
  text-wrap: pretty;
  max-width: 48rem;
}

.db-tip {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: var(--space-xs);
  min-width: 9rem;
  max-width: 14rem;
  padding: var(--space-base) var(--space-med);
  background: var(--site-background);
  border: 1px solid var(--border-black);
  pointer-events: none;
}
.db-tip__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-sm);
  font-weight: 500;
}
.db-tip__tag {
  color: var(--text-secondary);
}
.db-tip__row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.db-tip__name {
  flex: 1;
}
.db-tip__value {
  font-weight: 500;
}

/* Disclosure for the table fallbacks */
.db-details summary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-secondary);
  cursor: pointer;
  list-style: none;
}
.db-details summary::-webkit-details-marker {
  display: none;
}
.db-details summary::before {
  content: "+";
  font-family: var(--font-mono);
}
.db-details[open] summary::before {
  content: "−";
}
.db-details summary:hover {
  color: var(--text-primary);
}
.db-details[open] > :not(summary) {
  margin-top: var(--space-med);
}

/* ---------- Tables (scroll inside their own box) ---------- */
.db-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border-top: 1px solid var(--border-black);
  border-bottom: 1px solid var(--border-black);
}
.db-table-wrap--tall {
  max-height: 70vh;
  overflow: auto;
}
.db-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.db-table th,
.db-table td {
  padding: var(--space-med) var(--space-base);
  border-bottom: 1px solid var(--border-opaque);
  text-align: left;
  vertical-align: top;
  font-weight: 400;
}
.db-table tbody tr:last-child > * {
  border-bottom: 0;
}
.db-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--site-background);
  border-bottom: 1px solid var(--border-black);
  color: var(--text-secondary);
  white-space: nowrap;
}
.db-table tbody tr {
  transition: background-color 120ms var(--ss-bezier-1);
}
.db-table tbody tr:hover {
  background: var(--color-neutral-100);
}
.db-table .db-table__num {
  text-align: right;
  white-space: nowrap;
}
.db-table__nowrap {
  white-space: nowrap;
}
.db-table__sub {
  display: block;
  margin-top: var(--space-xs);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: var(--text-10);
}
.db-table__order {
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.db-table__order:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.db-table__order::after {
  content: " ↗";
  color: var(--text-secondary);
  font-weight: 400;
}
.db-table--wide {
  min-width: 60rem;
}
.db-table--mid {
  min-width: 30rem;
}
.db-row--over > :first-child {
  box-shadow: inset 2px 0 0 var(--color-black);
}
.db-row--under > :first-child {
  box-shadow: inset 2px 0 0 var(--color-alert-red);
}
.db-row--flag > :first-child {
  box-shadow: inset 2px 0 0 var(--color-neutral-500);
}
.db-diff--pos {
  font-weight: 500;
}
.db-diff--neg {
  color: var(--color-alert-red);
  font-weight: 500;
}
.db-table__cells {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
}

/* ---------- Status badges: filled pills (buttons stay outlined, so the two never look alike) ---------- */
.db-badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-med);
  border-radius: var(--border-max);
  background: var(--color-neutral-200);
  color: var(--text-primary);
  white-space: nowrap;
}
.db-badge--ok,
.db-badge--upcoming,
.db-badge--settled {
  background: var(--color-neutral-100);
  color: var(--color-neutral-600);
}
.db-badge--late,
.db-badge--live {
  background: var(--color-black);
  color: var(--text-primary-inv);
}
.db-badge--error {
  background: color-mix(in srgb, var(--color-alert-red) 10%, var(--color-white));
  color: var(--color-alert-red);
}
.db-badge--idle {
  background: var(--color-neutral-100);
  color: var(--text-secondary);
}
.db-badge--mock {
  background: var(--color-black);
  color: var(--text-primary-inv);
}

/* ---------- The race: TOTAL board ---------- */
.db-board {
  display: grid;
  border-top: 1px solid var(--border-black);
}
.db-board__row {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr) auto;
  grid-template-areas:
    "rank who avg"
    "rank bar bar"
    "rank meta meta";
  align-items: center;
  gap: var(--space-xs) var(--space-med);
  padding: var(--space-med) 0;
  border-bottom: 1px solid var(--border-opaque);
}
.db-board__rank {
  grid-area: rank;
  align-self: start;
  color: var(--text-secondary);
}
.db-board__who {
  grid-area: who;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.db-board__bar {
  grid-area: bar;
  position: relative;
  height: 0.75rem;
  border-radius: var(--border-max);
  background: var(--color-neutral-100);
  overflow: hidden;
}
.db-board__fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: var(--border-max);
  background: var(--c);
  box-shadow: inset 0 0 0 1px var(--c-edge);
}
.db-board__avg {
  grid-area: avg;
  font-size: var(--text-28);
  font-weight: 500;
  letter-spacing: var(--ls-neg-2);
  line-height: var(--lh-sm);
  text-align: right;
}
.db-board__meta {
  grid-area: meta;
  color: var(--text-secondary);
}
.db-board__row.is-leader .db-board__rank {
  color: var(--text-primary);
}
@container content (min-width: 51.25rem) {
  .db-board__row {
    grid-template-columns: 2rem 9rem minmax(0, 1fr) 5rem 13rem;
    grid-template-areas: "rank who bar avg meta";
    gap: var(--space-xl);
  }
  .db-board__rank {
    align-self: center;
  }
  .db-board__meta {
    text-align: right;
  }
}

/* Lead changes */
.db-changes {
  display: grid;
  border-top: 1px solid var(--border-black);
}
.db-changes__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-xs) var(--space-med);
  align-items: center;
  padding: var(--space-med) 0;
  border-bottom: 1px solid var(--border-opaque);
}
.db-changes__when {
  color: var(--text-secondary);
}
.db-changes__move {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
}
.db-changes__arrow {
  color: var(--text-secondary);
}

/* Weeks + GWP placeholder */
.db-weeks {
  display: grid;
  gap: var(--space-base);
}
@container content (min-width: 40rem) {
  .db-weeks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.db-week {
  display: grid;
  align-content: start;
  gap: var(--space-med);
  padding: var(--space-lg);
  border: 1px solid var(--border-opaque);
  min-width: 0;
}
.db-week.is-current {
  border-color: var(--border-black);
}
.db-week__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-sm);
}
.db-week__title {
  font-size: var(--text-24);
  font-weight: 500;
  letter-spacing: var(--ls-neg-2);
  line-height: var(--lh-sm);
}
.db-week__dates,
.db-week__winner-label {
  color: var(--text-secondary);
}
.db-week__winner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
}
.db-week__list {
  display: grid;
  gap: var(--space-xs);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-opaque);
}
.db-week__list li {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.db-week__list .db-week__avg {
  margin-left: auto;
  font-weight: 500;
}
.db-week--placeholder {
  border-style: dashed;
  border-color: var(--color-neutral-300);
  background: var(--site-nested-background);
}
.db-week--placeholder p {
  color: var(--color-neutral-600);
}

/* ---------- Sales: codes ---------- */
.db-codes {
  display: grid;
  gap: var(--space-3xl);
}
@container content (min-width: 51.25rem) {
  .db-codes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-xl);
  }
}
.db-code {
  display: grid;
  align-content: start;
  gap: var(--space-med);
  min-width: 0;
}
.db-code__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-sm);
  padding-bottom: var(--space-base);
  border-bottom: 1px solid var(--border-black);
}
.db-code__prefix {
  padding: 0 var(--space-base);
  border-radius: var(--border-max);
  background: var(--color-neutral-200);
  font-family: var(--font-mono);
  font-size: var(--text-12);
  line-height: 1.5;
}
.db-code__rows {
  display: grid;
}
.db-code__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: var(--space-xs) var(--space-med);
  padding: var(--space-med) 0;
  border-bottom: 1px solid var(--border-opaque);
}
.db-code__label {
  color: var(--text-secondary);
}
.db-code__value {
  font-size: var(--text-24);
  font-weight: 500;
  letter-spacing: var(--ls-neg-2);
  line-height: var(--lh-sm);
  text-align: right;
}
.db-code__hint {
  grid-column: 1 / -1;
  color: var(--text-secondary);
}

/* AOV */
.db-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}
.db-aov {
  display: grid;
  border-top: 1px solid var(--border-black);
}
.db-aov__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label value"
    "bar bar"
    "meta meta";
  gap: var(--space-xs) var(--space-med);
  align-items: center;
  padding: var(--space-med) 0;
  border-bottom: 1px solid var(--border-opaque);
}
.db-aov__label {
  grid-area: label;
}
.db-aov__bar {
  grid-area: bar;
  position: relative;
  height: 0.75rem;
  border-radius: var(--border-max);
  background: var(--color-neutral-100);
  overflow: hidden;
}
.db-aov__fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: var(--border-max);
  background: var(--color-black);
}
.db-aov__row--others .db-aov__fill {
  background: var(--color-neutral-500);
}
.db-aov__value {
  grid-area: value;
  font-size: var(--text-28);
  font-weight: 500;
  letter-spacing: var(--ls-neg-2);
  line-height: var(--lh-sm);
  text-align: right;
}
.db-aov__meta {
  grid-area: meta;
  color: var(--text-secondary);
}
.db-aov__diff {
  font-weight: 500;
}
@container content (min-width: 51.25rem) {
  .db-aov__row {
    grid-template-columns: 10rem minmax(0, 1fr) 7rem 8rem;
    grid-template-areas: "label bar value meta";
    gap: var(--space-xl);
  }
  .db-aov__meta {
    text-align: right;
  }
}

/* ---------- Health: server status ---------- */
.db-status {
  display: grid;
  gap: var(--space-3xl);
}
@container content (min-width: 64rem) {
  .db-status {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-xl);
  }
}
.db-status__group {
  display: grid;
  align-content: start;
  min-width: 0;
}
.db-status__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-xs) var(--space-med);
  align-items: center;
  padding: var(--space-med) 0;
  border-bottom: 1px solid var(--border-opaque);
}
.db-status__name {
  font-weight: 500;
}
.db-status__detail {
  grid-column: 1 / -1;
  color: var(--color-neutral-600);
  overflow-wrap: anywhere;
}

/* ---------- Stacks + hairlines ---------- */
.db-stack {
  display: grid;
  gap: var(--space-xl);
}
.db-stack > * {
  min-width: 0;
}
/* A block's heading already draws the black line: the first thing under it doesn't draw a second one. The
   same goes for the page bar above a page's lead stats. */
.db-block > .db-block__head + *,
.db-block > .db-block__head + [data-fill] > :first-child {
  border-top: 0;
}
.db-pg .db-section__body > .db-stats--lead:first-child {
  padding-top: 0;
  border-top: 0;
}

/* ---------- Footer ---------- */
.db-foot {
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-opaque);
  color: var(--text-secondary);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
@media print {
  .db-topbar,
  .db-nav,
  .db-scrim,
  .db-skip,
  .db-pagebar .db-btn,
  .db-toggle,
  .db-tip {
    display: none !important;
  }
  .db-shell {
    display: block;
  }
  .db-pagebar {
    position: static;
  }
  .db-table-wrap,
  .db-table-wrap--tall {
    max-height: none;
    overflow: visible;
  }
  .db-table thead th {
    position: static;
  }
}
