/*
 * Skillfiles design system.
 *
 * One stylesheet for the website, the dashboard and the account pages. Its
 * values are the frozen design system (design-system-description.md and
 * design-system-vol1.html in the design handoff); components keep the
 * reference page's class names so a page can be built from it directly.
 *
 * The rules the system rests on:
 * - Dark only. Depth comes from small steps in lightness, a lit top rim and a
 *   soft shadow below, not from borders. Three levels: inset (fields, tracks,
 *   lists), surface (page, window) and raised (cards, buttons); floating
 *   layers (menus, dialogs, toasts) get the strongest shadow.
 * - The accent is data: AI, results, progress, anything running. Never
 *   decoration. It is a muted amber on blue-grey neutrals, so it reads without
 *   shouting.
 * - White is action: the primary button and the selected option are the
 *   brightest things on screen.
 * - Green, yellow and red mean success, waiting on a person, and failure.
 *   Slate is neutral, idle or dropped. Status always carries a text label too.
 *
 * The values are the owner's tuning of the reference page (from a
 * configurator): grey rather than navy surfaces, flat gradients, soft
 * shadows, radii at 0.45 of the reference (written as calc(Npx * 0.45)) and
 * control heights and spacing at full size (calc(Npx * 1)). The macro colours
 * of the source app are named by meaning (green, amber, red) rather than by
 * macro.
 */

