/* ===========================================================================
   eggNOG-mapper portal — redesign system
   Implements the design handoff: IBM Plex, violet/amber tokens, flat cards,
   light -> dark -> light rhythm. Loaded AFTER app.css so it wins; Tabler stays
   loaded for admin/monitor pages that this redesign does not cover.
   =========================================================================== */

/* ---- Self-hosted fonts (CSP blocks Google Fonts: font-src 'self' data:) --- */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;                 /* variable file covers the range */
  font-display: swap;
  src: url("/static/fonts/plex-sans.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/plex-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/plex-mono-500.woff2") format("woff2");
}
@font-face {                        /* CGM Lab wordmark, matching cgmlab.org */
  font-family: "Righteous";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/righteous.woff2") format("woff2");
}

/* ------------------------------- Tokens ----------------------------------- */
:root {
  /* Neutrals */
  --bg:            #F5F6FA;
  --surface:       #FFFFFF;
  --surface-alt:   #FAFAFD;
  --line:          #E3E4EF;
  --line-soft:     #EEEEF5;
  --line-strong:   #C8C9DC;
  --muted:         #767892;
  --body:          #545670;
  --body-alt:      #494B63;
  --ink:           #1E1E30;
  --disabled-fg:   #9EA0B4;
  --disabled-bg:   #F0F0F6;

  /* Brand */
  --accent:        #6B62A8;
  --accent-hover:  #524A87;
  --accent-light:  #7C73BD;
  --accent-soft:   #BDB8DC;
  --accent-border: #D8D5EC;
  --accent-tint:   #EEEDF7;
  --accent-wash:   #F6F5FB;

  --amber:         #C98B06;
  --amber-text:    #8A6104;
  --amber-tint:    #FCF2D8;
  --amber-border:  #EFD79A;

  /* Semantic */
  --ok: #2E7D52;   --ok-tint: #E6F2EC;  --ok-border: #BFDDD0;  --ok-text: #206045;
  --err: #B0362B;  --err-tint: #FDF3F2; --err-border: #E9C4BF; --err-text: #8E2A21;

  /* Dark surfaces */
  --navy: #1E1E30;
  --navy-line: #33334D;
  --navy-fg: #E4E4EE;
  --navy-muted: #8A8CA6;
  --navy-body: #A9AAC0;
  --navy-btn-bg: rgba(255,255,255,.08);
  --navy-btn-border: rgba(255,255,255,.18);
  --navy-btn-hover: rgba(255,255,255,.16);

  /* Radius (slightly tightened for a crisper, less-rounded look) */
  --r-sm: 4px;  --r-md: 5px;  --r-lg: 6px;  --r-xl: 7px;
  --r-2xl: 8px; --r-3xl: 10px; --r-pill: 999px;

  /* Make Tabler-driven (non-redesigned) pages inherit the violet accent */
  --tblr-primary: #6B62A8;
  --tblr-primary-rgb: 107, 98, 168;
  --p: #6B62A8; --p-d: #524A87; --p-lt: #EEEDF7;
  --tblr-font-sans-serif: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ------------------------------- Base ------------------------------------- */
body {
  background: var(--bg);
  color: var(--body);
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.mono, code, pre, kbd, samp { font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }

.rd h1, .rd h2, .rd h3, .rd h4 { color: var(--ink); text-wrap: pretty; }
.rd p { text-wrap: pretty; }
/* keep body text selectable everywhere — force it on every card descendant so
   no component rule (Tabler sets user-select:none on .btn/.badge/.form-check)
   can block selecting text inside a card, including the label-wrapped option
   cards where the browser would otherwise swallow drags as a radio toggle */
.rd, .rd-card, .rd-card *, .rd-navy, .rd-navy *, .rd-code,
.rd-opt__body, .rd-opt__body * {
  -webkit-user-select: text; user-select: text;
}
/* plain links only — never restyle buttons (their own color must win) */
.rd a:not(.rd-btn) { color: var(--accent); text-decoration: none; }
.rd a:not(.rd-btn):hover { color: var(--accent-hover); text-decoration: underline; }
.rd :where(table, .tabnum) { font-variant-numeric: tabular-nums; }

/* focus ring — never removed */
.rd a:focus-visible, .rd button:focus-visible, .rd input:focus-visible,
.rd select:focus-visible, .rd textarea:focus-visible, .rd label:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* main content area */
.rd-main { padding: 48px 0 64px; }
.rd-main .container-xl { max-width: 1180px; }

/* content column widths (each page sets its own) */
.rd-wrap { margin-inline: auto; }
.rd-wrap--1180 { max-width: 1180px; }
.rd-wrap--900  { max-width: 900px; }
.rd-wrap--880  { max-width: 880px; }
.rd-wrap--760  { max-width: 760px; }
/* left-align these narrow columns so their left edge matches the wider pages */
.page-about, .page-privacy { margin-left: 0; }

.rd-eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px; font-weight: 500; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted); line-height: 1.3;
}
.rd-lead { font-size: 18px; line-height: 1.6; color: var(--body-alt); max-width: 70ch; }
.rd-muted { color: var(--muted); }

