/* Shared design tokens for the suite's visual style. */
:root{
  --border:#111;
  --line:#d7d7db;
  --muted:#666;
  --muted-2:#6b7280;
  --bg:#fff;
  --panel:#fafafa;
  --shadow: rgba(0,0,0,0.12);
  --accent:#1e7a6f;
  --accent-dark:#0b2f2c;
  --btn-primary-bg:#2f6f73;
  --btn-primary-border:#245659;
  --warn-bg:#fff4d6; --warn-border:#f4d07b; --warn-text:#6b4f12;
  --crit-bg:#fff1ef; --crit-border:#e7b5b1; --crit-text:#a12622;
  --good-bg:#e9f5ea; --good-border:#b7dfc3; --good-text:#1e6b34;
  --seq-100:#e3f1ef; --seq-300:#a9d3cd; --seq-500:#3b8f83; --seq-700:#0b2f2c;
  --header-h:64px; --tabs-h:46px; --footer-h:40px;
}
@media (prefers-color-scheme: dark){
  :root:where(:not([data-theme="light"])){
    --border:#e8e8ea; --line:#333338; --muted:#a3a3ab; --muted-2:#9a9aa2;
    --bg:#16171a; --panel:#1e1f23; --shadow: rgba(0,0,0,0.4);
    --accent:#4fb3a3; --accent-dark:#bfe9e0;
    --btn-primary-bg:#2f6f73; --btn-primary-border:#3d8b8f;
    --warn-bg:#3a3110; --warn-border:#6b5a1c; --warn-text:#f4d07b;
    --crit-bg:#3a1917; --crit-border:#6b332e; --crit-text:#f3a49d;
    --good-bg:#12281a; --good-border:#265c37; --good-text:#7fd399;
    --seq-100:#1c2b29; --seq-300:#2c554e; --seq-500:#4fb3a3; --seq-700:#bfe9e0;
  }
}
:root[data-theme="dark"]{
  --border:#e8e8ea; --line:#333338; --muted:#a3a3ab; --muted-2:#9a9aa2;
  --bg:#16171a; --panel:#1e1f23; --shadow: rgba(0,0,0,0.4);
  --accent:#4fb3a3; --accent-dark:#bfe9e0;
  --btn-primary-bg:#2f6f73; --btn-primary-border:#3d8b8f;
  --warn-bg:#3a3110; --warn-border:#6b5a1c; --warn-text:#f4d07b;
  --crit-bg:#3a1917; --crit-border:#6b332e; --crit-text:#f3a49d;
  --good-bg:#12281a; --good-border:#265c37; --good-text:#7fd399;
  --seq-100:#1c2b29; --seq-300:#2c554e; --seq-500:#4fb3a3; --seq-700:#bfe9e0;
}
:root[data-theme="light"]{
  --border:#111; --line:#d7d7db; --muted:#666; --muted-2:#6b7280;
  --bg:#fff; --panel:#fafafa; --shadow: rgba(0,0,0,0.12);
  --accent:#1e7a6f; --accent-dark:#0b2f2c;
  --btn-primary-bg:#2f6f73; --btn-primary-border:#245659;
  --warn-bg:#fff4d6; --warn-border:#f4d07b; --warn-text:#6b4f12;
  --crit-bg:#fff1ef; --crit-border:#e7b5b1; --crit-text:#a12622;
  --good-bg:#e9f5ea; --good-border:#b7dfc3; --good-text:#1e6b34;
  --seq-100:#e3f1ef; --seq-300:#a9d3cd; --seq-500:#3b8f83; --seq-700:#0b2f2c;
}

*{ box-sizing:border-box; }
html,body{ width:100%; height:100%; margin:0; }
body{
  font-family:"Source Sans 3","Segoe UI","Helvetica Neue",Arial,sans-serif;
  background:var(--bg); color:var(--border); font-size:14px;
  display:flex; flex-direction:column; overflow:hidden;
}
@media (prefers-reduced-motion: reduce){ *{ animation-duration:0.001ms !important; transition-duration:0.001ms !important; } }
.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }
.tnum{ font-variant-numeric: tabular-nums; }

/* ---- fixed shell: header + tabs + footer never scroll away; only the
   active view's body does. Known-height chrome, height:calc(100vh - chrome)
   with overflow:hidden on the shell, flex:1 + min-height:0 + overflow:auto
   on the one region that actually scrolls. ---- */