/* ---------- tokens */
:root {
  color-scheme: dark;
  /* Surfaces, deepest to highest: grey with only a trace of blue. */
  --backdrop: #18191e;
  --page: #18191e;
  --inset: #16171a;
  --track: #1e2125;
  --bg: #1d1f20;
  --surface: #24262a;
  --surface-2: #2a2c2f;
  --surface-hi: #313438;
  --raised: #515253;
  --rim: rgba(255, 255, 255, 0.0747);
  --rim-hi: rgba(255, 255, 255, 0.138);
  --hair: rgba(255, 255, 255, 0.069);
  /* Text. */
  --text: #f2f3f7;
  --text-2: #9aa0aa;
  --text-3: #6d737e;
  --on-light: #15181d;
  /* Text on an accent fill: dark, because white does not read on amber. */
  --on-accent: #15181d;
  /* The one accent: data, AI, progress. A muted amber. */
  --accent: #e0b775;
  --accent-2: #e9cd9e;
  --accent-ink: #e9cd9e;
  --accent-soft: rgba(224, 183, 117, 0.15);
  /* Meaning. */
  --green: #49a373;
  --green-ink: #80bf9d;
  --amber: #d7b746;
  --amber-ink: #e1ca76;
  --red: #d4674d;
  --red-ink: #e98e7d;
  --slate: #94a3b8;
  --success: #49a373;
  --warning: #d7b746;
  --danger: #e0624b;
  --info: #e0b775;
  /* Shape. */
  --r-xs: calc(4px * 0.45);
  --r-sm: calc(8px * 0.45);
  --r-md: calc(12px * 0.45);
  --r-lg: calc(18px * 0.45);
  --r-xl: calc(24px * 0.45);
  --r-pill: 999px;
  /* Depth. */
  --sh-inset:
    inset 0 1px 3px rgba(0, 0, 0, 0.22), inset 0 0 0 1px rgba(0, 0, 0, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.018);
  --sh-raised:
    inset 0 1px 0 rgba(255, 255, 255, 0.032), 0 1px 2px rgba(0, 0, 0, 0.16),
    0 14px 30px -16px rgba(0, 0, 0, 0.3);
  --sh-float:
    inset 0 1px 0 rgba(255, 255, 255, 0.036),
    0 28px 64px -20px rgba(0, 0, 0, 0.36), 0 4px 14px rgba(0, 0, 0, 0.18);
  --g-card: linear-gradient(180deg, #26282c 0%, #25272b 34%, #24262a 100%);
  --g-ghost: linear-gradient(180deg, #2c2e31, #2a2c2f);
  --g-white: linear-gradient(180deg, #e7eaf0, #e1e5ec);
  --g-active: linear-gradient(180deg, #545455, #4f5051);
  --g-accent: linear-gradient(180deg, #e1b979, #d8b278);
  --g-float: linear-gradient(180deg, #2c2e31, #2a2c2f);
  --g-side: linear-gradient(180deg, #1f2123 0%, #1e2022 30%, #1d1f20 100%);
  /* Type. */
  --font:
    "Geist Variable", "Geist", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", sans-serif;
  --mono:
    "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* Motion. */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- base */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  min-width: 0;
}
[hidden] {
  display: none !important;
}
html {
  scroll-padding-top: 24px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 15px / 1.55 var(--font);
  font-synthesis: none;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  /* Lit from directly above, like every surface on it: one glow centred over the top edge. */
  background:
    radial-gradient(1600px 680px at 50% -12%, #232635 0%, transparent 64%),
    var(--backdrop);
}
::selection {
  background: rgba(224, 183, 117, 0.35);
  color: var(--text);
}
h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
p {
  margin: 0;
}
a {
  color: inherit;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
code,
kbd,
pre,
.mono {
  font-family: var(--mono);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
svg.i {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.muted {
  color: var(--text-2);
}
.faint {
  color: var(--text-3);
}
.num {
  font-variant-numeric: tabular-nums;
}
.unit {
  font-weight: 400;
  color: var(--text-2);
  font-size: 0.62em;
  margin-left: 4px;
  letter-spacing: 0;
}
.eyebrow {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-3);
}
.eyebrow.blue {
  color: var(--accent-ink);
}
.note {
  font-size: 12px;
  color: var(--text-3);
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.stack-v {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--g-white);
  color: var(--on-light);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus {
  left: 12px;
}

/* ---------- brand */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: calc(9px * 0.45);
  /* The logo keeps the brand blue of the favicon, whatever the accent is. */
  background: linear-gradient(180deg, #86a1ff, #5d7ef3);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.253),
    0 6px 16px -6px rgba(108, 142, 255, 0.4875);
}
.mark svg {
  display: block;
  width: 22px;
  height: 22px;
}
.logo small {
  display: block;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--text-2);
  letter-spacing: 0;
}

/* ---------- app shell: a floating sidebar beside a rounded window */
.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: calc(16px * 1);
  max-width: 1480px;
  margin: 0 auto;
  padding: calc(16px * 1);
}
.side {
  position: sticky;
  top: 16px;
  height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: calc(14px * 1);
  border-radius: var(--r-xl);
  background: var(--g-side);
  border: 1px solid var(--rim);
  box-shadow: var(--sh-raised);
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 4px 4px 8px;
}
.brand b {
  display: block;
  font-size: 14px;
  line-height: 1.2;
}
.brand small {
  font-size: 11.5px;
  color: var(--text-2);
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: auto;
  margin: 6px -4px 0;
  padding: 0 4px;
  scrollbar-width: none;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: calc(36px * 1);
  padding: 0 12px;
  border-radius: var(--r-pill);
  color: var(--text-2);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  flex: none;
  border: 1px solid transparent;
}
.nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.0345);
}
.nav a.on,
.nav a[aria-current="page"] {
  color: var(--text);
  background: var(--g-active);
  border-color: var(--rim-hi);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 4px 10px -4px rgba(0, 0, 0, 0.45);
}
.nav a .badge {
  margin-left: auto;
}
.side .foot {
  margin-top: auto;
}
.window {
  background: var(--bg);
  border-radius: var(--r-xl);
  border: 1px solid var(--rim);
  box-shadow: var(--sh-float);
  padding: clamp(calc(18px * 1), calc(3vw * 1), calc(36px * 1));
  min-width: 0;
}

/* Page header: a title with a muted tag beside it, and actions on the right. */
.page-h {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px 16px;
  flex-wrap: wrap;
}
.page-h h1 {
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -0.035em;
}
.page-h h1 .tag {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-2);
  margin-left: 10px;
}
.page-h p {
  color: var(--text-2);
  font-size: 13.5px;
  margin-top: 6px;
  max-width: 70ch;
}
/* Section header: a title on the left, a quiet link or status on the right. */
.sh {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.sh h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.sh h2 .tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  margin-left: 6px;
}
.sh p {
  color: var(--text-2);
  font-size: 13px;
  max-width: 62ch;
}
/* A 12-column grid for cards. */
.board {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: calc(16px * 1);
}
.c12 {
  grid-column: span 12;
}
.c8 {
  grid-column: span 8;
}
.c7 {
  grid-column: span 7;
}
.c6 {
  grid-column: span 6;
}
.c5 {
  grid-column: span 5;
}
.c4 {
  grid-column: span 4;
}
.c3 {
  grid-column: span 3;
}

/* ---------- surfaces */
.card {
  background: var(--g-card);
  border: 1px solid var(--rim);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-raised);
  padding: calc(18px * 1);
  min-width: 0;
}
.card-h {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.card-h h3,
.card-h h4 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card-h small {
  display: block;
  font-size: 12px;
  color: var(--text-2);
  margin-top: 1px;
}
.inset {
  background: var(--inset);
  box-shadow: var(--sh-inset);
  border-radius: var(--r-md);
}
.float {
  background: var(--g-float);
  border: 1px solid var(--rim-hi);
  box-shadow: var(--sh-float);
}
.chev {
  color: var(--text-3);
}
.ichip {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--g-ghost);
  border: 1px solid var(--rim-hi);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.ichip.sm {
  width: 28px;
  height: 28px;
}
.ichip.sm svg.i {
  width: 14px;
  height: 14px;
}
.ichip.accent {
  color: var(--accent);
}
.ichip.ok {
  color: var(--success);
}
.ichip.warn {
  color: var(--warning);
}
.ichip.bad {
  color: var(--danger);
  background: rgba(224, 98, 75, 0.14);
}
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--g-white);
  color: var(--on-light);
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 2px 6px rgba(0, 0, 0, 0.375);
}
.avatar.sm {
  width: 24px;
  height: 24px;
  font-size: 9px;
}
.avatar.lg {
  width: 44px;
  height: 44px;
  font-size: 14px;
}
.avatar.accent {
  background: var(--g-accent);
  color: var(--on-accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ---------- buttons: white is the one action, accent confirms data, the rest are ghost pills */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: calc(36px * 1);
  padding: 0 16px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  border: 1px solid var(--rim-hi);
  background: var(--g-ghost);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.338),
    0 6px 14px -8px rgba(0, 0, 0, 0.45);
  transition:
    filter 0.15s,
    transform 0.1s;
}
.btn:hover {
  filter: brightness(1.14);
}
.btn:active {
  transform: translateY(1px);
  filter: brightness(0.96);
}
.btn.primary {
  background: var(--g-white);
  color: var(--on-light);
  border-color: rgba(255, 255, 255, 0.805);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 1px 0 rgba(0, 0, 0, 0.413),
    0 10px 20px -10px rgba(0, 0, 0, 0.6);
}
.btn.accent {
  background: var(--g-accent);
  color: #15181d;
  border-color: rgba(255, 255, 255, 0.253);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.225),
    0 1px 0 rgba(0, 0, 0, 0.375),
    0 10px 22px -10px rgba(224, 183, 117, 0.4875);
}
.btn.danger {
  color: var(--red-ink);
  background: linear-gradient(180deg, #25252d, #212229);
  border-color: rgba(224, 98, 75, 0.322);
}
.btn.quiet {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--text-2);
}
.btn.quiet:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.046);
  filter: none;
}
.btn.sm {
  height: 28px;
  padding: 0 11px;
  font-size: 12px;
  gap: 6px;
}
.btn.sm svg.i {
  width: 14px;
  height: 14px;
}
.btn.lg {
  height: 46px;
  padding: 0 24px;
  font-size: 14px;
}
.btn.block {
  width: 100%;
}
.btn.icon {
  width: 36px;
  padding: 0;
}
.btn.icon.sm {
  width: 28px;
}
.btn.icon.lg {
  width: 46px;
}
.btn[disabled],
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.38;
  pointer-events: none;
}
.btn.loading {
  pointer-events: none;
}
.btn.is-ok {
  color: var(--green-ink);
  border-color: rgba(73, 163, 115, 0.5);
}
.spin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: ui-rot 0.7s linear infinite;
  opacity: 0.8;
}
@keyframes ui-rot {
  to {
    transform: rotate(360deg);
  }
}
.btn-group {
  display: inline-flex;
}
.btn-group .btn {
  border-radius: 0;
}
.btn-group .btn:first-child {
  border-radius: 999px 0 0 999px;
}
.btn-group .btn:last-child {
  border-radius: 0 999px 999px 0;
}
.btn-group .btn + .btn {
  margin-left: -1px;
}

