/* ---------------------------------------------------------------------- */
/* Phage Annotation Server -- hand-written CSS, no build step, no CDN.     */
/* Self-hosted only (PLAN.md 6.4.3), so this file is the entire visual     */
/* design system: tokens, layout primitives, and every component below.   */
/*                                                                          */
/* Brand palette, sampled from the pharokka / phold logos:                 */
/*   teal  #008AA6   black #000000   cream #F8F0E3                         */
/*   white #FFFFFF   grey  #767676 / #B1B1B1                               */
/* --color-brand-teal is the literal logo hex -- used decoratively (icons, */
/* borders, dots, badges with dark text on it). --color-primary is a       */
/* slightly darkened teal used anywhere text sits directly on/as it, so    */
/* body-text-sized links and button labels clear WCAG AA (4.5:1) rather    */
/* than the logo teal's ~4:1 against white/cream. See PLAN.md 6.4.3.       */
/* ---------------------------------------------------------------------- */

:root {
  /* -- color tokens (light) --------------------------------------------- */
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-surface-muted: #f8f0e3;
  --color-border: #ddd2ba;
  --color-text: #16130e;
  --color-text-muted: #6a6a6a;
  --color-brand-teal: #008aa6;
  --color-primary: #00738a;
  --color-primary-hover: #005f73;
  --color-primary-contrast: #ffffff;
  --color-accent-soft: #dcf0f3;
  --color-danger: #b3261e;
  --color-danger-soft: #fbe9e7;
  --color-success: #00738a;
  --color-success-soft: #dcf0f3;
  --color-focus-ring: #008aa6;
  --color-link: #00738a;

  /* -- scale -------------------------------------------------------------- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-card: 0 1px 2px rgba(20, 16, 10, 0.05), 0 8px 24px rgba(20, 16, 10, 0.08);
  --max-width: 72rem;
  --max-width-prose: 42rem;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #000000;
    --color-surface: #121212;
    --color-surface-muted: #1c1c1c;
    --color-border: #333333;
    --color-text: #f8f0e3;
    --color-text-muted: #b1b1b1;
    --color-brand-teal: #00a6c6;
    --color-primary: #00a6c6;
    --color-primary-hover: #33bcd8;
    --color-primary-contrast: #000000;
    --color-accent-soft: rgba(0, 166, 198, 0.16);
    --color-danger: #ff6b62;
    --color-danger-soft: #3a1e1c;
    --color-success: #00a6c6;
    --color-success-soft: rgba(0, 166, 198, 0.16);
    --color-focus-ring: #00a6c6;
    --color-link: #35c2e0;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.55);
  }
}

/* Manual theme override hooks -- web/static/js/theme-toggle.js sets
 * data-theme on <html> for an explicit user choice, and
 * web/static/js/theme-init.js re-applies a *stored* choice before first
 * paint (avoiding a flash of the wrong theme). These need the FULL variable
 * set, not just `color-scheme`: an attribute selector has higher
 * specificity than a bare `:root` (including the one inside the
 * `prefers-color-scheme` media query above), so explicitly repeating each
 * theme's values here is what lets an explicit choice correctly override
 * the OS setting in either direction -- e.g. "light" chosen while the OS
 * prefers dark, or vice versa. Keep in sync with the two blocks above by
 * construction: same hex values, just reachable a different way. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #000000;
  --color-surface: #121212;
  --color-surface-muted: #1c1c1c;
  --color-border: #333333;
  --color-text: #f8f0e3;
  --color-text-muted: #b1b1b1;
  --color-brand-teal: #00a6c6;
  --color-primary: #00a6c6;
  --color-primary-hover: #33bcd8;
  --color-primary-contrast: #000000;
  --color-accent-soft: rgba(0, 166, 198, 0.16);
  --color-danger: #ff6b62;
  --color-danger-soft: #3a1e1c;
  --color-success: #00a6c6;
  --color-success-soft: rgba(0, 166, 198, 0.16);
  --color-focus-ring: #00a6c6;
  --color-link: #35c2e0;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.55);
}
:root[data-theme="light"] {
  color-scheme: light;
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-surface-muted: #f8f0e3;
  --color-border: #ddd2ba;
  --color-text: #16130e;
  --color-text-muted: #6a6a6a;
  --color-brand-teal: #008aa6;
  --color-primary: #00738a;
  --color-primary-hover: #005f73;
  --color-primary-contrast: #ffffff;
  --color-accent-soft: #dcf0f3;
  --color-danger: #b3261e;
  --color-danger-soft: #fbe9e7;
  --color-success: #00738a;
  --color-success-soft: #dcf0f3;
  --color-focus-ring: #008aa6;
  --color-link: #00738a;
  --shadow-card: 0 1px 2px rgba(20, 16, 10, 0.05), 0 8px 24px rgba(20, 16, 10, 0.08);
}

/* ---------------------------------------------------------------------- */
/* Reset                                                                   */
/* ---------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-bg);
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  margin: 0 0 var(--space-4);
}

h1 {
  font-size: 2rem;
}
h2 {
  font-size: 1.3rem;
  margin-top: var(--space-6);
}
h3 {
  font-size: 1.1rem;
}

p {
  margin: 0 0 var(--space-4);
}

a {
  color: var(--color-link);
}

img,
svg {
  max-width: 100%;
  display: block;
}

ul,
ol {
  padding-left: 1.25rem;
}

code {
  font-family: var(--font-mono);
  background: var(--color-surface-muted);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  font-size: 0.9em;
}

button {
  font: inherit;
}

/* Component classes below (e.g. .button) set their own `display`, which is
 * equal-specificity with the UA stylesheet's `[hidden] { display: none }`
 * and would otherwise win the cascade by source order -- silently breaking
 * the plain HTML `hidden` attribute used throughout for JS-free, no-flash
 * server-rendered show/hide (tabs, status-page action buttons). Force it
 * to always win instead of chasing `.foo[hidden]` overrides per component. */
[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

.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-link {
  position: absolute;
  left: var(--space-4);
  top: -3rem;
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 100;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: var(--space-4);
}

/* ---------------------------------------------------------------------- */
/* Layout primitives                                                       */
/* ---------------------------------------------------------------------- */

.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

/* ---------------------------------------------------------------------- */
/* Header / nav                                                            */
/* ---------------------------------------------------------------------- */

.site-header {
  border-bottom: 3px solid var(--color-brand-teal);
  background: var(--color-surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-block: var(--space-4);
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-weight: 800;
  /* Was 1.15rem -- read as small next to the rest of the page (hero h1 is
   * 2.4rem). Bumped for prominence; the icon before it is sized in `em` so
   * it scales along with the text automatically. Kept a notch smaller on
   * narrow screens (below) purely so five nav links + the theme toggle
   * keep their existing single-row layout at common tablet widths --
   * mobile already wraps the nav to its own row by design (flex-wrap on
   * .site-header__bar), so this isn't about fitting everything on one line
   * there, just not overflowing/wrapping the brand text itself. */
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
}

@media (max-width: 30rem) {
  .site-header__brand {
    font-size: 1.25rem;
  }
}

.site-header__brand::before {
  content: "";
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  border-radius: 3px;
  background: var(--color-brand-teal);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.site-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  padding-block: var(--space-1);
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--color-text);
}

.site-nav a[aria-current="page"] {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* ---------------------------------------------------------------------- */
/* Theme toggle (site header)                                              */
/* ---------------------------------------------------------------------- */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  flex: none;
}

.theme-toggle:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Icon shown depends on the *effective* theme, resolved with no JS
 * dependency wherever possible so there's no icon flash to match the (JS-
 * free) page-background behaviour: `prefers-color-scheme` picks the OS-
 * default icon, and an explicit `data-theme` on <html> (stamped before
 * paint by theme-init.js when a choice was previously stored) always wins
 * over it. `theme-toggle.js` additionally stamps `data-theme` on the button
 * itself so this stays correct immediately after a click, before any
 * `<html>`-level attribute would otherwise be re-read. */
.theme-toggle__icon--moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .theme-toggle__icon--sun {
    display: none;
  }
  .theme-toggle__icon--moon {
    display: block;
  }
}

