/* ============================================================================
   FinalEye — Component Library
   ----------------------------------------------------------------------------
   Token-driven, framework-free component classes. Requires finaleye-tokens.css.
   Everything here is plain semantic HTML + classes — ports directly into
   Fastify string templates. Progressive-enhancement JS only (tabs, lightbox,
   expandable rows degrade to visible content if JS is off).
   ============================================================================ */

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

.fe-app {
  margin: 0;
  font-family: var(--fe-font-sans);
  font-size: var(--fe-text-base);
  line-height: var(--fe-leading-normal);
  color: var(--fe-text);
  background: var(--fe-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.fe-app :where(h1,h2,h3,h4,p,figure) { margin: 0; }
.fe-app a { color: var(--fe-link); text-decoration: none; }
.fe-app a:hover { text-decoration: underline; }
.fe-mono { font-family: var(--fe-font-mono); font-feature-settings: "tnum" 1; }

/* Visible, consistent focus for keyboard users everywhere */
.fe-app :where(a, button, input, select, textarea, [tabindex], summary):focus-visible {
  outline: none;
  box-shadow: var(--fe-focus-ring);
  border-radius: var(--fe-radius-sm);
}
.fe-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Layout helpers ------------------------------------------------------ */
.fe-container { max-width: var(--fe-container); margin: 0 auto; padding: 0 var(--fe-space-6); }
.fe-container--narrow { max-width: var(--fe-container-narrow); }
.fe-main { padding-block: var(--fe-space-8); }
.fe-stack { display: flex; flex-direction: column; }
.fe-row { display: flex; align-items: center; }
.fe-row--gap { gap: var(--fe-space-3); }
.fe-spread { display: flex; align-items: center; justify-content: space-between; gap: var(--fe-space-3); }
.fe-wrap { flex-wrap: wrap; }

/* ---- Top navigation ------------------------------------------------------ */
.fe-nav {
  height: var(--fe-nav-height);
  background: var(--fe-nav-bg);
  border-bottom: 1px solid var(--fe-nav-border);
  display: flex; align-items: center;
  color: var(--fe-nav-fg);
}
.fe-nav__inner {
  max-width: var(--fe-container); margin: 0 auto; width: 100%;
  padding: 0 var(--fe-space-6);
  display: flex; align-items: center; gap: var(--fe-space-6);
}
.fe-brand {
  display: inline-flex; align-items: center; gap: var(--fe-space-2);
  color: var(--fe-nav-fg-strong); font-weight: var(--fe-weight-bold);
  font-size: var(--fe-text-h3); letter-spacing: -0.01em;
}
.fe-brand:hover { text-decoration: none; }
.fe-brand__mark {
  width: 22px; height: 22px; border-radius: var(--fe-radius-sm);
  background: var(--fe-accent);
  display: inline-grid; place-items: center; color: #fff;
  position: relative; flex: none;
}
.fe-brand__mark::after {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 2px var(--fe-accent);
}
.fe-nav__links { display: flex; align-items: center; gap: var(--fe-space-5); margin-left: var(--fe-space-2); }
.fe-nav__link {
  color: var(--fe-nav-fg); font-size: var(--fe-text-sm); font-weight: var(--fe-weight-medium);
  padding: var(--fe-space-1) 0; border-bottom: 2px solid transparent;
}
.fe-nav__link:hover { color: var(--fe-nav-fg-strong); text-decoration: none; }
.fe-nav__link[aria-current="page"] { color: var(--fe-nav-fg-strong); border-bottom-color: var(--fe-accent); }
.fe-nav__spacer { margin-left: auto; }
.fe-nav__user { color: var(--fe-nav-fg); font-size: var(--fe-text-sm); }

/* ---- Buttons ------------------------------------------------------------- */
.fe-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--fe-space-2);
  font-family: inherit; font-size: var(--fe-text-sm); font-weight: var(--fe-weight-semibold);
  line-height: 1; padding: 0 var(--fe-space-4); height: 36px;
  border-radius: var(--fe-radius-md); border: 1px solid transparent;
  cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, color .12s, opacity .12s;
  text-decoration: none;
}
.fe-btn:hover { text-decoration: none; }
.fe-btn--sm { height: 30px; padding: 0 var(--fe-space-3); font-size: var(--fe-text-xs); }
.fe-btn--lg { height: 44px; padding: 0 var(--fe-space-6); font-size: var(--fe-text-base); }
.fe-btn--block { width: 100%; }

.fe-btn--primary { background: var(--fe-btn-primary-bg); color: var(--fe-btn-primary-fg); }
.fe-btn--primary:hover { background: var(--fe-btn-primary-hover); }