/* ---------- segmented control: an inset track holding a raised white pill */
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: var(--r-pill);
  background: var(--inset);
  box-shadow: var(--sh-inset);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.seg button {
  border: 0;
  background: none;
  color: var(--text-2);
  font-weight: 600;
  font-size: 12px;
  height: calc(28px * 1);
  padding: 0 14px;
  border-radius: var(--r-pill);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.seg button:hover {
  color: var(--text);
}
.seg button[aria-pressed="true"],
.seg button[aria-selected="true"],
.seg button[aria-current="true"] {
  background: var(--g-white);
  color: var(--on-light);
  box-shadow:
    inset 0 1px 0 #fff,
    0 2px 6px rgba(0, 0, 0, 0.5);
}
/* In a column (a form field, a card) a control keeps its own width unless it is .full. */
.field > .seg,
.field > .stepper,
.field > .chips,
.stack-v > .seg {
  align-self: flex-start;
}
.seg.full {
  display: flex;
  align-self: stretch;
}
.seg.full button {
  flex: 1;
  justify-content: center;
}
.seg.sm button {
  height: 24px;
  padding: 0 10px;
  font-size: 11px;
}
.seg.lg {
  padding: 4px;
}
.seg.lg button {
  height: 36px;
  padding: 0 16px;
  font-size: 13.5px;
}

/* ---------- form controls: sunk into the surface; focus adds an accent rim and halo */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field > label,
.field > .lbl {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}
.help {
  font-size: 11.5px;
  color: var(--text-3);
}
.help.err {
  color: #e78674;
}
.ctl {
  display: flex;
  align-items: center;
  gap: 8px;
  height: calc(40px * 1);
  padding: 0 14px;
  border-radius: var(--r-md);
  background: var(--inset);
  box-shadow: var(--sh-inset);
  border: 1px solid transparent;
  color: var(--text-3);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.ctl.pill {
  border-radius: var(--r-pill);
}
.ctl.lg {
  height: 46px;
}
.ctl:focus-within {
  border-color: rgba(224, 183, 117, 0.55);
  box-shadow:
    var(--sh-inset),
    0 0 0 3px var(--accent-soft);
}
.ctl.err {
  border-color: rgba(224, 98, 75, 0.69);
}
.ctl input,
.ctl select,
.ctl textarea {
  flex: 1;
  width: 100%;
  border: 0;
  background: none;
  outline: none;
  color: var(--text);
  font: 15px var(--font);
  height: 100%;
}
.ctl input::placeholder,
.ctl textarea::placeholder {
  color: var(--text-3);
}
.ctl .sfx {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
}
.ctl.area {
  height: auto;
  padding: 10px 14px;
}
.ctl textarea {
  resize: vertical;
  min-height: 76px;
  line-height: 1.5;
}
.ctl select {
  appearance: none;
  cursor: pointer;
  padding-right: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%239aa0aa' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E")
    no-repeat right center;
}
.ctl select option {
  background: #20242c;
}
.ctl.disabled {
  opacity: 0.45;
}
.ctl.sm {
  height: 32px;
  padding: 0 12px;
}
.ctl.sm input,
.ctl.sm select {
  font-size: 13px;
}
.kbd,
kbd {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border-radius: calc(6px * 0.45);
  font: 500 11px var(--mono);
  color: var(--text-2);
  background: linear-gradient(180deg, #30353d, #2d3139);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.075),
    0 1px 0 rgba(0, 0, 0, 0.525);
  white-space: nowrap;
}
.check,
.radio {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  cursor: pointer;
  min-height: 28px;
}
.check input,
.radio input,
input.check-box {
  appearance: none;
  margin: 0;
  width: 18px;
  height: 18px;
  flex: none;
  background: var(--inset);
  box-shadow: var(--sh-inset);
  border: 1px solid var(--rim);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.check input,
input.check-box {
  border-radius: calc(5px * 0.45);
}
.radio input {
  border-radius: 50%;
}
.check input:checked,
input.check-box:checked {
  background: var(--g-accent);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.check input:checked::after,
input.check-box:checked::after {
  content: "";
  width: 5px;
  height: 9px;
  border: solid var(--on-accent);
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg);
}
.check input:indeterminate,
input.check-box:indeterminate {
  background: var(--g-accent);
}
.check input:indeterminate::after,
input.check-box:indeterminate::after {
  content: "";
  width: 8px;
  height: 2px;
  background: var(--on-accent);
  border-radius: calc(2px * 0.45);
}
.radio input:checked {
  border-color: rgba(224, 183, 117, 0.7);
}
.radio input:checked::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--g-white);
  box-shadow: 0 0 0 3px var(--accent);
}
.switch {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 13.5px;
  min-height: 28px;
}
.switch input {
  appearance: none;
  margin: 0;
  width: 40px;
  height: 24px;
  border-radius: 999px;
  background: var(--inset);
  box-shadow: var(--sh-inset);
  position: relative;
  cursor: pointer;
  flex: none;
  transition: background 0.2s;
}
.switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--g-white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s;
}
.switch input:checked {
  background: var(--g-accent);
}
.switch input:checked::after {
  transform: translateX(16px);
}
.range {
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  margin: 10px 0;
  background: linear-gradient(
    90deg,
    var(--accent) var(--p, 50%),
    var(--track) var(--p, 50%)
  );
  box-shadow: var(--sh-inset);
  cursor: pointer;
}
.range::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--g-white);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.225),
    0 2px 6px rgba(0, 0, 0, 0.45);
}
.range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: #eef1f6;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}
.stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: var(--inset);
  box-shadow: var(--sh-inset);
}
.stepper output {
  min-width: 64px;
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  height: calc(30px * 1);
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--rim-hi);
  background: var(--g-ghost);
  color: var(--text-2);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.chip:hover {
  color: var(--text);
}
.chip[aria-pressed="true"] {
  background: var(--g-white);
  color: var(--on-light);
  border-color: rgba(255, 255, 255, 0.6);
}
.chip .n {
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
}
/* A chip that only labels something, such as a supported agent. */
span.chip {
  cursor: default;
  font-weight: 500;
  font-size: 13px;
}
span.chip:hover {
  color: var(--text-2);
}