:root[data-theme="dark"] .theme-toggle__icon--sun,
.theme-toggle[data-theme="dark"] .theme-toggle__icon--sun {
  display: none;
}
:root[data-theme="dark"] .theme-toggle__icon--moon,
.theme-toggle[data-theme="dark"] .theme-toggle__icon--moon {
  display: block;
}
:root[data-theme="light"] .theme-toggle__icon--sun,
.theme-toggle[data-theme="light"] .theme-toggle__icon--sun {
  display: block;
}
:root[data-theme="light"] .theme-toggle__icon--moon,
.theme-toggle[data-theme="light"] .theme-toggle__icon--moon {
  display: none;
}

/* ---------------------------------------------------------------------- */
/* Footer                                                                   */
/* ---------------------------------------------------------------------- */

.site-footer {
  border-top: 3px solid var(--color-brand-teal);
  margin-top: var(--space-8);
  padding-block: var(--space-6);
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.site-footer__meta {
  margin-bottom: 0;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin: 0 0 var(--space-3);
  padding: 0;
  list-style: none;
}

.site-footer__links a {
  color: var(--color-text-muted);
  font-weight: 600;
  text-decoration: none;
}

.site-footer__links a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Lightly obfuscated mailto -- see web/static/js/obfuscated-mail.js. The
 * <span> holds a human-readable placeholder for no-JS / scraper contexts;
 * JS swaps it for a real mailto: link once the DOM is ready. */
.obfuscated-email {
  color: var(--color-text-muted);
  font-weight: 600;
}
a.obfuscated-email {
  text-decoration: underline;
}
a.obfuscated-email:hover {
  color: var(--color-primary);
}

/* ---------------------------------------------------------------------- */
/* Hero + submit form (the primary action -- PLAN.md 6.4.3)                */
/* ---------------------------------------------------------------------- */

.hero {
  display: grid;
  gap: var(--space-6);
  padding-block: var(--space-7) var(--space-5);
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1fr 1fr;
    align-items: start;
    padding-block: var(--space-8) var(--space-6);
  }
}