.fe-btn--accent { background: var(--fe-accent); color: #fff; }
.fe-btn--accent:hover { background: var(--fe-accent-hover); }

.fe-btn--secondary { background: var(--fe-surface); color: var(--fe-text); border-color: var(--fe-border-strong); }
.fe-btn--secondary:hover { background: var(--fe-surface-3); }

.fe-btn--ghost { background: transparent; color: var(--fe-text-muted); }
.fe-btn--ghost:hover { background: var(--fe-surface-3); color: var(--fe-text); }

.fe-btn--danger { background: var(--fe-surface); color: var(--fe-block-text); border-color: var(--fe-block-border); }
.fe-btn--danger:hover { background: var(--fe-block-bg); }

.fe-btn:disabled, .fe-btn[aria-disabled="true"] {
  opacity: 0.5; cursor: not-allowed; pointer-events: none;
}
.fe-btn__icon { width: 16px; height: 16px; flex: none; }

/* ---- Cards --------------------------------------------------------------- */
.fe-card {
  background: var(--fe-surface);
  border: 1px solid var(--fe-border-color);
  border-radius: var(--fe-radius-xl);
  box-shadow: var(--fe-shadow-xs);
}
.fe-card__body { padding: var(--fe-space-6); }
.fe-card__head {
  padding: var(--fe-space-5) var(--fe-space-6);
  border-bottom: 1px solid var(--fe-border-color);
  display: flex; align-items: center; justify-content: space-between; gap: var(--fe-space-3);
}
.fe-card__title { font-size: var(--fe-text-h3); font-weight: var(--fe-weight-semibold); }

/* ---- Headings / eyebrows ------------------------------------------------- */
.fe-h1 { font-size: var(--fe-text-display); font-weight: var(--fe-weight-bold); letter-spacing: -0.02em; line-height: var(--fe-leading-tight); }
.fe-h2 { font-size: var(--fe-text-h2); font-weight: var(--fe-weight-semibold); letter-spacing: -0.01em; }
.fe-eyebrow {
  font-size: var(--fe-text-xxs); font-weight: var(--fe-weight-semibold);
  letter-spacing: var(--fe-tracking-eyebrow); text-transform: uppercase; color: var(--fe-text-subtle);
}
.fe-muted { color: var(--fe-text-muted); }
.fe-subtle { color: var(--fe-text-subtle); }

/* ---- Status pill / badge ------------------------------------------------- */
.fe-pill {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-size: var(--fe-text-xs); font-weight: var(--fe-weight-semibold);
  line-height: 1; padding: 0.4em 0.66em; border-radius: var(--fe-radius-pill);
  border: 1px solid transparent; white-space: nowrap;
}
.fe-pill__dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: currentColor; }
.fe-pill--pass    { background: var(--fe-pass-bg);    color: var(--fe-pass-text);    border-color: var(--fe-pass-border); }
.fe-pill--review  { background: var(--fe-review-bg);  color: var(--fe-review-text);  border-color: var(--fe-review-border); }
.fe-pill--block   { background: var(--fe-block-bg);   color: var(--fe-block-text);   border-color: var(--fe-block-border); }
.fe-pill--skip    { background: var(--fe-skip-bg);    color: var(--fe-skip-text);    border-color: var(--fe-skip-border); }
.fe-pill--running { background: var(--fe-running-bg); color: var(--fe-running-text); border-color: var(--fe-running-border); }

/* Solid variant for high-emphasis overall badges */
.fe-badge {
  display: inline-flex; align-items: center; gap: 0.45em;
  font-size: var(--fe-text-xs); font-weight: var(--fe-weight-semibold);
  padding: 0.4em 0.7em; border-radius: var(--fe-radius-md); color: #fff; line-height: 1; white-space: nowrap;
}
.fe-badge--pass    { background: var(--fe-pass-solid); }
.fe-badge--review  { background: var(--fe-review-solid); color: oklch(0.32 0.06 70); }
.fe-badge--block   { background: var(--fe-block-solid); }
.fe-badge--skip    { background: var(--fe-skip-solid); }
.fe-badge--running { background: var(--fe-running-solid); }