/* ---------- badges and status */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  background: #272b33;
  border: 1px solid var(--rim-hi);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.badge.accent {
  background: rgba(224, 183, 117, 0.14);
  border-color: rgba(224, 183, 117, 0.368);
  color: var(--accent-2);
}
.badge.ok,
.badge.strong {
  background: rgba(73, 163, 115, 0.14);
  border-color: rgba(73, 163, 115, 0.368);
  color: var(--green-ink);
}
.badge.warn,
.badge.possible {
  background: rgba(215, 183, 70, 0.13);
  border-color: rgba(215, 183, 70, 0.345);
  color: #e1ca76;
}
.badge.bad {
  background: rgba(224, 98, 75, 0.14);
  border-color: rgba(224, 98, 75, 0.368);
  color: var(--red-ink);
}
.badge.slate,
.badge.weak,
.badge.dropped {
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.25);
  color: var(--slate);
}
.badge.solid {
  background: var(--g-white);
  color: var(--on-light);
  border-color: transparent;
}
/* Confidence bands read as labels, so they are set in small capitals. */
.badge.band {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10.5px;
}
.badge.lg {
  height: 26px;
  padding: 0 11px;
  font-size: 12px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
}
.status .dot {
  color: var(--slate);
}
.status.ok .dot {
  color: var(--success);
}
.status.warn .dot {
  color: var(--warning);
}
.status.bad .dot {
  color: var(--danger);
}
.status.accent .dot {
  color: var(--accent);
}
.datechip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--inset);
  box-shadow: var(--sh-inset);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  white-space: nowrap;
}