.hero__intro h1 {
  font-size: 2.4rem;
}

.hero__lede {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  max-width: 38rem;
}

/* Fills the space below the intro text in the hero's left column with the
 * pipeline logo strip (moved here from further down the page -- see
 * `.brand-logos` below, which this reuses rather than duplicating). */
.hero__pipeline {
  margin-top: var(--space-6);
}

.hero__pipeline-note {
  margin: 0 0 var(--space-3);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.upload-form {
  margin-bottom: 0;
}

.field {
  margin-bottom: var(--space-5);
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.field__optional {
  font-weight: 400;
  color: var(--color-text-muted);
}

.field__hint {
  margin: var(--space-2) 0 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="number"],
.field input[type="file"],
.field select {
  width: 100%;
  padding: var(--space-3);
  font-size: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
}

.field input[type="file"] {
  padding: var(--space-2);
}

.field--checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.field--checkbox input {
  margin-top: 0.3em;
  width: 1.1em;
  height: 1.1em;
}

.field--checkbox label {
  margin-bottom: 0;
  font-weight: 500;
}

.field label code,
.field--checkbox label code {
  font-size: 0.8em;
  font-weight: 400;
  color: var(--color-text-muted);
}

/* ---------------------------------------------------------------------- */
/* Advanced options (submit form)                                          */
/* ---------------------------------------------------------------------- */

.advanced-options {
  margin: var(--space-2) 0 var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface-muted);
}

.advanced-options summary {
  cursor: pointer;
  font-weight: 700;
  padding-block: var(--space-1);
}

.advanced-options[open] summary {
  margin-bottom: var(--space-3);
}

.advanced-options__intro {
  margin-top: 0;
}

.advanced-group {
  padding-top: var(--space-4);
  margin-top: var(--space-4);
  border-top: 1px dashed var(--color-border);
}

.advanced-group:first-of-type {
  padding-top: 0;
  margin-top: 0;
  border-top: none;
}

.advanced-group__title {
  margin: 0 0 var(--space-3);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
}

/* ---------------------------------------------------------------------- */
/* Buttons                                                                  */
/* ---------------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.7rem 1.3rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.button--primary {
  background: var(--color-primary);
  color: var(--color-primary-contrast);
}
.button--primary:hover {
  background: var(--color-primary-hover);
}

.button--secondary {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}
.button--secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.button--block {
  width: 100%;
}

.button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---------------------------------------------------------------------- */
/* Alerts                                                                   */
/* ---------------------------------------------------------------------- */

.alert {
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  border: 1px solid transparent;
}

.alert--error {
  background: var(--color-danger-soft);
  border-color: var(--color-danger);
  color: var(--color-danger);
}

/* Caution callout -- used on /licenses and /terms to flag the commercially
 * restricted databases (CARD, VFDB). Uses the brand teal rather than a new
 * warning hue: it must read as "important, read this", not as an error, and
 * introducing a fourth accent colour would dilute the palette. Border-led so
 * it stays legible in both themes without a bespoke background per theme. */
.alert--warn {
  background: var(--color-accent-soft);
  border-color: var(--color-primary);
  color: var(--color-text);
  border-left-width: 4px;
}

.alert--warn p:last-child {
  margin-bottom: 0;
}

/* Intro paragraph on prose pages (terms, licences). Slightly larger and
 * muted -- a summary the reader can stop at if the detail below isn't
 * relevant to them. */
.lede {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}

/* ---------------------------------------------------------------------- */
/* Pipeline explainer (index page)                                         */
/* ---------------------------------------------------------------------- */

.pipeline-explainer {
  padding-block: var(--space-6);
  border-top: 1px solid var(--color-border);
}

.steps {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-5);
  counter-reset: step;
}