/* tiny status dot for inline use */
.fe-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; vertical-align: middle; }
.fe-dot--pass { background: var(--fe-pass-solid); }
.fe-dot--review { background: var(--fe-review-solid); }
.fe-dot--block { background: var(--fe-block-solid); }
.fe-dot--skip { background: var(--fe-skip-solid); }
.fe-dot--running { background: var(--fe-running-solid); }
.fe-dot--pulse { animation: fe-pulse 1.4s ease-in-out infinite; }
@keyframes fe-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---- Data table ---------------------------------------------------------- */
.fe-table-wrap { overflow-x: auto; border: 1px solid var(--fe-border-color); border-radius: var(--fe-radius-xl); background: var(--fe-surface); }
.fe-table { width: 100%; border-collapse: collapse; font-size: var(--fe-text-sm); }
.fe-table thead th {
  text-align: left; font-size: var(--fe-text-xxs); font-weight: var(--fe-weight-semibold);
  letter-spacing: var(--fe-tracking-eyebrow); text-transform: uppercase; color: var(--fe-text-subtle);
  padding: var(--fe-space-3) var(--fe-space-4); background: var(--fe-surface-2);
  border-bottom: 1px solid var(--fe-border-color); white-space: nowrap;
}
.fe-table tbody td { padding: var(--fe-space-3) var(--fe-space-4); border-bottom: 1px solid var(--fe-border-color); vertical-align: middle; }
.fe-table tbody tr:last-child td { border-bottom: 0; }
.fe-table tbody tr:hover { background: var(--fe-surface-2); }
.fe-table .fe-num { font-family: var(--fe-font-mono); text-align: right; font-variant-numeric: tabular-nums; }
.fe-table th.fe-num { text-align: right; }

/* ---- Forms --------------------------------------------------------------- */
.fe-field { display: flex; flex-direction: column; gap: var(--fe-space-2); }
.fe-label { font-size: var(--fe-text-sm); font-weight: var(--fe-weight-medium); color: var(--fe-text); }
.fe-help { font-size: var(--fe-text-xs); color: var(--fe-text-subtle); }
.fe-input, .fe-textarea, .fe-select {
  font-family: inherit; font-size: var(--fe-text-base); color: var(--fe-text);
  background: var(--fe-surface); border: 1px solid var(--fe-border-strong);
  border-radius: var(--fe-radius-md); padding: 0 var(--fe-space-3); height: 38px; width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
.fe-textarea { padding: var(--fe-space-3); height: auto; min-height: 96px; resize: vertical; line-height: var(--fe-leading-normal); }
.fe-input::placeholder, .fe-textarea::placeholder { color: var(--fe-text-subtle); }
.fe-input:focus, .fe-textarea:focus, .fe-select:focus { border-color: var(--fe-accent); box-shadow: var(--fe-focus-ring); outline: none; }
.fe-input.fe-mono, .fe-textarea.fe-mono { font-family: var(--fe-font-mono); font-size: var(--fe-text-sm); }

/* ---- Tabs ---------------------------------------------------------------- */
.fe-tabs { display: inline-flex; gap: var(--fe-space-1); background: var(--fe-surface-3); padding: 3px; border-radius: var(--fe-radius-md); }
.fe-tab {
  font-size: var(--fe-text-sm); font-weight: var(--fe-weight-medium); color: var(--fe-text-muted);
  padding: var(--fe-space-1) var(--fe-space-3); border: 0; background: transparent; cursor: pointer;
  border-radius: var(--fe-radius-sm); height: 28px;
}
.fe-tab[aria-selected="true"] { background: var(--fe-surface); color: var(--fe-text); box-shadow: var(--fe-shadow-xs); }

/* ---- Filter chips -------------------------------------------------------- */
.fe-chip {
  font-size: var(--fe-text-xs); font-weight: var(--fe-weight-medium); color: var(--fe-text-muted);
  padding: var(--fe-space-1) var(--fe-space-3); border: 1px solid var(--fe-border-color);
  border-radius: var(--fe-radius-pill); background: var(--fe-surface); cursor: pointer; height: 28px;
  display: inline-flex; align-items: center; gap: 0.4em;
}
.fe-chip[aria-pressed="true"] { background: var(--fe-text); color: var(--fe-surface); border-color: var(--fe-text); }

/* ---- Progress bar -------------------------------------------------------- */
.fe-progress { height: 8px; background: var(--fe-surface-3); border-radius: var(--fe-radius-pill); overflow: hidden; }
.fe-progress__fill { height: 100%; background: var(--fe-running-solid); border-radius: inherit; transition: width .4s ease; }
.fe-progress--striped .fe-progress__fill {
  background-image: linear-gradient(45deg, rgba(255,255,255,.22) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.22) 50%, rgba(255,255,255,.22) 75%, transparent 75%);
  background-size: 16px 16px; animation: fe-stripe 1s linear infinite;
}
@keyframes fe-stripe { from { background-position: 0 0; } to { background-position: 16px 0; } }