/* ---------- data visualisation: no gridlines or frames; the accent is the signal */
.ring {
  position: relative;
  width: 180px;
  height: 180px;
  margin: auto;
}
.ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(135deg);
}
.ring .tr {
  stroke: var(--track);
  stroke-width: 12;
  fill: none;
  stroke-linecap: round;
}
.ring .val {
  stroke: url(#ui-ring);
  stroke-width: 12;
  fill: none;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(224, 183, 117, 0.2625));
  transition: stroke-dashoffset 1.2s var(--ease);
}
.ring .ctr {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}
.ring .ctr b {
  font-size: 34px;
  letter-spacing: -0.03em;
  line-height: 1;
}
.ring .ctr small {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 4px;
}
.ring-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.ring-row b {
  display: block;
  font-size: 20px;
}
.ring-row small {
  font-size: 12px;
  color: var(--text-2);
}
.bar {
  height: 8px;
  border-radius: 999px;
  background: var(--track);
  box-shadow: var(--sh-inset);
  position: relative;
  overflow: visible;
}
.bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: var(--g-accent);
}
.bar.thin {
  height: 4px;
}
.bar .tick {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  border-radius: calc(2px * 0.45);
  background: #f4f5f8;
}
.bar.ok > span {
  background: var(--green);
}
.bar.warn > span {
  background: var(--amber);
}
.bar.bad > span {
  background: var(--red);
}
.bar.s > span,
.bar.slate > span {
  background: var(--slate);
}
.heat {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 5px;
}
.heat i {
  aspect-ratio: 1;
  border-radius: calc(4px * 0.45);
  background: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.heat i.off {
  background: #111419;
  box-shadow: var(--sh-inset);
}
.heat i.today {
  outline: 1.5px solid rgba(255, 255, 255, 0.55);
  outline-offset: 1px;
  background: #42464d;
}
.pace {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  text-align: center;
}
.pace i {
  display: block;
  aspect-ratio: 1;
  border-radius: calc(4px * 0.45);
  background: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.pace i.u {
  background: var(--slate);
}
.pace small {
  font-size: 10.5px;
  color: var(--text-3);
  margin-top: 5px;
  display: block;
}
.pace small.t {
  color: var(--text);
  font-weight: 700;
}
.stk {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.stk div {
  display: flex;
  flex-direction: column;
  height: 44px;
  border-radius: calc(5px * 0.45);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.stk div.today {
  outline: 1.5px solid rgba(255, 255, 255, 0.55);
  outline-offset: 2px;
}
.fig {
  position: relative;
  min-height: 220px;
}
.fig > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* Meter rows: a name, a value and a share, above a thin track. */
.meters {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.meters .r {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 44px;
  gap: 6px 12px;
  align-items: baseline;
  font-size: 13px;
}
.meters .r .bar {
  grid-column: 1 / -1;
}
.meters .r > span:nth-child(2) {
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  white-space: nowrap;
}
.meters .r > span:nth-child(2) b {
  color: var(--text);
}
.meters .r > span:nth-child(3) {
  text-align: right;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
/* Stat card: an eyebrow, a big value with a unit, a muted line under it. */
.stat .v {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.stat .d {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}
.spark {
  height: 34px;
  margin-top: 10px;
  width: 100%;
  display: block;
}
.legend {
  display: flex;
  gap: 8px 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-2);
}
.legend > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.swatch {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: calc(3px * 0.45);
}
.swatch.line {
  width: 14px;
  height: 3px;
  border-radius: calc(2px * 0.45);
}
.swatch.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

/* ---------- lists and tables: an inset tray with hairline dividers */
.list {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #1b1c20;
  box-shadow: var(--sh-inset);
}
.entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 4px 14px;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--hair);
}
.entry:first-child {
  border-top: 0;
}
.entry:hover {
  background: rgba(255, 255, 255, 0.023);
}
.entry b {
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  gap: 6px;
  align-items: center;
}
.entry small {
  display: block;
  font-size: 12px;
  color: var(--text-3);
}
.entry .val {
  text-align: right;
}
.entry .val b {
  justify-content: flex-end;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-3);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--hair);
}
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--hair);
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover td {
  background: rgba(255, 255, 255, 0.023);
}
td.n,
th.n {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- feedback */
.alert {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--rim);
  background: var(--g-card);
  box-shadow: var(--sh-raised);
}
.alert .ic {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.alert b {
  font-size: 13.5px;
  display: block;
}
.alert p {
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 2px;
}
.alert.info .ic {
  color: var(--accent);
  background: var(--accent-soft);
}
.alert.ok .ic {
  color: var(--success);
  background: rgba(73, 163, 115, 0.15);
}
.alert.warn .ic {
  color: var(--warning);
  background: rgba(215, 183, 70, 0.14);
}
.alert.bad .ic {
  color: var(--danger);
  background: rgba(224, 98, 75, 0.15);
}
.tip {
  position: relative;
  display: inline-flex;
}
.tip > [role="tooltip"] {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translate(-50%, 4px);
  opacity: 0;
  pointer-events: none;
  transition: 0.15s;
  background: linear-gradient(180deg, #30353d, #2d323a);
  border: 1px solid var(--rim-hi);
  box-shadow: var(--sh-float);
  padding: 6px 10px;
  border-radius: calc(8px * 0.45);
  font-size: 12px;
  white-space: nowrap;
  z-index: 5;
}
.tip:hover > [role="tooltip"],
.tip:focus-within > [role="tooltip"] {
  opacity: 1;
  transform: translate(-50%, 0);
}
.skel {
  display: block;
  border-radius: calc(8px * 0.45);
  background: linear-gradient(90deg, #21252d 0%, #2b2f37 40%, #21252d 80%);
  background-size: 200% 100%;
  animation: ui-sh 1.4s linear infinite;
}
@keyframes ui-sh {
  to {
    background-position: -200% 0;
  }
}
.empty {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 18px;
}
.empty > .ic {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--inset);
  box-shadow: var(--sh-inset);
  color: var(--text-3);
}
.empty > .ic svg {
  width: 22px;
  height: 22px;
}
.empty p {
  color: var(--text-2);
  font-size: 13px;
  max-width: 44ch;
}
.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 60;
  width: min(340px, calc(100vw - 40px));
}
.toast {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  background: var(--g-float);
  border: 1px solid var(--rim-hi);
  box-shadow: var(--sh-float);
  font-size: 13px;
  animation: ui-tin 0.25s ease-out;
}
.toast .ic {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}
.toast.bad .ic {
  background: rgba(224, 98, 75, 0.15);
  color: var(--danger);
}
.toast p {
  flex: 1;
}
.toast .btn {
  flex: none;
}
@keyframes ui-tin {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------- overlays: the strongest shadow and a blurred scrim; all close with Esc */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  place-items: center;
  padding: 16px;
  z-index: 50;
}
.scrim.open {
  display: grid;
}
.dialog {
  width: min(480px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, #22262e 0%, #20242b 40%, #1f232a 100%);
  border: 1px solid var(--rim-hi);
  box-shadow: var(--sh-float);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dialog.cmd {
  padding: 10px;
  gap: 6px;
  width: min(560px, 100%);
  align-self: start;
  margin-top: 12vh;
}
.dialog header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.dialog h3 {
  font-size: 18px;
}
.dialog footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  padding: 6px;
  border-radius: calc(14px * 0.45);
  background: linear-gradient(180deg, #282c33, #262a31);
  border: 1px solid var(--rim-hi);
  box-shadow: var(--sh-float);
  display: none;
  z-index: 20;
}
.menu.open {
  display: block;
}
.mi {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: calc(36px * 1);
  padding: 0 10px;
  border: 0;
  background: none;
  border-radius: calc(9px * 0.45);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}
.mi:hover,
.mi.on,
.mi[aria-current="page"] {
  background: rgba(255, 255, 255, 0.069);
}
.mi .kbd {
  margin-left: auto;
}
.mi svg {
  color: var(--text-2);
}
.mi.bad,
.mi.bad svg {
  color: var(--red-ink);
}
.sep {
  height: 1px;
  background: var(--hair);
  margin: 5px 4px;
}
.mlabel {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 8px 10px 4px;
}

/* ---------- navigation pieces */
.crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-3);
  flex-wrap: wrap;
}
.crumbs a {
  color: var(--text-2);
  text-decoration: none;
}
.crumbs a:hover {
  color: var(--text);
}
.crumbs b {
  color: var(--text);
  font-weight: 600;
}
.crumbs svg.i {
  width: 12px;
  height: 12px;
}
.steps {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
}
.steps span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
}
.steps span i {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  background: var(--inset);
  box-shadow: var(--sh-inset);
}
.steps span.done {
  color: var(--text-2);
}
.steps span.done i {
  background: var(--g-accent);
  color: var(--on-accent);
  box-shadow: none;
}
.steps span.cur {
  color: var(--text);
}
.steps span.cur i {
  background: var(--g-white);
  color: var(--on-light);
}
.steps hr {
  flex: 0 0 24px;
  border: 0;
  height: 1px;
  background: var(--rim-hi);
  margin: 0;
}

/* ---------- responsive */
@media (max-width: 1100px) {
  .c8,
  .c7,
  .c6,
  .c5,
  .c4 {
    grid-column: span 12;
  }
  .c3 {
    grid-column: span 6;
  }
}
@media (max-width: 900px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .side {
    position: relative;
    top: 0;
    height: auto;
  }
  .nav {
    flex-direction: row;
    overflow-x: auto;
    margin-top: 0;
  }
  .side .foot,
  .side .sidebtns {
    display: none;
  }
}
@media (max-width: 600px) {
  .shell {
    padding: 8px;
  }
  .window {
    padding: 16px;
    border-radius: calc(18px * 0.45);
  }
  .c3 {
    grid-column: span 12;
  }
  .ctl input,
  .ctl select,
  .ctl textarea {
    font-size: 16px;
  }
  .btn {
    min-height: 40px;
  }
  .btn.sm {
    min-height: 32px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ---------- app components: first built for the dashboard, shared so later pages use the same ones */

/* Side sheet: a floating panel at the right over a blurred scrim, for one record's detail. */
.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(8, 10, 14, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: ui-fade 0.2s ease-out;
}
.drawer {
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 31;
  width: min(900px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, #2c3038, #22262d 40%, #1f232a);
  border: 1px solid var(--rim-hi);
  box-shadow: var(--sh-float);
  outline: none;
  animation: ui-slide 0.25s var(--ease);
}
@keyframes ui-fade {
  from {
    opacity: 0;
  }
}
@keyframes ui-slide {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
}
/* The sheet's header bar: a title that truncates, and its navigation and close buttons. */
.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 12px 22px;
  border-bottom: 1px solid var(--hair);
}
.drawer-head h2 {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drawer-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
}
/* The sheet's body scrolls; a wide section scrolls sideways inside itself, padded so focus rings at its edges stay visible. */
.drawer-body {
  padding: 22px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: max-content;
  gap: 28px;
  align-content: start;
}
.drawer-body > section {
  overflow-x: auto;
  padding: 6px;
  margin: -6px;
}
/* Every label column in a sheet is the same width, so values line up from one section to the next. */
.drawer .kv:not(.tree) {
  grid-template-columns: 150px minmax(0, 1fr);
}
/* A section title inside a sheet or card: an eyebrow. */
.section-title {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 10px;
}

/* Foldable section: closed until asked for, with its title and a one-line summary of what is inside. */
details.fold > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
details.fold > summary::-webkit-details-marker {
  display: none;
}
details.fold > summary .section-title {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
details.fold > summary .section-title::before {
  content: "";
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
details.fold[open] > summary .section-title::before {
  transform: rotate(45deg);
}
details.fold > summary .fold-sum {
  font-size: 12px;
  color: var(--text-3);
  min-width: 0;
  overflow-wrap: anywhere;
}
details.fold[open] > summary {
  margin-bottom: 12px;
}
details.fold > summary:hover .section-title {
  color: var(--text-2);
}

/* Form popover: a small floating form under the control that opened it (place its parent position: relative). */
.popover {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  display: grid;
  gap: 12px;
  min-width: 260px;
  padding: 16px;
  border-radius: calc(16px * 0.45);
  background: var(--g-float);
  border: 1px solid var(--rim-hi);
  box-shadow: var(--sh-float);
}
.popover label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}
.popover .row {
  justify-content: flex-end;
  gap: 8px;
}
/* Bare fields, a popover's inputs and a standalone .select, sunk into the surface like .ctl. */
.popover input,
.select {
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: var(--inset);
  box-shadow: var(--sh-inset);
  color: var(--text);
  font-size: 13px;
}
.popover input:focus-visible,
.select:focus-visible {
  outline: none;
  border-color: rgba(224, 183, 117, 0.55);
  box-shadow:
    var(--sh-inset),
    0 0 0 3px var(--accent-soft);
}
.select option {
  background: var(--surface);
}

/* Action bar: a floating bar of actions for what is on screen, such as a review queue's decisions. */
.action-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px 12px;
  flex-wrap: wrap;
  padding: 8px 10px 8px 12px;
  border-radius: calc(26px * 0.45);
  background: var(--g-float);
  border: 1px solid var(--rim-hi);
  box-shadow: var(--sh-float);
}
/* Key hints inside buttons: smaller keycaps, dark on the white button. */
.btn kbd {
  height: 18px;
  padding: 0 5px;
  font-size: 10.5px;
}
.btn.primary kbd {
  background: rgba(0, 0, 0, 0.07);
  color: var(--on-light);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.btn.danger kbd {
  color: var(--red-ink);
}

/* Centred toast: one status line floating above the bottom of the screen, hidden while empty; .bad for a failure. */
.toast.center {
  position: fixed;
  left: 50%;
  bottom: 96px;
  translate: -50% 0;
  z-index: 40;
  width: max-content;
  max-width: min(90vw, 640px);
  padding: 10px 18px;
  border-radius: var(--r-pill);
}
.toast.center:empty {
  display: none;
}
.toast.center.bad {
  border-color: rgba(224, 98, 75, 0.4);
  color: var(--red-ink);
}

/* Stat strip: headline figures as a row of stat cards; .minor puts smaller figures in one card, split by hairlines. */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.metrics + .metrics {
  margin-top: 16px;
}
.metrics > .stat {
  padding: 16px 18px 15px;
  min-width: 0;
  border-radius: var(--r-lg);
  background: var(--g-card);
  border: 1px solid var(--rim);
  box-shadow: var(--sh-raised);
}
.metrics .stat .v {
  font-size: 28px;
  line-height: 1.15;
  margin-top: 8px;
}
.metrics .stat .d {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
  margin-top: 4px;
}
.metrics.minor {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  border-radius: var(--r-lg);
  background: var(--g-card);
  border: 1px solid var(--rim);
  box-shadow: var(--sh-raised);
}
.metrics.minor > .stat {
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  border-left: 1px solid var(--hair);
}
.metrics.minor > .stat:first-child {
  border-left: 0;
}
.metrics.minor .stat .v {
  font-size: 20px;
}
/* A change against the previous period: green when it went the good way, red when it did not. */
.delta {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.delta.up-good,
.delta.down-good {
  color: var(--green-ink);
}
.delta.up-bad,
.delta.down-bad {
  color: var(--red-ink);
}
.delta.flat {
  color: var(--text-3);
}

/* Key-value list: labels in a quiet column, values beside them. */
.kv {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 9px 20px;
  font-size: 13px;
  margin: 0;
}
.kv dt {
  font-size: 12px;
  line-height: 20px;
  font-weight: 500;
  color: var(--text-3);
}
.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* Rendered Markdown: a base for running text, which a page can size and refine. */
.prose {
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.prose > :first-child {
  margin-top: 0;
}
.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  margin: 1.3em 0 0.4em;
  line-height: 1.3;
}
.prose h1 {
  font-size: 20px;
}
.prose h2 {
  font-size: 17px;
}
.prose h3 {
  font-size: 15px;
}
.prose h4,
.prose h5,
.prose h6 {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-3);
}
.prose img {
  max-width: 100%;
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--hair);
  margin: 1.4em 0;
}
.prose p,
.prose ul,
.prose ol {
  margin: 0.6em 0;
}
.prose li > p {
  margin: 0.2em 0;
}
.prose code {
  font-size: 12px;
  background: var(--inset);
  padding: 1px 6px;
  border-radius: calc(6px * 0.45);
}
.prose pre code {
  background: none;
  padding: 0;
}
.prose a code {
  color: inherit;
}
.prose blockquote {
  margin: 0.6em 0;
  padding-left: 12px;
  border-left: 2px solid var(--rim-hi);
  color: var(--text-2);
}
.prose table {
  font-size: 13px;
  margin: 0.6em 0;
}
.prose td,
.prose th {
  border: 1px solid var(--hair);
  padding: 5px 8px;
}
/* Code and raw text in a sunken block; pre.raw wraps long lines. */
.prose pre,
pre.raw {
  margin: 0.6em 0;
  background: var(--inset);
  box-shadow: var(--sh-inset);
  border-radius: var(--r-md);
  padding: 12px 14px;
  overflow-x: auto;
  font: 12px / 1.6 var(--mono);
  color: var(--text);
}
pre.raw {
  white-space: pre-wrap;
  margin: 0;
}
/* A short sunken note; .block-text keeps the text's own line breaks. */
.block-text,
.callout {
  background: var(--inset);
  box-shadow: var(--sh-inset);
  border-radius: var(--r-md);
  padding: 11px 13px;
  font-size: 13px;
  color: var(--text-2);
}
.block-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Diff lines: added green, removed red, the changed words inside a line tinted more strongly. */
.diff {
  margin: 0;
  max-height: 420px;
  overflow: auto;
  padding: 8px 0;
  font: 12px / 1.6 var(--mono);
  background: var(--inset);
  box-shadow: var(--sh-inset);
  border-radius: var(--r-md);
  color: var(--text-2);
}
.diff div {
  padding: 0 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.diff .add {
  background: rgba(73, 163, 115, 0.12);
  color: var(--green-ink);
}
.diff .del {
  background: rgba(224, 98, 75, 0.12);
  color: var(--red-ink);
}
.diff mark {
  color: inherit;
  border-radius: calc(3px * 0.45);
  padding: 0 1px;
  background: rgba(255, 255, 255, 0.14);
}
.diff .add mark {
  background: rgba(73, 163, 115, 0.38);
}
.diff .del mark {
  background: rgba(224, 98, 75, 0.38);
}

/* Data tables in a .table-wrap: they scroll sideways, and take their cell padding from --cell-x and the outer cells' from --cell-edge. */
.table-wrap {
  overflow-x: auto;
}
.table-wrap table {
  --cell-x: 14px;
  --cell-edge: 14px;
}
.table-wrap th,
.table-wrap td {
  padding-left: var(--cell-x);
  padding-right: var(--cell-x);
}
.table-wrap :is(th, td):first-child {
  padding-left: var(--cell-edge);
}
.table-wrap :is(th, td):last-child {
  padding-right: var(--cell-edge);
}
th.num,
td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
/* A sortable column header: the header's own type, brighter when it is the sort. */
.sort-btn {
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  display: inline-flex;
  gap: 4px;
  align-items: center;
  cursor: pointer;
}
.sort-btn:hover,
.sort-btn[aria-sort] {
  color: var(--text);
}
/* A cell's title, and up to two quiet lines under it (.one for one). */
.cell-title {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.4;
}
.cell-sub {
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-top: 2px;
}
.cell-sub.mono {
  font: 11px / 1.5 var(--mono);
}
.cell-sub.one {
  -webkit-line-clamp: 1;
}

/* Chart tooltip: the values under the pointer, in a small floating layer above it. */
.tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  min-width: 150px;
  padding: 9px 12px;
  border-radius: calc(12px * 0.45);
  background: var(--g-float);
  border: 1px solid var(--rim-hi);
  box-shadow: var(--sh-float);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  transform: translate(-50%, calc(-100% - 10px));
  white-space: nowrap;
}
.tooltip .t-title {
  color: var(--text-3);
  margin-bottom: 5px;
}
.tooltip .t-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  color: var(--text-2);
}
.tooltip .t-row b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Slim track: a 6px inset bar whose <i> children fill it (the accent, or slate with .rest). */
.track {
  height: 6px;
  display: flex;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: var(--track);
  box-shadow: var(--sh-inset);
}
.track i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--g-accent);
}
.track i.rest {
  background: var(--slate);
}
/* Stacked bar: shares of a whole side by side, each child coloured and sized by the page. */
.stack {
  display: flex;
  gap: 2px;
  height: 10px;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: var(--track);
  box-shadow: var(--sh-inset);
}
.stack > div {
  height: 100%;
}