@media (min-width: 700px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.steps > li {
  counter-increment: step;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  position: relative;
  padding-top: var(--space-6);
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  top: -0.6rem;
  left: var(--space-5);
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.steps p {
  margin: var(--space-2) 0 0;
  color: var(--color-text-muted);
}

.pipeline-explainer__note {
  color: var(--color-text-muted);
}

/* ---------------------------------------------------------------------- */
/* Brand logos -- pharokka -> phold -> phynteny (index + about pages)      */
/* ---------------------------------------------------------------------- */

.brand-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding-block: var(--space-5);
}

.brand-logo-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text);
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}

.brand-logo-tile:hover,
.brand-logo-tile:focus-visible {
  border-color: var(--color-brand-teal);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.brand-logo-tile__mark {
  /* Cream chip behind every logo -- makes pharokka/phold's transparent
   * artwork read as an intentional tile, and stops phynteny's own white
   * background from floating awkwardly on a dark-mode card. */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5.5rem;
  height: 5.5rem;
  background: #f8f0e3;
  border-radius: var(--radius-md);
  padding: var(--space-2);
}

.brand-logo-tile__mark img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}

.brand-logo-tile__name {
  font-weight: 700;
}

.brand-logos__arrow {
  color: var(--color-brand-teal);
  font-size: 1.5rem;
  font-weight: 700;
  align-self: center;
}

@media (max-width: 640px) {
  .brand-logos__arrow {
    transform: rotate(90deg);
  }
}

/* Smaller footprint for the hero's narrower column (`.hero__pipeline`
 * above) -- same component, just sized to fit next to the submit form
 * instead of spanning the full page width. Left-aligned to match the rest
 * of the hero copy; still wraps and rotates its arrows on narrow viewports
 * via the shared rules above. */
/* Hero pipeline: a VERTICAL chain, one full-width row per tool.
 *
 * The hero's left column is tall -- it sits beside the entire upload form --
 * so a horizontal strip of small tiles left a large empty area beneath it.
 * Stacking the three tools with big marks fills that column and reads more
 * clearly as an ordered pipeline. */
.brand-logos--compact {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
  padding-block: 0;
}

.brand-logos--compact .brand-logo-tile {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-3) var(--space-4);
}

/* The three logos have very different aspect ratios: pharokka is a square
 * roundel (~1:1) while phold (512x135, ~3.8:1) and phynteny are wide
 * wordmarks. A fixed square chip shrank the wordmarks to roughly a sixth of
 * the available height, which read as "faint" rather than "small". So the
 * chip is a fixed HEIGHT with flexible width, and each image is contained
 * within it -- every logo then renders as large as its own shape allows. */
.brand-logos--compact .brand-logo-tile__mark {
  width: auto;
  min-width: 6rem;
  max-width: 14rem;
  height: 6rem;
  flex: none;
  padding: var(--space-2) var(--space-3);
}

.brand-logos--compact .brand-logo-tile__mark img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.brand-logos--compact .brand-logo-tile__name {
  /* Was 1.2rem. See the @media block below for the (also-bumped) narrow-
   * viewport value. */
  font-size: 1.35rem;
  font-weight: 700;
}

/* The markup uses right-arrow glyphs; rotating them keeps one template that
 * works in both orientations rather than duplicating the entity. */
.brand-logos--compact .brand-logos__arrow {
  align-self: center;
  transform: rotate(90deg);
  font-size: 1.35rem;
  line-height: 1;
  color: var(--color-text-muted);
}

@media (max-width: 32rem) {
  .brand-logos--compact .brand-logo-tile__mark {
    width: 4.5rem;
    height: 4.5rem;
  }
  .brand-logos--compact .brand-logo-tile__name {
    font-size: 1.1rem; /* was 1rem */
  }
}

/* ---------------------------------------------------------------------- */
/* Stage tracker (status page headline feature)                            */
/* ---------------------------------------------------------------------- */

.stage-tracker {
  list-style: none;
  display: flex;
  padding: 0;
  margin: var(--space-6) 0;
  gap: 0;
}