/* ---- Inline message / toast --------------------------------------------- */
.fe-msg {
  display: flex; gap: var(--fe-space-3); padding: var(--fe-space-3) var(--fe-space-4);
  border-radius: var(--fe-radius-md); border: 1px solid var(--fe-border-color);
  background: var(--fe-surface-2); font-size: var(--fe-text-sm);
}
.fe-msg--info    { background: var(--fe-running-bg); border-color: var(--fe-running-border); color: var(--fe-running-text); }
.fe-msg--success { background: var(--fe-pass-bg); border-color: var(--fe-pass-border); color: var(--fe-pass-text); }
.fe-msg--warn    { background: var(--fe-review-bg); border-color: var(--fe-review-border); color: var(--fe-review-text); }
.fe-msg--error   { background: var(--fe-block-bg); border-color: var(--fe-block-border); color: var(--fe-block-text); }

/* ---- Counters (stat tiles) ---------------------------------------------- */
.fe-stat { background: var(--fe-surface); border: 1px solid var(--fe-border-color); border-radius: var(--fe-radius-lg); padding: var(--fe-space-3) var(--fe-space-4); }
.fe-stat__num { font-family: var(--fe-font-mono); font-size: var(--fe-text-h2); font-weight: var(--fe-weight-semibold); font-variant-numeric: tabular-nums; line-height: 1.1; }
.fe-stat__label { font-size: var(--fe-text-xxs); letter-spacing: var(--fe-tracking-eyebrow); text-transform: uppercase; color: var(--fe-text-subtle); }

/* ---- Stacked status bar (pass/review/block visualization) --------------- */
.fe-statusbar { display: flex; height: 8px; border-radius: var(--fe-radius-pill); overflow: hidden; background: var(--fe-surface-3); }
.fe-statusbar > span { display: block; height: 100%; }
.fe-statusbar .seg-pass { background: var(--fe-pass-solid); }
.fe-statusbar .seg-review { background: var(--fe-review-solid); }
.fe-statusbar .seg-block { background: var(--fe-block-solid); }
.fe-statusbar .seg-skip { background: var(--fe-skip-solid); }

/* ---- Placeholder media (screenshot stand-in) ---------------------------- */
.fe-shot {
  background-color: var(--fe-surface-3);
  background-image: repeating-linear-gradient(135deg, transparent 0 7px, oklch(0.5 0.02 265 / 0.06) 7px 8px);
  border: 1px solid var(--fe-border-color); border-radius: var(--fe-radius-md);
  display: grid; place-items: center; color: var(--fe-text-subtle);
  font-family: var(--fe-font-mono); font-size: var(--fe-text-xxs); text-align: center; overflow: hidden;
}
.fe-shot--diff {
  background-color: oklch(0.97 0.004 265);
  background-image: repeating-linear-gradient(135deg, transparent 0 7px, oklch(0.62 0.21 25 / 0.07) 7px 8px);
}
.fe-shot button { all: unset; cursor: zoom-in; display: block; width: 100%; height: 100%; }

/* ========================================================================== */
/*  SCREEN-LEVEL COMPONENTS                                                    */
/* ========================================================================== */

/* ---- Page header / page title row --------------------------------------- */
.fe-pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--fe-space-4); flex-wrap: wrap; margin-bottom: var(--fe-space-5); }
.fe-breadcrumb { font-size: var(--fe-text-sm); color: var(--fe-text-muted); display: flex; align-items: center; gap: var(--fe-space-2); margin-bottom: var(--fe-space-2); }
.fe-breadcrumb a { color: var(--fe-text-muted); }
.fe-breadcrumb a:hover { color: var(--fe-text); }

/* ---- Sticky toolbar (console dashboard / report controls) --------------- */
.fe-toolbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--fe-space-3); flex-wrap: wrap;
  padding: var(--fe-space-3) var(--fe-space-6);
  background: color-mix(in oklch, var(--fe-surface) 88%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--fe-border-color);
}
.fe-toolbar .fe-input { height: 34px; }
.fe-divider-v { width: 1px; height: 22px; background: var(--fe-border-color); flex: none; }

/* Segmented control */
.fe-seg { display: inline-flex; border: 1px solid var(--fe-border-strong); border-radius: var(--fe-radius-md); overflow: hidden; }
.fe-seg button { border: 0; background: var(--fe-surface); font: var(--fe-weight-semibold) var(--fe-text-xs)/1 var(--fe-font-sans); color: var(--fe-text-muted); padding: 0 var(--fe-space-3); height: 34px; cursor: pointer; }
.fe-seg button + button { border-left: 1px solid var(--fe-border-strong); }
.fe-seg button[aria-pressed="true"], .fe-seg button[aria-selected="true"] { background: var(--fe-text); color: var(--fe-surface); }