/* Error box: a failure in place of content that could not load. */
.error-box {
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: rgba(224, 98, 75, 0.1);
  border: 1px solid rgba(224, 98, 75, 0.28);
  color: var(--red-ink);
  font-size: 13px;
}
.error-box a {
  color: inherit;
  text-decoration: underline;
}
/* Link button: a button that reads as a small text link. */
.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent-ink);
  font: 500 12px var(--font);
  cursor: pointer;
  justify-self: start;
}
.link-btn:hover {
  text-decoration: underline;
}
/* Quiet round icon button, for toolbars inside cards and sheets. */
.icon-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}
.icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
  background: transparent;
}
/* An empty state's title. */
.empty b {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

@media (max-width: 1200px) {
  .metrics.minor {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .metrics.minor > .stat:nth-child(4n + 1) {
    border-left: 0;
  }
  .metrics.minor > .stat:nth-child(n + 5) {
    border-top: 1px solid var(--hair);
  }
  /* Seven figures in rows of four: the last one takes the empty cell beside it. */
  .metrics.minor > .stat:last-child:nth-child(7) {
    grid-column: span 2;
  }
}
@media (max-width: 900px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .metrics.minor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
  }
  .metrics.minor > .stat:nth-child(n) {
    border-left: 1px solid var(--hair);
    border-top: 1px solid var(--hair);
    grid-column: auto;
  }
  .metrics.minor > .stat:nth-child(2n + 1) {
    border-left: 0;
  }
  .metrics.minor > .stat:nth-child(-n + 2) {
    border-top: 0;
  }
  .metrics.minor > .stat:last-child:nth-child(odd) {
    grid-column: span 2;
  }
  .metrics > .stat {
    padding: 14px 16px;
  }
  .metrics .stat .v {
    font-size: 24px;
  }
  .drawer {
    top: 8px;
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
    border-radius: calc(18px * 0.45);
  }
  .drawer-body {
    padding: 18px 16px;
  }
  .drawer .kv:not(.tree) {
    grid-template-columns: 110px minmax(0, 1fr);
  }
}
@media (max-width: 600px) {
  /* An alert's trailing button goes under its text, so the text keeps the width; a close icon stays beside it. */
  .alert:has(> .btn:not(.icon)) {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .alert > .btn:not(.icon) {
    grid-column: 2;
    justify-self: start;
  }
}