header{
  height:var(--header-h); flex:0 0 auto; box-sizing:border-box;
  padding:0 20px; background:var(--accent-dark); color:#fff;
  display:flex; align-items:center; gap:14px;
}
.brand{ display:flex; align-items:center; gap:12px; }
.brand-mark{ width:32px; height:32px; flex:none; color:#fff; }
header h1{ margin:0; font-size:21px; line-height:1.15; color:#fff; }
.tagline{ margin:1px 0 0; font-size:11.5px; color:rgba(255,255,255,0.62); }
.crumb{ color:rgba(255,255,255,0.7); text-decoration:none; font-size:12.5px; }
.crumb:hover{ color:#fff; text-decoration:underline; }
.headerRight{ display:flex; align-items:center; gap:10px; margin-left:auto; }
/* Status pills read fine on the light workspace by default (.status.good
   etc, defined in components.css) — these overrides only apply inside the
   dark header so the same pill classes stay legible against --accent-dark
   instead of needing a second set of status classes. */
header .status{ background:rgba(255,255,255,0.1); border-color:rgba(255,255,255,0.22); color:#fff; }
header .status.good{ background:rgba(127,211,153,0.16); border-color:rgba(127,211,153,0.4); color:#bdf0cc; }
header .status.good .status-dot{ background:#7fd399; }
header .status.warn{ background:rgba(244,208,123,0.16); border-color:rgba(244,208,123,0.4); color:#f4d07b; }
header .status.warn .status-dot{ background:#f4d07b; }
header .status.crit{ background:rgba(243,164,157,0.16); border-color:rgba(243,164,157,0.4); color:#f3a49d; }
header .status.crit .status-dot{ background:#f3a49d; }

.fileProtoBanner{
  display:none; flex:0 0 auto; padding:8px 18px; background:var(--warn-bg); border-bottom:1px solid var(--warn-border);
  color:var(--warn-text); font-size:13px;
}

/* Flat text tabs on the light workspace bar directly under the dark
   header — a teal underline marks the active tab, no boxed/card tabs. */
.tabs{ flex:0 0 auto; height:var(--tabs-h); box-sizing:border-box; display:flex; align-items:center; gap:26px; padding:0 20px; border-bottom:1px solid var(--line); background:var(--bg); }
.tab{
  font-family:inherit; border:none; background:transparent; color:var(--muted);
  padding:0; height:100%; font-size:13.5px; font-weight:600; cursor:pointer;
  position:relative; display:inline-flex; align-items:center;
}
.tab:hover{ color:var(--border); }
.tab.active{ color:var(--accent); }
.tab.active::after{ content:""; position:absolute; left:0; right:0; bottom:0; height:2px; background:var(--accent); border-radius:1px 1px 0 0; }

.shell-main{ flex:1 1 auto; min-height:0; overflow:hidden; display:flex; flex-direction:column; }
.view{ display:none; flex:1; min-height:0; overflow-y:auto; flex-direction:column; gap:12px; padding:14px 18px; }
.view.active{ display:flex; }

.section{ background:var(--bg); border:1px solid var(--line); border-radius:12px; padding:12px 15px; }
.section h2{ margin:0 0 3px; font-size:17px; display:flex; align-items:center; gap:6px; }
.section .hint{ margin:0 0 10px; font-size:12.5px; color:var(--muted); }
.eyebrow{ font-size:11px; font-weight:700; letter-spacing:0.04em; text-transform:uppercase; color:var(--accent); margin-bottom:2px; }

/* A lone primary .section (e.g. the "Saved datasets" table card) grows to
   fill leftover vertical space instead of leaving dead page background
   below a short/empty table — the table area itself scrolls if it ever
   overflows, everything else in the card stays put. */
.section.fill-remaining{ flex:1 1 auto; display:flex; flex-direction:column; min-height:0; }
.section.fill-remaining > .table-wrap{ flex:1 1 auto; min-height:0; overflow:auto; }

/* Docked Active Status bar — a fixed-height flex sibling of the .view
   sections inside .shell-main, sitting directly above the footer on every
   tab. Collapsed by default (single compact row); expanding it grows this
   bar's own height, which shrinks the .view.active flex:1 area to match
   (real layout reflow, not an overlay) — so it can never cover other
   content regardless of which tab or how far that tab is scrolled. */
.wf-run-drawer{
  flex:0 0 auto; background:var(--bg); border-top:1px solid var(--line);
  padding:10px 18px;
}
.wf-run-drawer-inner{ max-width:2200px; margin:0 auto; }
#runProgressDetails.collapsed{ display:none; }
#runProgressToggleBtn svg{ color:var(--muted); }
#runProgressToggleBtn:hover svg{ color:var(--accent); }
/* Compact single-row stat columns (plain dividers, no individual card
   borders) — the generic .stat-grid/.stat cards elsewhere (Results
   selection summary, diversity summary) are untouched. */
#runProgressDetails .stat-grid{ display:flex; gap:0; }
#runProgressDetails .stat{
  background:none; border:none; border-radius:0; padding:0 20px;
  border-left:1px solid var(--line); flex:none;
}
#runProgressDetails .stat:first-child{ border-left:none; padding-left:0; }
#runProgressDetails .st-value{ font-size:16px; }

footer{
  flex:0 0 auto; height:var(--footer-h); box-sizing:border-box;
  padding:0 18px; border-top:1px solid var(--line);
  display:flex; align-items:center; gap:22px; font-size:11.5px; color:var(--muted); overflow:hidden;
}
footer strong{ color:var(--border); }
footer .fr{ margin-left:auto; }
footer .copyright{ color:var(--muted); }

.notice{ font-size:12px; padding:8px 12px; border-radius:8px; border:1px solid var(--line); background:var(--panel); color:var(--muted); }
.notice.crit{ color:var(--crit-text); background:var(--crit-bg); border-color:var(--crit-border); }
.notice.good{ color:var(--good-text); background:var(--good-bg); border-color:var(--good-border); }
.empty-state{ padding:22px; text-align:center; color:var(--muted); font-size:13px; }