.stage-tracker__step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  padding-top: var(--space-2);
}

.stage-tracker__step:not(:first-child)::before {
  content: "";
  position: absolute;
  top: 0.95rem;
  left: -50%;
  width: 100%;
  height: 3px;
  background: var(--color-border);
  z-index: 0;
}

.stage-tracker__step[data-state="done"]:not(:first-child)::before,
.stage-tracker__step[data-state="active"]:not(:first-child)::before {
  background: var(--color-primary);
}

.stage-tracker__dot {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--color-surface);
  border: 3px solid var(--color-border);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage-tracker__step[data-state="pending"] .stage-tracker__dot {
  border-color: var(--color-border);
}

.stage-tracker__step[data-state="active"] .stage-tracker__dot {
  border-color: var(--color-primary);
  background: var(--color-accent-soft);
  animation: pulse 1.6s ease-in-out infinite;
}

.stage-tracker__step[data-state="done"] .stage-tracker__dot {
  border-color: var(--color-success);
  background: var(--color-success);
}
.stage-tracker__step[data-state="done"] .stage-tracker__dot::after {
  content: "\2713";
  color: var(--color-primary-contrast);
  font-size: 0.95rem;
  font-weight: 700;
}

.stage-tracker__step[data-state="error"] .stage-tracker__dot {
  border-color: var(--color-danger);
  background: var(--color-danger-soft);
}
.stage-tracker__step[data-state="error"] .stage-tracker__dot::after {
  content: "!";
  color: var(--color-danger);
  font-weight: 700;
}

.stage-tracker__label {
  margin-top: var(--space-2);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.stage-tracker__step[data-state="active"] .stage-tracker__label,
.stage-tracker__step[data-state="done"] .stage-tracker__label {
  color: var(--color-text);
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(31, 111, 92, 0.35);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(31, 111, 92, 0);
  }
}

.status-region {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-surface-muted);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-5);
}

.status-region p {
  margin: 0;
}

.status-region__state {
  font-weight: 600;
}

.status-card__share {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ---------------------------------------------------------------------- */
/* Submission summary / definition lists                                   */
/* ---------------------------------------------------------------------- */

.submission-summary {
  margin-top: var(--space-6);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-4);
}

.submission-summary summary {
  cursor: pointer;
  font-weight: 600;
}

dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-2) var(--space-4);
  margin: var(--space-4) 0;
}

dl dt {
  color: var(--color-text-muted);
}

dl dd {
  margin: 0;
}

.results-summary {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-2) var(--space-5);
  margin: var(--space-4) 0 var(--space-6);
  font-size: 0.95rem;
}

/* Non-default advanced options used for a job (job.html / results.html) --
 * a reproducibility summary, so a completed run's exact command-line
 * deltas are visible without downloading the log. */
.advanced-options-summary {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.9em;
}

.advanced-options-summary li {
  margin-bottom: 0.2em;
}

.advanced-options-summary code {
  font-size: 0.9em;
}

/* ---------------------------------------------------------------------- */
/* Tables (id-map, per-CDS data tables)                                    */
/* ---------------------------------------------------------------------- */

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
}

th,
td {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

thead th {
  position: sticky;
  top: 0;
  background: var(--color-surface-muted);
  font-weight: 700;
}

tbody tr:hover {
  background: var(--color-surface-muted);
}

.id-map-table td:first-child {
  font-family: var(--font-mono);
}

.data-table .th-sort {
  background: none;
  border: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  color: inherit;
}

.data-table .th-sort::after {
  content: "\2195";
  opacity: 0.35;
  font-size: 0.8em;
}

.data-table .th-sort[data-sort-dir="asc"]::after {
  content: "\2191";
  opacity: 1;
}

.data-table .th-sort[data-sort-dir="desc"]::after {
  content: "\2193";
  opacity: 1;
}

.data-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.table-filter {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  min-width: 16rem;
  max-width: 100%;
  background: var(--color-surface);
  color: var(--color-text);
}

.data-table-toolbar__meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.data-table tbody tr[hidden] {
  display: none;
}

/* ---------------------------------------------------------------------- */
/* Tabs (results page)                                                     */
/* ---------------------------------------------------------------------- */

.tabs__list {
  display: flex;
  gap: var(--space-2);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}

.tabs__tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: var(--space-3) var(--space-2);
  margin-bottom: -1px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
}

.tabs__tab:hover {
  color: var(--color-text);
}