/* ============================= Global chrome ============================== */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1000;
}
.site-header__inner {
  max-width: 1180px; margin-inline: auto;
  min-height: 64px; padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.site-header__left {
  display: flex; align-items: center; gap: 22px;
  flex-shrink: 0; min-width: max-content;
}
.site-header__right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.site-cta { flex-shrink: 0; }
.site-signin, .site-account {
  font-size: 14px; color: var(--body); white-space: nowrap; text-decoration: none;
  display: inline-flex; align-items: center;
}
.site-account { font-size: 20px; }
.site-signin:hover, .site-account:hover { color: var(--accent); text-decoration: none; }

.wordmark {
  font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--ink); white-space: nowrap; text-decoration: none;
  display: inline-flex; align-items: center;
}
.wordmark:hover { text-decoration: none; color: var(--ink); }
.wordmark__v { color: var(--amber); margin-left: 3px; font-weight: 700; }
/* CGM Lab wordmark logo (About), matching cgmlab.org (Righteous, on dark) */
.cgm-logo {
  display: inline-flex; align-items: baseline; gap: 4px;
  background: #0F1C2E; border-radius: 8px; padding: 10px 16px;
  font-family: "Righteous", cursive; font-size: 23px; line-height: 1; letter-spacing: 0.5px;
}
.cgm-logo__c { color: #4AA8DE; }
.cgm-logo__l { color: #EFF4FC; }
.cgm-logo--sm { font-size: 15px; padding: 5px 11px; border-radius: 6px; }

.wordmark__mark { display: inline-flex; margin-right: 9px; flex-shrink: 0; }
.wordmark__mark svg { width: 23px; height: 23px; display: block; }

/* no base `display` so Bootstrap's .collapse can hide it on mobile;
   desktop forces flex-row below, .show reveals it stacked on mobile */
.site-nav { align-items: center; gap: 4px; }
.site-nav a {
  position: relative;
  font-size: 14px; color: var(--body); white-space: nowrap;
  padding: 6px 10px; border-radius: var(--r-sm); text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.site-nav a .ti { font-size: 16px; color: var(--muted); }
.site-nav a:hover .ti, .site-nav a.is-active .ti { color: var(--accent); }
/* active-page indicator: an accent underline under the current section */
.site-nav a.is-active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 1px;
  height: 2px; border-radius: 2px; background: var(--accent);
}
.site-nav a:hover { color: var(--accent); text-decoration: none; background: var(--accent-wash); }
.site-nav a.is-active { color: var(--accent); font-weight: 600; }
.site-nav .nav-ext::after { content: " \2197"; font-size: .85em; color: var(--muted); }
.nav-sep { align-self: center; width: 1px; height: 18px; background: var(--line-strong); margin: 0 5px; flex-shrink: 0; }
.site-ver { font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--amber); white-space: nowrap; }

.nav-toggle {
  display: none; border: 1px solid var(--line-strong); background: var(--surface);
  border-radius: var(--r-sm); padding: 6px 9px; color: var(--body); cursor: pointer;
}

/* GitHub star badge */
.gh-badge {
  display: inline-flex; align-items: center; border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); overflow: hidden; flex-shrink: 0; white-space: nowrap;
  text-decoration: none;
}
.gh-badge:hover { border-color: var(--accent); text-decoration: none; }
.gh-badge__l {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-alt); color: var(--body);
  font-size: 12px; font-weight: 500; padding: 6px 10px;
}
.gh-badge__l svg { width: 14px; height: 14px; }
.gh-badge__r {
  font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--ink);
  padding: 6px 10px; border-left: 1px solid var(--line); background: var(--surface);
  font-variant-numeric: tabular-nums;
}

.site-footer { background: var(--surface); border-top: 1px solid var(--line); }
.site-footer__inner {
  max-width: 1180px; margin-inline: auto; padding: 28px 32px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.site-footer__inner, .site-footer a {
  font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--muted);
}
.site-footer a:hover { color: var(--accent); }