/* Keyboard hint */
.fe-kbd { font: var(--fe-weight-semibold) var(--fe-text-xxs)/1 var(--fe-font-mono); background: var(--fe-surface-3); border: 1px solid var(--fe-border-color); border-bottom-width: 2px; border-radius: 4px; padding: 3px 5px; color: var(--fe-text-muted); }

/* ---- Tooltip (CSS, for gated buttons etc.) ------------------------------ */
.fe-tip { position: relative; display: inline-flex; }
.fe-tip__bubble {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(4px);
  background: var(--fe-neutral-900); color: var(--fe-neutral-50); font-size: var(--fe-text-xs);
  padding: var(--fe-space-2) var(--fe-space-3); border-radius: var(--fe-radius-md); white-space: nowrap;
  box-shadow: var(--fe-shadow-md); opacity: 0; pointer-events: none; transition: opacity .14s, transform .14s; z-index: 40; max-width: 260px; white-space: normal; width: max-content;
}
.fe-tip__bubble::after { content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--fe-neutral-900); }
.fe-tip:hover .fe-tip__bubble, .fe-tip:focus-within .fe-tip__bubble { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Round-trigger group (batch detail) --------------------------------- */
.fe-rounds { display: grid; gap: var(--fe-space-3); }
.fe-round {
  /* Number spans both rows; title sits top-right, actions wrap on the row
     below so any number of buttons (Run · View report · Copy link) fits the
     fixed-width left column instead of overflowing it. */
  display: grid; grid-template-columns: 28px 1fr; align-items: start;
  column-gap: var(--fe-space-3); row-gap: var(--fe-space-2);
  padding: var(--fe-space-3) var(--fe-space-4); border: 1px solid var(--fe-border-color);
  border-radius: var(--fe-radius-lg); background: var(--fe-surface);
}
.fe-round__num { grid-row: 1 / span 2; align-self: start; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: var(--fe-weight-semibold) var(--fe-text-sm)/1 var(--fe-font-mono); background: var(--fe-surface-3); color: var(--fe-text-muted); }
.fe-round.is-done   .fe-round__num { background: var(--fe-pass-solid); color: #fff; }
.fe-round.is-active .fe-round__num { background: var(--fe-running-solid); color: #fff; }
.fe-round.is-locked { opacity: 0.7; }
.fe-round__title { font-weight: var(--fe-weight-semibold); font-size: var(--fe-text-sm); }
.fe-round__desc { font-size: var(--fe-text-xs); color: var(--fe-text-subtle); }
.fe-round__actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--fe-space-2); }

/* ---- Status matrix (client × round) ------------------------------------- */
.fe-matrix td .fe-pill { width: 100%; justify-content: center; }
.fe-matrix .cell-client { font-family: var(--fe-font-mono); font-weight: var(--fe-weight-semibold); }
.fe-matrix th.round-col, .fe-matrix td.round-col { text-align: center; width: 150px; }

/* ---- Trend (blocked over time) — pure CSS bars -------------------------- */
.fe-trend { display: flex; align-items: flex-end; gap: 5px; height: 64px; }
.fe-trend__bar { flex: 1; min-width: 6px; background: var(--fe-block-solid); border-radius: 3px 3px 0 0; position: relative; opacity: 0.85; }
.fe-trend__bar.zero { background: var(--fe-border-strong); }
.fe-trend__bar:hover { opacity: 1; }
.fe-trend__bar[data-v]::after { content: attr(data-v); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font: var(--fe-weight-semibold) 10px/1 var(--fe-font-mono); color: var(--fe-text-muted); padding-bottom: 3px; opacity: 0; transition: opacity .12s; }
.fe-trend__bar:hover[data-v]::after { opacity: 1; }

/* ---- Comparison triptych (reports) -------------------------------------- */
.fe-trip { margin-top: var(--fe-space-4); }
.fe-trip__vp { display: flex; align-items: baseline; gap: var(--fe-space-3); margin-bottom: var(--fe-space-2); font-size: var(--fe-text-sm); }
.fe-trip__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--fe-space-3); }
.fe-trip figure { margin: 0; }
.fe-trip figcaption { font: var(--fe-weight-semibold) 10px/1 var(--fe-font-mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--fe-text-subtle); margin-bottom: var(--fe-space-2); }
.fe-trip figcaption.is-diff { color: var(--fe-block-text); }
.fe-pct-bad { color: var(--fe-block-text); font-weight: var(--fe-weight-semibold); font-family: var(--fe-font-mono); }
.fe-pct-ok { color: var(--fe-pass-text); font-weight: var(--fe-weight-semibold); font-family: var(--fe-font-mono); }