.tabs__tab.is-active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tabs__badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--color-accent-soft);
  color: var(--color-primary);
  padding: 0.15em 0.5em;
  border-radius: 999px;
  vertical-align: middle;
}

.tabs__panel[hidden] {
  display: none;
}

.results-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.results-header__actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.file-list {
  list-style: none;
  padding: 0;
  margin: var(--space-3) 0 var(--space-5);
}

.file-list li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px dashed var(--color-border);
}

.file-list__size {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.empty-note {
  color: var(--color-text-muted);
  font-style: italic;
}

.genome-browser-placeholder {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  text-align: center;
  color: var(--color-text-muted);
  margin-block: var(--space-6);
}

/* ---------------------------------------------------------------------- */
/* Prose pages (about / help) + error page                                 */
/* ---------------------------------------------------------------------- */

.prose {
  max-width: var(--max-width-prose);
}

/* Citations page needs room for side-by-side heading + logo + copy button;
 * the default prose measure is too narrow for the BibTeX blocks. */
.prose--wide {
  max-width: var(--max-width);
}

.prose h2 {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-5);
}

.prose h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.prose dt {
  font-weight: 600;
  color: var(--color-text);
  margin-top: var(--space-3);
}

.prose dd {
  margin: var(--space-1) 0 0;
  color: var(--color-text-muted);
}

.error-card {
  max-width: 34rem;
  margin-inline: auto;
  text-align: center;
  margin-top: var(--space-7);
}

/* ---------------------------------------------------------------------- */
/* Citations page (/cite)                                                  */
/* ---------------------------------------------------------------------- */

.citation-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}

.citation-card__heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.citation-card__heading h3 {
  margin: 0;
}

.citation-card__logo {
  width: 2.25rem;
  height: 2.25rem;
  object-fit: contain;
  background: #f8f0e3;
  border-radius: var(--radius-sm);
  padding: 0.2rem;
}

.citation-card__text {
  margin: 0 0 var(--space-3);
}

.citation-card__bibtex {
  position: relative;
}

.citation-card__bibtex pre {
  margin: 0;
  padding: var(--space-3);
  padding-right: 6.5rem;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
}

.citation-card__copy {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

.citation-protocol {
  background: var(--color-accent-soft);
  border: 1px solid var(--color-brand-teal);
}

/* ---------------------------------------------------------------------- */
/* My jobs (/my-jobs) -- client-side job history, localStorage only        */
/* ---------------------------------------------------------------------- */

.my-jobs-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.my-jobs-list {
  list-style: none;
  padding: 0;
  margin: var(--space-5) 0 0;
  display: grid;
  gap: var(--space-3);
}

.my-job-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.my-job-row__main {
  min-width: 0;
}

.my-job-row__filename {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.my-job-row__meta {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.my-job-row__meta code {
  font-size: 0.85em;
}

.my-job-row__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.job-state-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.25em 0.7em;
  border-radius: 999px;
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.job-state-badge[data-state="completed"] {
  background: var(--color-success-soft);
  color: var(--color-success);
  border-color: var(--color-success);
}

.job-state-badge[data-state="running"],
.job-state-badge[data-state="queued"] {
  background: var(--color-accent-soft);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.job-state-badge[data-state="failed"] {
  background: var(--color-danger-soft);
  color: var(--color-danger);
  border-color: var(--color-danger);
}

.job-state-badge[data-state="expired"] {
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
}

.my-jobs-empty {
  color: var(--color-text-muted);
  font-style: italic;
  padding-block: var(--space-4);
}

.button--small {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.button--danger-text {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-danger);
}
.button--danger-text:hover {
  border-color: var(--color-danger);
  background: var(--color-danger-soft);
}


/* ---------------------------------------------------------------------- */
/* Funder acknowledgement (front page)                                     */
/* ---------------------------------------------------------------------- */

/* Deliberately understated: this is a credit, not a call to action, so it
 * sits below the pipeline explainer in muted type rather than competing
 * with the submit form. Bordered-top rather than boxed so it reads as a
 * closing note on the page. */
.acknowledgement {
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
  max-width: var(--max-width-prose);
}

.acknowledgement__heading {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-2);
}

.acknowledgement__body {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin: 0;
}


/* Failed-job explanation. The plain-English hint leads; the raw tool error is
 * kept but demoted to supporting detail -- never hidden, since a real bug has
 * to stay reportable. */
.job-error__hint {
  font-weight: 600;
}

.job-error__detail {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.job-error__detail code {
  word-break: break-word;
}