/* ============================== Buttons =================================== */
.rd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 15px; font-weight: 500; line-height: 1;
  padding: 13px 24px; border-radius: var(--r-lg); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; min-height: 46px;
  transition: background .15s ease-out, border-color .15s ease-out, color .15s ease-out;
}
.rd-btn:hover { text-decoration: none; }
.rd-btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.rd-btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.rd-btn--secondary { background: #fff; border-color: var(--line-strong); color: var(--ink); }
.rd-btn--secondary:hover { border-color: var(--accent); color: var(--accent); }
.rd-btn--sm { font-size: 14px; padding: 9px 18px; min-height: 40px; border-radius: var(--r-md); }
.rd-btn--utility {
  font-family: "IBM Plex Mono", monospace; font-size: 12px; font-weight: 500;
  padding: 8px 14px; min-height: 0; border-radius: var(--r-sm);
  background: #fff; border-color: var(--line-strong); color: var(--body);
}
.rd-btn--utility:hover { border-color: var(--accent); color: var(--accent); }
.rd-btn--navy {
  font-family: "IBM Plex Mono", monospace; font-size: 12px; font-weight: 500;
  padding: 10px 14px; min-height: 0; border-radius: var(--r-sm);
  background: var(--navy-btn-bg); border-color: var(--navy-btn-border); color: #D3D4E2;
}
.rd-btn--navy:hover { background: var(--navy-btn-hover); color: #fff; }
.rd-btn:disabled, .rd-btn.is-disabled {
  background: var(--disabled-bg); border-color: var(--line); color: var(--disabled-fg);
  cursor: not-allowed; pointer-events: none;
}
.rd-btn--block { width: 100%; }

/* ============================== Cards ===================================== */
.rd-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-2xl); padding: 24px;
}
.rd-card--panel { border-radius: var(--r-3xl); padding: 28px; }
.rd-card--sm { padding: 22px; }
.rd-card__title { font-size: 16px; font-weight: 600; color: var(--ink); margin: 0 0 4px; }
.rd-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--r-lg);
  background: var(--accent-tint); color: var(--accent); font-size: 21px; flex-shrink: 0;
}
.rd-ico--accent { background: var(--accent); color: #fff; }

/* How-it-works pipeline steps: centered icon + stage label, equal cards */
.how-step__ico { display: flex; justify-content: center; margin-bottom: 12px; }
.how-step .rd-eyebrow, .how-step h3 { text-align: center; }
.rd-grid { display: grid; gap: 16px; }
.rd-grid--2 { grid-template-columns: repeat(2, 1fr); }
.rd-grid--3 { grid-template-columns: repeat(3, 1fr); }
.rd-grid--4 { grid-template-columns: repeat(4, 1fr); }
.rd-grid--14 { gap: 14px; }

/* ============================ Chips / pills =============================== */
.rd-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: "IBM Plex Mono", monospace; font-size: 12px; line-height: 1;
  padding: 4px 9px; border-radius: var(--r-sm); border: 1px solid transparent;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.rd-chip--running { background: var(--accent-tint); border-color: var(--accent-border); color: var(--accent-hover); }
.rd-chip--queued  { background: var(--amber-tint); border-color: var(--amber-border); color: var(--amber-text); }
.rd-chip--done    { background: var(--ok-tint);  border-color: var(--ok-border);  color: var(--ok-text); }
.rd-chip--failed  { background: var(--err-tint); border-color: var(--err-border); color: var(--err-text); }
.rd-chip--created { background: var(--surface-alt); border-color: var(--line); color: var(--muted); }
.rd-chip--expired { background: var(--surface-alt); border-color: var(--line-strong, #C8C9DC); color: var(--muted); }

/* ---- current-limits strip on the submission form ---- */
.rd-limits {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px;
  padding: 11px 16px; margin-bottom: 24px;
  background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--r-md);
  font-size: 13px; color: var(--body);
}
.rd-limits__lead {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
}
.rd-limits__item { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rd-limits__item i { font-size: 15px; color: var(--accent); }
.rd-limits__sep { width: 1px; height: 15px; background: var(--line); }
@media (max-width: 560px) { .rd-limits__sep { display: none; } }

/* ---- home right column: live queue + news stacked ---- */
.hero-side { display: flex; flex-direction: column; gap: 16px; }

/* ---- news / changelog box (last 3 shown, older ones expand + scroll) ---- */
.news__hd {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 20px; border-bottom: 1px solid var(--line);
  font-size: 15px; font-weight: 600; color: var(--ink);
}
.news__hd i { font-size: 17px; color: var(--accent); }
.news__list { list-style: none; margin: 0; padding: 6px 0; }
.news__list--scroll { max-height: 172px; overflow-y: auto; overscroll-behavior: contain; padding-top: 0; }
.news__item { display: flex; gap: 9px; align-items: baseline; padding: 6px 20px; font-size: 12.5px; }
.news__date { flex-shrink: 0; width: 40px; font-size: 11px; font-weight: 500; color: var(--muted); }
.news__tag {
  flex-shrink: 0; font-size: 10px; font-weight: 600; line-height: 1.5;
  letter-spacing: 0.02em; padding: 1px 7px; border-radius: var(--r-sm);
  border: 1px solid transparent; text-transform: uppercase;
}
.news__tag--fix      { background: var(--ok-tint);      color: var(--ok-text);     border-color: var(--ok-border); }
.news__tag--new      { background: var(--accent-tint);  color: var(--accent-hover); border-color: var(--accent-border); }
.news__tag--improved { background: var(--amber-tint);   color: var(--amber-text);  border-color: var(--amber-border); }
.news__tag--notice   { background: var(--surface-alt);  color: var(--muted);       border-color: var(--line); }
.news__text { color: var(--body); line-height: 1.45; text-wrap: pretty; }
.news__sum {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 20px; border-top: 1px solid var(--line);
  font-size: 12px; font-weight: 600; color: var(--accent);
}
.news__sum::-webkit-details-marker { display: none; }
.news__sum i { font-size: 15px; transition: transform .15s ease-out; }
.news__more[open] .news__sum i { transform: rotate(180deg); }

/* ---- public home job queue: an elegant live summary, expands on demand ---- */
.rd-queue__sum { list-style: none; cursor: pointer; user-select: none; display: block; }
.rd-queue__sum::-webkit-details-marker { display: none; }

.rd-queue__stats { display: flex; align-items: center; padding: 15px 18px 13px; }
.rd-queue__stat { display: flex; flex-direction: column; gap: 4px; padding: 0 13px; }
.rd-queue__stat:first-child { padding-left: 0; }
.rd-queue__fig {
  font-size: 23px; font-weight: 600; line-height: 1; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.rd-queue__lbl { font-size: 10.5px; font-weight: 500; letter-spacing: 0.01em; color: var(--muted); white-space: nowrap; }
.rd-queue__stat--run  .rd-queue__fig { color: var(--accent); }
.rd-queue__stat--q    .rd-queue__fig { color: var(--amber-text); }
.rd-queue__stat--done .rd-queue__fig { color: var(--ok-text); }
.rd-queue__div { width: 1px; align-self: stretch; margin: 5px 0; background: var(--line); }
.rd-queue__chev {
  margin-left: auto; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-content: center; color: var(--accent);
  background: var(--accent-tint); transition: background .15s ease-out;
}
.rd-queue__chev i { font-size: 17px; transition: transform .18s ease-out; }
.rd-queue[open] .rd-queue__chev i { transform: rotate(180deg); }
.rd-queue__sum:hover .rd-queue__chev { background: var(--accent-border); }

/* featured preview: the longest-running (or next-up) job */
.rd-queue__feat {
  display: flex; align-items: center; gap: 9px; font-size: 12.5px;
  padding: 10px 20px; border-top: 1px solid var(--line-soft, #EEEFF6);
}
.rd-queue__pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0;
  animation: rd-pulse 2s ease-out infinite;
}
@keyframes rd-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(107, 98, 168, 0.45); }
  70%  { box-shadow: 0 0 0 6px rgba(107, 98, 168, 0); }
  100% { box-shadow: 0 0 0 0 rgba(107, 98, 168, 0); }
}
@media (prefers-reduced-motion: reduce) { .rd-queue__pulse { animation: none; } }
.rd-queue__feat-who { color: var(--body); flex-shrink: 0; }
.rd-queue__feat-meta { flex: 1; min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-queue__feat-t { margin-left: auto; flex-shrink: 0; color: var(--accent); font-variant-numeric: tabular-nums; }
.rd-queue__feat-t--wait { color: var(--amber-text); font-style: italic; }
.rd-queue__feat--idle { color: var(--muted); }

.rd-queue__body { border-top: 1px solid var(--line); max-height: 300px; overflow-y: auto; }

/* prominent input-file name on the job page */
.rd-jobfile {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  margin-bottom: 13px; padding: 5px 12px 5px 10px;
  background: var(--accent-tint); border: 1px solid var(--accent-border);
  border-radius: var(--r-md);
}
.rd-jobfile i { font-size: 17px; color: var(--accent); flex-shrink: 0; }
.rd-jobfile .mono {
  font-size: 14.5px; font-weight: 500; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* the compact, columned table with grouped bodies */
.rd-qtable { width: 100%; border-collapse: collapse; font-size: 12.5px; table-layout: fixed; }
.rd-qtable th, .rd-qtable td {
  padding: 5px 12px; text-align: left; vertical-align: middle;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rd-qtable thead th {
  font-family: "IBM Plex Mono", monospace; font-size: 10px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
  padding-top: 11px; padding-bottom: 9px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.rd-qtable td { border-bottom: 1px solid var(--line-soft, #EEEFF6); }
.rd-qtable tbody tr:last-child td { border-bottom: 0; }
.rd-qtable .num { text-align: right; font-variant-numeric: tabular-nums; }
.rd-qt-who { color: var(--body); }
.rd-qt-type { color: var(--muted); }
.rd-qt-t { color: var(--muted); font-variant-numeric: tabular-nums; }
.rd-qt-seq { color: var(--ink); }
/* group separator row */
.rd-qt-grp td {
  background: var(--surface-alt); border-bottom: 1px solid var(--line);
  padding-top: 6px; padding-bottom: 6px;
}
.rd-qt-grp__lbl {
  font-size: 10px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--muted);
}
.rd-qt-grp__n {
  font-family: "IBM Plex Mono", monospace; font-size: 10px; font-weight: 600;
  color: var(--muted); margin-left: 6px;
}
.rd-qt-grp--run .rd-qt-grp__lbl, .rd-qt-grp--run .rd-qt-grp__n { color: var(--accent); }
.rd-qt-more td { color: var(--muted); font-style: italic; padding: 6px 12px; }
.rd-qt-pos { color: var(--muted); font-variant-numeric: tabular-nums; }
.rd-qt-done { color: var(--ok-text); font-weight: 500; font-variant-numeric: tabular-nums; }
/* single-letter status badge (R/Q/D/E) on every queue row */
.rd-qt-cell { display: inline-flex; align-items: center; gap: 6px; }
.rd-qt-badge {
  flex-shrink: 0; width: 16px; height: 16px; line-height: 16px; text-align: center;
  border-radius: var(--r-sm); font: 700 10px/16px "IBM Plex Mono", monospace;
}
.rd-qt-badge--running { background: var(--accent-tint); color: var(--accent-hover); }
.rd-qt-badge--queued  { background: var(--amber-tint);  color: var(--amber-text); }
.rd-qt-badge--done    { background: var(--ok-tint);     color: var(--ok-text); }
.rd-qt-badge--failed  { background: var(--err-tint);    color: var(--err-text); }
.rd-qt-badge--expired { background: var(--surface-alt); color: var(--muted); }

/* Tabler-style analytics stat cards (admin ops) */
.ops-stat-card { display: flex; flex-direction: column; gap: 11px; padding: 15px 17px; }
.ops-stat-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ops-stat-card__lbl {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ops-stat-card__ico { font-size: 18px; line-height: 1; color: var(--muted); opacity: 0.75; flex-shrink: 0; }
.ops-stat-card__fig {
  font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.ops-stat-card--accent { background: var(--accent-tint); border-color: var(--accent-border); }
.ops-stat-card--accent .ops-stat-card__ico { color: var(--accent); opacity: 1; }
.ops-stat-card--accent .ops-stat-card__lbl { color: var(--accent-hover); }
.ops-stat-card--accent .ops-stat-card__fig { color: var(--accent); }

/* ---- ops page: full-width, table left, sticky stats rail right ---- */
/* break out of the 1180 container to use the whole viewport (admin-only page) */
.rd-main:has(.page-ops) .container-xl { max-width: none; padding-left: 28px; padding-right: 28px; }
.page-ops { max-width: none; margin-left: 0; }
.ops-layout {
  display: grid; gap: 22px; align-items: start;
  grid-template-columns: minmax(0, 1fr) clamp(300px, 26vw, 470px);
}
.ops-main { min-width: 0; }                 /* let the wide table scroll, not overflow the grid */
.ops-side {
  position: sticky; top: 16px; align-self: start;
  max-height: calc(100vh - 32px); overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 12px; padding-right: 3px;
}
.ops-side__hd { padding: 2px 0 2px 1px; }
.ops-quickrange { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ops-quickrange .rd-eyebrow { margin-right: 2px; }
/* cards flow to fill whatever width the rail has (2 cols narrow, 3+ wide) */
.ops-side__cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
.ops-side .ops-stat-card { padding: 12px 13px; gap: 8px; justify-content: space-between; }
.ops-side .ops-stat-card__fig { font-size: 23px; }
.ops-side .ops-stat-card__lbl { white-space: normal; }   /* let long labels wrap, don't clip */

/* stack to a single full-width column on narrow viewports */
@media (max-width: 1100px) {
  .ops-layout { grid-template-columns: 1fr; }
  .ops-side {
    position: static; max-height: none; overflow: visible;
    display: grid; gap: 12px; grid-template-columns: 1fr;
  }
  .ops-side__hd { display: none; }
  .ops-side__cards { grid-column: 1 / -1; }
  .ops-trends { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
}

/* active filter highlight (warm amber) + prominent clear-all */
.ops-active, input.ops-active, select.ops-active {
  border-color: var(--amber) !important;
  background: var(--amber-tint) !important; color: var(--amber-text) !important;
  box-shadow: 0 0 0 1px var(--amber);
}
.ops-clear { border: 1px solid var(--amber-border); background: var(--amber-tint); color: var(--amber-text); }
.ops-clear:hover { background: var(--amber); border-color: var(--amber); color: #fff; }

/* sortable headers: dim ↕ when idle, bold accent arrow when active */
.rd a.ops-sorth, .ops-sorth { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; white-space: nowrap; }
.rd a.ops-sorth:hover { text-decoration: none; color: var(--accent-hover); }
.ops-sorth__arw { font-size: 11px; opacity: .4; }
.ops-sorth.is-sorted { font-weight: 700; }
.ops-sorth.is-sorted .ops-sorth__arw { opacity: 1; }

/* mini analytics trend cards */
.ops-side__sub { margin: 4px 0 -2px; padding-left: 1px; }
.ops-trends { display: grid; gap: 12px; grid-template-columns: 1fr; }
.ops-trend { padding: 12px 14px; }
.ops-trend__hd { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.ops-trend__tot { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.ops-trend__svg { margin: 2px 0; }
.ops-trend__ft { display: flex; justify-content: space-between; gap: 6px; margin-top: 4px; font-size: 11px; }

.rd-pill {
  display: inline-flex; align-items: center;
  font-family: "IBM Plex Mono", monospace; font-size: 12px;
  padding: 5px 10px; border-radius: var(--r-pill);
  background: #F0F0F6; border: 1px solid var(--line); color: var(--body);
}
.rd-pill--amber { background: var(--amber-tint); border-color: var(--amber-border); color: var(--amber-text); }

/* live dot */
.rd-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.rd-dot--ok { background: var(--ok); }
.rd-dot--accent { background: var(--accent); }
.rd-dot--pending { background: #D0D0DE; }

/* ============================== Stats ==================================== */
.rd-stat { display: grid; gap: 6px; }
.rd-stat__fig { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.rd-stat__fig--sm { font-size: 24px; }
.rd-stat__lbl { font-size: 13px; color: var(--muted); }

/* ============================= Callout =================================== */
.rd-callout { border-radius: var(--r-xl); padding: 16px 18px; border: 1px solid; }
.rd-callout__title { font-size: 14px; font-weight: 600; margin: 0 0 4px; }
.rd-callout p { font-size: 14px; color: var(--body); margin: 0; }
.rd-callout--info { background: var(--accent-wash); border-color: var(--accent-border); }
.rd-callout--info .rd-callout__title { color: var(--accent-hover); }
.rd-callout--ok { background: var(--ok-tint); border-color: var(--ok-border); }
.rd-callout--ok .rd-callout__title { color: var(--ok-text); }
.rd-callout--err { background: var(--err-tint); border-color: var(--err-border); }
.rd-callout--err .rd-callout__title { color: var(--err-text); }
.rd-callout--warn { background: var(--amber-tint); border-color: var(--amber-border); }
.rd-callout--warn .rd-callout__title { color: var(--amber-text); }

/* ============================ Code / navy ================================ */
.rd-navy {
  background: var(--navy); border-radius: var(--r-xl); padding: 18px 20px; color: var(--navy-fg);
}
.rd-navy .rd-eyebrow { color: var(--navy-muted); }
.rd-code {
  font-family: "IBM Plex Mono", monospace; font-size: 13px; line-height: 1.75;
  color: var(--navy-fg); white-space: pre-wrap; word-break: break-word; margin: 0;
}
.rd-code--nowrap { white-space: nowrap; overflow-x: auto; }
code.rd-inline {
  font-family: "IBM Plex Mono", monospace; font-size: 13px;
  background: #F0F0F6; border-radius: 4px; padding: 1px 5px; color: var(--ink);
}

/* ====================== Selectable option cards ========================== */
.rd-optgrid { display: grid; gap: 12px; }
.rd-optgrid--2 { grid-template-columns: repeat(2, 1fr); }
.rd-opt { position: relative; display: block; }
.rd-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rd-opt__body {
  position: relative; display: grid; gap: 4px;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--r-lg); padding: 14px 44px 14px 16px; cursor: pointer;
  transition: border-color .15s ease-out, background .15s ease-out;
}
/* visible radio-dot indicator so every option reads as selectable, ticked or not */
.rd-opt__body::after {
  content: ""; position: absolute; top: 15px; right: 15px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--muted); background: var(--surface);
  transition: border-color .15s ease-out, box-shadow .15s ease-out;
}
.rd-opt__body:hover { border-color: var(--accent-soft); }
.rd-opt__body:hover::after { border-color: var(--accent); }
.rd-opt input:checked + .rd-opt__body { border-color: var(--accent); background: var(--accent-wash); }
.rd-opt input:checked + .rd-opt__body::after {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 9px var(--accent);
}
.rd-opt input:focus-visible + .rd-opt__body { outline: 2px solid var(--accent); outline-offset: 2px; }
.rd-opt__t { font-size: 14px; font-weight: 600; color: var(--ink); }
.rd-opt__s { font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--muted); }

/* ============================== Dropzone ================================= */
.rd-dropzone {
  border: 1px dashed var(--line-strong); border-radius: var(--r-xl);
  background: var(--surface-alt); padding: 26px; text-align: center; color: var(--muted);
}
.rd-dropzone input[type=file] { display: block; margin: 10px auto 0; max-width: 340px; }
.rd-fileinfo {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface-alt); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: 14px 16px;
}
.rd-fileinfo__name { font-family: "IBM Plex Mono", monospace; font-size: 13px; color: var(--ink); }
.rd-fileinfo__meta { font-size: 13px; color: var(--muted); }

/* form controls */
.rd-field { display: grid; gap: 7px; }
.rd-label { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.rd-help { font-size: 13px; color: var(--muted); line-height: 1.5; }
.rd-input, .rd-select {
  font-family: inherit; font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); padding: 10px 12px; width: 100%;
}
.rd-input--mono { font-family: "IBM Plex Mono", monospace; font-size: 14px; }
.rd-input:focus, .rd-select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.rd-default { font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--muted); margin-top: 4px; }
.rd-check { display: flex; gap: 10px; align-items: flex-start; }
.rd-check input { margin-top: 2px; }

/* custom checkbox: a native accent-color box renders a near-invisible unticked
   border, so draw our own — clearly bordered unticked, accent-filled ticked. */
.rd-check input[type="checkbox"],
.page-submit .form-check-input {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; flex-shrink: 0; position: relative; cursor: pointer;
  border: 2px solid var(--muted); border-radius: 5px; background: var(--surface);
  transition: border-color .15s ease-out, background .15s ease-out;
}
.rd-check input[type="checkbox"]:hover,
.page-submit .form-check-input:hover { border-color: var(--accent); }
.rd-check input[type="checkbox"]:checked,
.page-submit .form-check-input:checked { background: var(--accent); border-color: var(--accent); }
.rd-check input[type="checkbox"]:checked::after,
.page-submit .form-check-input:checked::after {
  content: ""; position: absolute; left: 5px; top: 1.5px;
  width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.rd-check input[type="checkbox"]:focus-visible,
.page-submit .form-check-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============================== Table ==================================== */
.rd-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.rd-table thead th {
  font-family: "IBM Plex Mono", monospace; font-size: 11px; font-weight: 500;
  letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
  background: var(--surface-alt); text-align: left; padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.rd-table tbody td { font-size: 14px; color: var(--body); padding: 13px 14px; border-bottom: 1px solid var(--line-soft); }
.rd-table tbody tr:last-child td { border-bottom: 0; }
.rd-table .num { text-align: right; }
.rd-table .mono { font-size: 13px; }

/* progress + stage list (job status) */
.rd-progress { height: 9px; border-radius: var(--r-pill); background: #E9E9F1; overflow: hidden; }
.rd-progress__fill { height: 100%; background: var(--accent); border-radius: var(--r-pill); transition: width .3s ease-out; }
.rd-stages { display: grid; gap: 13px; margin: 0; padding: 0; list-style: none; }
.rd-stages li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.rd-stages .rd-dot { flex-shrink: 0; }
.rd-stages .is-done { color: var(--body); }
.rd-stages .is-current { color: var(--ink); font-weight: 500; }
.rd-stages .is-pending { color: var(--disabled-fg); }

/* ===== Submit page: restyle the reused Django/Tabler form widgets ===== */
.page-submit { padding-bottom: 200px; }
.page-submit .form-label {
  font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 6px;
  display: block;
}
.page-submit .form-label.required::after { content: " *"; color: var(--accent); }
.page-submit .form-control, .page-submit .form-select {
  font-family: inherit; font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); padding: 10px 12px; width: 100%; box-shadow: none;
}
.page-submit input[type=email].form-control { font-family: "IBM Plex Mono", monospace; font-size: 14px; }
.page-submit .form-control:focus, .page-submit .form-select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); box-shadow: none;
}
.page-submit .form-check { display: flex; gap: 10px; align-items: flex-start; padding: 0; margin: 0; }
.page-submit .form-check-input { margin: 2px 0 0; float: none; }
.page-submit .form-check-label { font-size: 14px; color: var(--body); }
.page-submit .form-help {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%; background: var(--surface-alt);
  border: 1px solid var(--line-strong); color: var(--muted);
  font-size: 11px; cursor: help; vertical-align: middle;
}
.rd-group { margin-bottom: 28px; }
.rd-group__label { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }

/* advanced disclosure */
.rd-disclosure { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3xl); overflow: hidden; }
.rd-disclosure__btn {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  gap: 16px; padding: 20px 28px; background: transparent; border: 0; cursor: pointer; text-align: left;
}
.rd-disclosure__btn:hover { background: var(--surface-alt); }
.rd-disclosure__t { font-size: 15px; font-weight: 600; color: var(--ink); }
.rd-disclosure__sum { font-size: 13px; color: var(--muted); margin-top: 2px; }
.rd-disclosure__toggle { font-size: 14px; font-weight: 500; color: var(--accent); white-space: nowrap; }
.rd-disclosure__body { padding: 0 28px 24px; border-top: 1px solid var(--line-soft); }
.rd-disclosure[data-open="false"] .rd-disclosure__body { display: none; }

/* ============================ Command bar ================================ */
.rd-cmdbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  background: var(--navy); border-top: 1px solid var(--navy-line);
}
.rd-cmdbar__inner {
  max-width: 1180px; margin-inline: auto; padding: 16px 32px;
  display: flex; align-items: center; gap: 20px; justify-content: space-between;
}
.rd-cmdbar__cmd { min-width: 0; flex: 1; }
.rd-cmdbar__actions { display: flex; gap: 10px; flex-shrink: 0; }

/* divider */
.rd-hr { border: 0; border-top: 1px solid var(--line-soft); margin: 20px 0; }

/* ===================== Admin operations panel =========================== */
.ops-spark { display: flex; align-items: flex-end; gap: 2px; height: 84px; }
.ops-spark .b { flex: 1 1 0; min-width: 0; background: var(--accent); opacity: .5;
  border-radius: 2px 2px 0 0; min-height: 2px; transition: opacity .1s; }
.ops-spark .b:hover { opacity: 1; }
.rd-jobinfo__v { font-size: 15px; font-weight: 600; color: var(--ink); margin-top: 3px; font-variant-numeric: tabular-nums; }


.ops-donut { width: 124px; height: 124px; border-radius: 50%; position: relative; flex-shrink: 0; }
.ops-donut::after { content: ""; position: absolute; inset: 38px; background: var(--surface); border-radius: 50%; }
.ops-donut__c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ops-legend { display: grid; gap: 9px; min-width: 0; }
.ops-legend-row { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--body); }
.ops-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.ops-hbar-row { display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: 12px; margin-bottom: 10px; }
.ops-hbar-row .lbl { font-size: 13px; color: var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ops-hbar-row .val { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ops-hbar { height: 9px; border-radius: var(--r-pill); background: var(--accent-tint); overflow: hidden; }
.ops-hbar > i { display: block; height: 100%; background: var(--accent); border-radius: var(--r-pill); }

.ops-tool { font-family: inherit; font-size: 13px; padding: 8px 11px; border: 1px solid var(--line-strong);
  border-radius: var(--r-md); background: var(--surface); color: var(--ink); }
.ops-tool:focus { outline: 1px solid var(--accent); border-color: var(--accent); }

/* compact, dense admin table */
.ops-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-2xl); }
.ops-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ops-table thead th { background: var(--surface-alt); font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
  text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ops-table thead th a { color: var(--muted); text-decoration: none; }
.ops-table thead th a:hover { color: var(--accent); }
.ops-table thead th .arw { color: var(--accent); }
.ops-table tbody td { font-size: 12.5px; color: var(--body); padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.ops-table tbody tr:hover td { background: var(--accent-wash); }
.ops-table .num { text-align: right; }
.ops-table .mono { font-family: "IBM Plex Mono", monospace; font-size: 12px; }
.ops-filter th { padding: 6px 8px; background: var(--surface); border-bottom: 1px solid var(--line); }
.ops-filter input, .ops-filter select { width: 100%; font-family: inherit; font-size: 12px;
  padding: 5px 7px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); }
.ops-filter input:focus, .ops-filter select:focus { outline: 1px solid var(--accent); border-color: var(--accent); }

/* ============================ Responsive ================================= */
@media (max-width: 1100px) {
  [data-hide-narrow] { display: none !important; }
}
@media (min-width: 992px) {
  .nav-toggle { display: none; }
  .site-nav { display: flex !important; }
}
@media (max-width: 991.98px) {
  .nav-toggle { display: inline-flex; }
  .nav-sep { display: none; }
  .site-header__inner { flex-wrap: wrap; padding: 0 20px; }
  .site-nav {
    flex-basis: 100%; flex-direction: column; align-items: flex-start;
    gap: 2px; padding: 8px 0 12px;
  }
  .site-nav a { width: 100%; padding: 9px 8px; }
}
@media (max-width: 820px) {
  .rd-grid--3, .rd-grid--4, .rd-optgrid--2, .rd-grid--2 { grid-template-columns: 1fr; }
  .home-hero, .how-pipeline, .how-local { grid-template-columns: 1fr !important; }
}
@media (max-width: 520px) {
  .home-hero h1 { font-size: 36px !important; }
}
@media (max-width: 780px) {
  .site-header__inner, .site-footer__inner, .rd-cmdbar__inner { padding-left: 20px; padding-right: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