/* ---- Expandable row (a11y report / calm report) ------------------------- */
.fe-exrow { border: 1px solid var(--fe-border-color); border-radius: var(--fe-radius-lg); background: var(--fe-surface); overflow: hidden; }
.fe-exrow + .fe-exrow { margin-top: var(--fe-space-2); }
.fe-exrow__sum { display: flex; align-items: center; gap: var(--fe-space-4); padding: var(--fe-space-3) var(--fe-space-4); cursor: pointer; width: 100%; background: none; border: 0; font: inherit; text-align: left; color: inherit; }
.fe-exrow__sum:hover { background: var(--fe-surface-2); }
.fe-exrow__url { font-family: var(--fe-font-mono); font-size: var(--fe-text-sm); font-weight: var(--fe-weight-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fe-exrow__meta { margin-left: auto; display: flex; align-items: center; gap: var(--fe-space-4); }
.fe-exrow__chev { color: var(--fe-text-subtle); transition: transform .2s; }
.fe-exrow[open] .fe-exrow__chev, .fe-exrow.is-open .fe-exrow__chev { transform: rotate(90deg); }
.fe-exrow__detail { padding: var(--fe-space-3) var(--fe-space-4) var(--fe-space-5); border-top: 1px solid var(--fe-border-color); background: var(--fe-surface-2); }

/* ---- Master / detail split (batch report C) ----------------------------- */
.fe-split { display: grid; grid-template-columns: 320px 1fr; min-height: 0; }
.fe-split__master { border-right: 1px solid var(--fe-border-color); background: var(--fe-surface); overflow: auto; }
.fe-split__search { padding: var(--fe-space-3) var(--fe-space-4); border-bottom: 1px solid var(--fe-border-color); position: sticky; top: 0; background: var(--fe-surface); z-index: 2; }
.fe-mitem { display: flex; align-items: center; gap: var(--fe-space-3); width: 100%; padding: var(--fe-space-3) var(--fe-space-4); border: 0; border-bottom: 1px solid var(--fe-border-color); background: none; font: inherit; text-align: left; color: inherit; cursor: pointer; }
.fe-mitem:hover { background: var(--fe-surface-2); }
.fe-mitem.is-sel { background: var(--fe-accent-weak); box-shadow: inset 3px 0 0 var(--fe-accent); }
.fe-mitem__dom { font-family: var(--fe-font-mono); font-size: var(--fe-text-sm); font-weight: var(--fe-weight-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fe-mitem__count { margin-left: auto; font-family: var(--fe-font-mono); font-size: var(--fe-text-xs); color: var(--fe-text-subtle); }
.fe-split__detail { overflow: auto; padding: var(--fe-space-6); }

/* ---- Lightbox ----------------------------------------------------------- */
.fe-lightbox { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; background: oklch(0.18 0.035 265 / 0.82); padding: var(--fe-space-8); }
.fe-lightbox[open], .fe-lightbox.is-open { display: flex; }
.fe-lightbox__img { max-width: 92vw; max-height: 86vh; border-radius: var(--fe-radius-md); box-shadow: var(--fe-shadow-lg); background: var(--fe-surface); }
.fe-lightbox__close { position: absolute; top: var(--fe-space-5); right: var(--fe-space-5); width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--fe-surface); color: var(--fe-text); font-size: 20px; cursor: pointer; box-shadow: var(--fe-shadow-md); }
.fe-lightbox__cap { position: absolute; bottom: var(--fe-space-6); left: 50%; transform: translateX(-50%); color: var(--fe-neutral-50); font-family: var(--fe-font-mono); font-size: var(--fe-text-sm); }

/* ---- Toast -------------------------------------------------------------- */
.fe-toasts { position: fixed; bottom: var(--fe-space-6); left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: var(--fe-space-2); align-items: center; }
.fe-toast { display: flex; align-items: center; gap: var(--fe-space-2); padding: var(--fe-space-3) var(--fe-space-4); border-radius: var(--fe-radius-md); background: var(--fe-neutral-900); color: var(--fe-neutral-50); font-size: var(--fe-text-sm); box-shadow: var(--fe-shadow-lg); animation: fe-toast-in .2s ease; }
@keyframes fe-toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---- Empty state -------------------------------------------------------- */
.fe-empty { text-align: center; padding: var(--fe-space-12) var(--fe-space-6); border: 1px dashed var(--fe-border-strong); border-radius: var(--fe-radius-xl); color: var(--fe-text-muted); background: var(--fe-surface); }
.fe-empty__icon { width: 44px; height: 44px; border-radius: var(--fe-radius-lg); background: var(--fe-surface-3); display: inline-grid; place-items: center; margin-bottom: var(--fe-space-3); color: var(--fe-text-subtle); }

/* ---- Login -------------------------------------------------------------- */
.fe-login { min-height: 100vh; display: grid; grid-template-rows: var(--fe-nav-height) 1fr; }
.fe-login__main { display: grid; place-items: center; padding: var(--fe-space-6); }
.fe-login__card { width: 100%; max-width: 400px; text-align: center; }
.fe-btn-google { display: inline-flex; align-items: center; gap: var(--fe-space-3); background: var(--fe-surface); color: var(--fe-text); border: 1px solid var(--fe-border-strong); height: 44px; padding: 0 var(--fe-space-5); border-radius: var(--fe-radius-md); font-weight: var(--fe-weight-semibold); font-size: var(--fe-text-base); cursor: pointer; }
.fe-btn-google:hover { background: var(--fe-surface-2); }

/* ---- Theme toggle + prototype state switcher ---------------------------- */
.fe-themetoggle { background: none; border: 1px solid var(--fe-nav-border); color: var(--fe-nav-fg); width: 32px; height: 32px; border-radius: var(--fe-radius-md); cursor: pointer; display: grid; place-items: center; }
.fe-themetoggle:hover { color: var(--fe-nav-fg-strong); }

.fe-protobar {
  position: fixed; bottom: var(--fe-space-4); right: var(--fe-space-4); z-index: 80;
  display: flex; align-items: center; gap: var(--fe-space-2); flex-wrap: wrap; max-width: 360px;
  padding: var(--fe-space-2) var(--fe-space-3); background: var(--fe-neutral-900); color: var(--fe-neutral-50);
  border-radius: var(--fe-radius-lg); box-shadow: var(--fe-shadow-lg); font-size: var(--fe-text-xs);
}
.fe-protobar__label { font-family: var(--fe-font-mono); color: oklch(0.7 0.02 265); text-transform: uppercase; letter-spacing: 0.06em; font-size: 10px; }
.fe-protobar a, .fe-protobar button { color: oklch(0.78 0.02 265); background: oklch(0.32 0.03 265); border: 0; border-radius: var(--fe-radius-sm); padding: 4px 8px; font-size: var(--fe-text-xs); cursor: pointer; text-decoration: none; }
.fe-protobar a:hover, .fe-protobar button:hover { color: #fff; text-decoration: none; }
.fe-protobar a.is-on, .fe-protobar button.is-on { background: var(--fe-accent); color: #fff; }

/* ---- Misc utility ------------------------------------------------------- */
.fe-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--fe-space-4); }
.fe-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--fe-space-4); }
.fe-mt-2 { margin-top: var(--fe-space-2); } .fe-mt-4 { margin-top: var(--fe-space-4); } .fe-mt-6 { margin-top: var(--fe-space-6); }
.fe-hidden { display: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* ========================================================================== */
/*  ANCHOR-AS-COMPONENT GUARD                                                  */
/*  `.fe-app a { color: var(--fe-link) }` (0,1,1) outranks single-class        */
/*  component color rules, so any <a class="fe-btn|fe-nav__link|fe-brand">     */
/*  inherits the link color. These double-class / scoped selectors (0,2,x)     */
/*  win it back without !important. Keep these LAST.                           */
/* ========================================================================== */
.fe-btn.fe-btn--primary   { color: var(--fe-btn-primary-fg); }
.fe-btn.fe-btn--accent    { color: #fff; }
.fe-btn.fe-btn--secondary { color: var(--fe-text); }
.fe-btn.fe-btn--ghost     { color: var(--fe-text-muted); }
.fe-btn.fe-btn--danger    { color: var(--fe-block-text); }
.fe-app a.fe-btn:hover    { text-decoration: none; }

.fe-nav a.fe-brand        { color: var(--fe-nav-fg-strong); }
.fe-nav a.fe-nav__link    { color: var(--fe-nav-fg); }
.fe-nav a.fe-nav__link:hover,
.fe-nav a.fe-nav__link[aria-current="page"] { color: var(--fe-nav-fg-strong); }
.fe-nav a.fe-brand:hover, .fe-nav a.fe-nav__link:hover { text-decoration: none; }

/* ============================================================================
   UTILITIES — keep markup free of inline style="" attributes. Reference these
   classes instead. Only genuinely dynamic, data-driven values (e.g. a status
   bar segment's computed width %) should remain inline.
   ============================================================================ */

/* Spacing */
.fe-mt-1 { margin-top: var(--fe-space-1); }
.fe-ml-1 { margin-left: var(--fe-space-1); }
.fe-mt-3 { margin-top: var(--fe-space-3); }
.fe-pad-sm { padding: 0.25em 0.5em; }
.fe-mb-2 { margin-bottom: var(--fe-space-2); }
.fe-mb-3 { margin-bottom: var(--fe-space-3); }
.fe-mb-4 { margin-bottom: var(--fe-space-4); }
.fe-mb-5 { margin-bottom: var(--fe-space-5); }
.fe-mb-6 { margin-bottom: var(--fe-space-6); }
.fe-pb-5 { padding-bottom: var(--fe-space-5); }
.fe-p-4 { padding: var(--fe-space-4); }
.fe-p-4-5 { padding: var(--fe-space-4) var(--fe-space-5); }
.fe-gap-2 { gap: var(--fe-space-2); }
.fe-gap-3 { gap: var(--fe-space-3); }
.fe-gap-4 { gap: var(--fe-space-4); }
.fe-gap-5 { gap: var(--fe-space-5); }
.fe-gap-6 { gap: var(--fe-space-6); }

/* De-emphasise an operator-excluded client row (matrix row / report exrow). */
.fe-row--excluded { opacity: 0.55; }
.cell-actions { text-align: right; white-space: nowrap; }

/* Flex / grid alignment */
.fe-items-center { align-items: center; }
.fe-items-start  { align-items: flex-start; }
.fe-items-end    { align-items: flex-end; }
.fe-justify-end  { justify-content: flex-end; }
.fe-self-center  { align-self: center; }
.fe-wrap         { flex-wrap: wrap; }
.fe-grid-1 { grid-template-columns: 1fr; }
.fe-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Type */
.fe-text-xxs  { font-size: var(--fe-text-xxs); }
.fe-text-xs   { font-size: var(--fe-text-xs); }
.fe-text-sm   { font-size: var(--fe-text-sm); }
.fe-text-base { font-size: var(--fe-text-base); }
.fe-fw-medium   { font-weight: var(--fe-weight-medium); }
.fe-fw-semibold { font-weight: var(--fe-weight-semibold); }
.fe-text-center { text-align: center; }
.fe-text-right  { text-align: right; }
.fe-nowrap   { white-space: nowrap; }
.fe-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Status / muted text colors (.fe-muted + .fe-subtle already defined above) */
.fe-text--pass   { color: var(--fe-pass-text); }
.fe-text--review { color: var(--fe-review-text); }
.fe-text--block  { color: var(--fe-block-text); }
.fe-text--skip   { color: var(--fe-skip-text); }

/* Misc reset / link helpers */
.fe-reset    { border: 0; padding: 0; margin: 0; }
.fe-cardlink { display: block; text-decoration: none; color: inherit; }
.fe-divider-top { border-top: 1px solid var(--fe-border-color); padding-top: var(--fe-space-4); }
.fe-eyebrow--plain { font-weight: var(--fe-weight-regular); text-transform: none; letter-spacing: 0; }
.fe-maxw-240 { max-width: 240px; }
.fe-rel { position: relative; }

/* Form-field sizing (New Run / Queue rows) */
.fe-field--grow  { flex: 1; min-width: 240px; }
.fe-field--fixed { width: 200px; }
.fe-help--float  { position: absolute; top: 100%; left: 0; margin-top: 4px; white-space: nowrap; }

/* Sticky settings save bar */
.fe-actionbar { position: sticky; bottom: 0; background: var(--fe-bg); padding: var(--fe-space-4) 0; border-top: 1px solid var(--fe-border-color); }

/* Batch detail two-column layout (rounds + matrix) */
.fe-batch-layout { grid-template-columns: 380px 1fr; align-items: start; gap: var(--fe-space-6); }
@media (max-width: 820px) { .fe-batch-layout { grid-template-columns: 1fr; } }

/* Batch id heading (long mono id that must wrap) */
.fe-h1--id { font-size: 1.3rem; line-height: 1.3; letter-spacing: 0; word-break: break-all; }

/* Login card logo mark */
.fe-login__logo { width: 44px; height: 44px; border-radius: 10px; }

/* A box sized to hold a captured screenshot / diff overlay */
.fe-shotbox { height: 150px; }
/* Compact URL-search input in the run report controls */
.fe-search-input { width: 220px; height: 34px; }
/* Narrow status distribution bar in the runs table */
.fe-statusbar--mini { width: 96px; }

/* Discovery-warning list */
.fe-warn-list { margin: 6px 0 0; padding-left: 18px; font-size: var(--fe-text-sm); }

/* Progress fill starts empty; JS sets the width as the round progresses */
.fe-progress__fill { width: 0; }
