/* Test Center design tokens. Layout: top bar (module switcher, run chip, theme, user) over a module sidebar and
   the page. Light is the default; dark follows the OS, and the theme toggle (saved per user) overrides both. */
:root {
  --bg: #f5f7fa; --surface: #ffffff; --surface-2: #f1f4f8; --surface-3: #e8edf3;
  --border: #e0e6ed; --border-strong: #c9d2dd;
  --fg: #141b24; --muted: #556170; --faint: #7f8a99;
  --side-bg: #fbfcfd; --side-fg: #3a4552; --side-active: #e6f2f0; --side-active-fg: #0b544e;
  --top-bg: #ffffff; --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -12px rgba(16, 24, 40, .18);
  --accent: #0f766e; --accent-soft: #e2f3f0; --accent-ink: #0b544e; --on-accent: #ffffff;
  --pass: #15803d; --pass-soft: #dcfce7; --fail: #b42318; --fail-soft: #fde7e5;
  --skip: #a15c07; --skip-soft: #fef3c7; --notrun: #5b6676; --notrun-soft: #e9edf2;
  --warn: #b45309; --warn-soft: #fff4e5;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --topbar-h: 56px; --side-w: 248px; --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0b1016; --surface: #121922; --surface-2: #18212c; --surface-3: #1f2a37;
  --border: #232e3c; --border-strong: #324155;
  --fg: #e6ebf2; --muted: #9ba7b7; --faint: #6f7b8c;
  --side-bg: #0e141b; --side-fg: #b3bfcd; --side-active: #10302c; --side-active-fg: #99f6e4;
  --top-bg: #0e141b; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px -12px rgba(0, 0, 0, .6);
  --accent: #2dd4bf; --accent-soft: #0f2b28; --accent-ink: #99f6e4; --on-accent: #04201d;
  --pass: #4ade80; --pass-soft: #11301d; --fail: #f87171; --fail-soft: #3a1513; --skip: #fbbf24; --skip-soft: #33270a;
  --notrun: #9aa6b6; --notrun-soft: #1f2835; --warn: #fbbf24; --warn-soft: #33270a; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0b1016; --surface: #121922; --surface-2: #18212c; --surface-3: #1f2a37;
  --border: #232e3c; --border-strong: #324155;
  --fg: #e6ebf2; --muted: #9ba7b7; --faint: #6f7b8c;
  --side-bg: #0e141b; --side-fg: #b3bfcd; --side-active: #10302c; --side-active-fg: #99f6e4;
  --top-bg: #0e141b; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px -12px rgba(0, 0, 0, .6);
  --accent: #2dd4bf; --accent-soft: #0f2b28; --accent-ink: #99f6e4; --on-accent: #04201d;
  --pass: #4ade80; --pass-soft: #11301d; --fail: #f87171; --fail-soft: #3a1513; --skip: #fbbf24; --skip-soft: #33270a;
  --notrun: #9aa6b6; --notrun-soft: #1f2835; --warn: #fbbf24; --warn-soft: #33270a; color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.55 var(--sans); background: var(--bg); color: var(--fg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }

/* ── app shell ─────────────────────────────────────────────────────────── */
.topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar-h); display: flex; align-items: center; gap: 14px;
  padding: 0 18px; background: var(--top-bg); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: calc(100vh - var(--topbar-h)); }
.sidebar { background: var(--side-bg); border-right: 1px solid var(--border); padding: 14px 10px 20px; position: sticky;
  top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto; display: flex; flex-direction: column; }
.side-group { padding: 4px 0 10px; }
.side-title { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); font-weight: 650; padding: 8px 10px 4px; }
.sidebar a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 7px;
  color: var(--side-fg); font-size: 13.5px; }
.sidebar a:hover { background: var(--surface-2); color: var(--fg); text-decoration: none; }
.sidebar a.active { background: var(--side-active); color: var(--side-active-fg); font-weight: 600; }
.sidebar a.disabled { color: var(--faint); }
.sidebar .badge { background: var(--fail); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 7px; font-weight: 600; }
.sidebar .hint-tag { font-size: 10.5px; color: var(--faint); font-weight: 400; }
.sidebar details.planned summary { list-style: none; cursor: pointer; padding: 6px 10px; font-size: 12px; color: var(--faint); }
.sidebar details.planned summary::-webkit-details-marker { display: none; }
.sidebar details.planned summary::before { content: "+ "; }
.sidebar details.planned[open] summary::before { content: "– "; }
.sidebar details.planned a { padding-left: 18px; font-size: 13px; }
.side-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--border); line-height: 1.5; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--fg); }
.icon-btn:focus-visible, .menu-btn:focus-visible, .btn:focus-visible, .sidebar a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-toggle { display: none; }
#theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] #theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] #theme-toggle .i-moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #theme-toggle .i-sun { display: none; }
  :root:not([data-theme="light"]) #theme-toggle .i-moon { display: block; } }
.menu { position: relative; }
.menu-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--fg); font: inherit; cursor: pointer; }
.menu-btn:hover { background: var(--surface-2); }
.module-switch .menu-btn b { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.menu-pop { display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 300px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 60; }
.menu-pop.right { left: auto; right: 0; min-width: 220px; }
.menu.open .menu-pop { display: block; }
.menu-head { font-size: 11.5px; color: var(--faint); padding: 8px 10px 6px; }
.menu-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--fg); }
.menu-item > span { display: flex; flex-direction: column; }
.menu-item:hover { background: var(--surface-2); text-decoration: none; }
.menu-item.current { background: var(--side-active); }
.tag { font-size: 10.5px; color: var(--faint); border: 1px solid var(--border); border-radius: 20px; padding: 0 8px; white-space: nowrap; }
.tag.on { color: var(--accent-ink); border-color: var(--accent); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid;
  place-items: center; font-size: 11.5px; font-weight: 700; }
.user-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.running-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 20px; background: var(--accent-soft);
  color: var(--accent-ink); font-size: 12.5px; font-weight: 600; }
.running-chip .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s infinite; }
.live-runs { display: inline-flex; gap: 6px; min-width: 0; overflow-x: auto; }      /* several runs can go at once */
.live-runs:empty { display: none; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .running-chip .pulse { animation: none; } }
@media (max-width: 900px) {
  .nav-toggle { display: inline-grid; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: var(--topbar-h); width: min(var(--side-w), 86vw); z-index: 45; transform: translateX(-102%);
    transition: transform .18s ease; box-shadow: var(--shadow); }
  body.side-open .sidebar { transform: none; }
  .user-text, .module-switch .menu-btn .small { display: none; }
}
@media (max-width: 560px) { .brand-name { display: none; } .menu-pop { min-width: 260px; } .topbar { gap: 8px; padding: 0 10px; } }

.main { padding: 26px 32px 64px; max-width: 1440px; width: 100%; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head h1 { font-size: 23px; margin: 0; font-weight: 650; letter-spacing: -.015em; text-wrap: balance; }
.head p { margin: 4px 0 0; color: var(--muted); max-width: 80ch; }
.crumbs { font-size: 12px; color: var(--faint); margin-bottom: 4px; }
.crumbs a { color: var(--faint); }

.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4, .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .g4, .g3, .g2 { grid-template-columns: 1fr; } .main { padding: 18px 16px 48px; } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.card h2 { font-size: 15px; margin: 0 0 12px; font-weight: 600; }
.card h3 { font-size: 13px; margin: 14px 0 6px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .n { font-size: 28px; font-weight: 600; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: 12px; }
.stat.pass .n { color: var(--pass); } .stat.fail .n { color: var(--fail); } .stat.skip .n { color: var(--skip); }

.bar { display: flex; height: 8px; border-radius: 6px; overflow: hidden; background: var(--notrun-soft); margin: 8px 0 4px; }
.bar span { display: block; }
.bar .pass { background: var(--pass); } .bar .fail { background: var(--fail); } .bar .skip { background: var(--skip); }

.pill { display: inline-block; padding: 1px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.pill.pass { background: var(--pass-soft); color: var(--pass); }
.pill.fail { background: var(--fail-soft); color: var(--fail); }
.pill.skip { background: var(--skip-soft); color: var(--skip); }
.pill.notrun, .pill.stopped { background: var(--notrun-soft); color: var(--notrun); }
.pill.running { background: var(--accent-soft); color: var(--accent-ink); }
.pill.passed { background: var(--pass-soft); color: var(--pass); } .pill.failed, .pill.error { background: var(--fail-soft); color: var(--fail); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; background: var(--surface-2); position: sticky; top: 0; }
tbody tr:hover { background: var(--surface-2); }
td.id { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
td .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table-wrap table th:first-child, .table-wrap table td:first-child { padding-left: 14px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; gap: 8px; align-items: center; }
.tabs a.active { color: var(--fg); border-color: var(--accent); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--fg); }
.tabs .mini { font-size: 11px; color: var(--faint); }

.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--fg); font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--fail); border-color: var(--fail); }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; }

.callout { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 11px 14px; border-radius: 0; margin: 12px 0; }
.callout.warn { border-color: var(--warn); background: var(--warn-soft); }
.callout.fail { border-color: var(--fail); background: var(--fail-soft); }

pre.sql { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; overflow-x: auto; margin: 6px 0; white-space: pre; }
pre.log { background: #0b1017; color: #cfd8e3; border: 1px solid var(--border); border-radius: 10px; padding: 14px; height: 340px; overflow: auto; margin: 0; font-size: 12px; white-space: pre-wrap; }
.steps { margin: 0; padding-left: 20px; } .steps li { margin: 3px 0; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; }
.kv div:nth-child(odd) { color: var(--muted); }
.query { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 12px; background: var(--surface); }
.query .meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.sample { overflow-x: auto; } .sample table { font-size: 12px; } .sample th { position: static; }

form label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
input[type=text], input[type=search], input[type=password], input[type=number], input[type=email], select, textarea { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--fg); font: inherit; }
textarea { min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.check { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; background: var(--surface); }
.check input { margin-top: 3px; } .check b { display: block; } .check span { color: var(--muted); font-size: 12px; }
.check.data { border-color: var(--warn); }
.field { margin-bottom: 12px; } .hint { font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.errors { color: var(--fail); } .errors li { margin: 2px 0; }

.modal-bg { position: fixed; inset: 0; background: rgba(8, 12, 18, .55); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-bg.open { display: flex; }
.modal { background: var(--surface); border-radius: 14px; max-width: 760px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 22px; border: 1px solid var(--border); }
.modal h2 { margin: 0 0 6px; font-size: 18px; }
.empty { text-align: center; padding: 40px; color: var(--muted); }
.step-row { display: grid; grid-template-columns: 34px 1fr 200px 34px 34px 34px; gap: 6px; align-items: center; margin-bottom: 6px; }
.bank-line-row { display: grid; grid-template-columns: 1.2fr 2fr 1fr 1fr 1fr 1fr 34px; gap: 6px; margin-bottom: 6px; }
.line-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 34px; gap: 6px; margin-bottom: 6px; }
.status-dots { display: flex; gap: 3px; } .status-dots i { width: 10px; height: 10px; border-radius: 3px; display: block; background: var(--notrun-soft); }
.status-dots i.pass { background: var(--pass); } .status-dots i.fail { background: var(--fail); } .status-dots i.skip { background: var(--skip); }
img.shot { max-width: 100%; border: 1px solid var(--border); border-radius: 8px; }
video { max-width: 100%; border-radius: 8px; }

/* sidebar areas */

/* screen sub-navigation + test data */
.subnav { display: flex; gap: 6px; margin: -4px 0 18px; }
.subnav a { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.subnav a.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.subnav a:hover { text-decoration: none; color: var(--fg); }
.td-card { margin-bottom: 16px; }
.td-biz { width: 100%; margin-top: 6px; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 20px;
  background: var(--accent-soft); color: var(--accent-ink); font-size: 12.5px; font-weight: 600; }
.chip small { font-weight: 400; color: var(--muted); }
.chip.bad { background: var(--fail-soft); color: var(--fail); }
.chip button { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0 4px; }
.subnav .badge { background: #b42318; color: #fff; border-radius: 10px; font-size: 11px; padding: 0 7px; margin-left: 4px; }
tr.faint td { opacity: .55; }
.orgkeys { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin: 4px 0 14px; background: var(--surface-2); }
.callout.fail ul { margin: 4px 0 0 18px; padding: 0; }
.biz-list { max-height: 220px; overflow: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 14px; font-size: 12.5px; }
.recent { display: inline-flex; gap: 2px; vertical-align: middle; }
.recent i { width: 8px; height: 12px; border-radius: 2px; display: inline-block; }
.recent i.p { background: var(--pass); } .recent i.f { background: var(--fail); }
.keycard { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; background: var(--surface); }
.keyform { border-top: 1px dashed var(--border); margin-top: 10px; padding-top: 10px; }
.org-results { max-height: 200px; overflow: auto; margin-top: 4px; }
.org-result { padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; margin-top: 4px; cursor: pointer; font-size: 13px; }
.org-result:hover { background: var(--surface-2); }
.org-result.on { border-color: var(--accent); background: var(--accent-soft); }

/* snackbar: floats over the page (stays in view while scrolling) and disappears by itself */
.toasts { position: fixed; top: 16px; right: 16px; z-index: 1000; display: flex; flex-direction: column; gap: 8px;
  width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; background: var(--surface); color: var(--fg);
  border: 1px solid var(--border-strong); border-left: 4px solid var(--pass); padding: 10px 12px; border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18); transition: opacity .3s, transform .3s; }
.toast.fail { border-left-color: var(--fail); } .toast.warn { border-left-color: var(--warn); }
.toast .msg { flex: 1; } .toast .msg ul { margin: 4px 0 0 18px; padding: 0; }
.toast .x { background: none; border: 0; color: var(--muted, inherit); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
.toast.out { opacity: 0; transform: translateX(20px); }

/* Bugs page: summary filters, triage table, details panel */
.bug-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px; margin-bottom: 14px; }
.bug-stat { text-align: left; background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--border-strong);
  border-radius: 8px; padding: 8px 12px; cursor: pointer; color: var(--fg); font: inherit; }
.bug-stat .n { display: block; font-size: 22px; font-weight: 600; line-height: 1.2; }
.bug-stat .l { display: block; font-size: 12px; color: var(--muted); }
.bug-stat:hover { border-color: var(--accent); }
.bug-stat.on { background: var(--accent-soft); border-color: var(--accent); }
.bug-stat.t-new { border-top-color: var(--fail); } .bug-stat.t-reported { border-top-color: var(--accent); }
.bug-stat.t-known, .bug-stat.t-notbug { border-top-color: var(--notrun); } .bug-stat.t-recheck { border-top-color: var(--pass); }
.bug-stat.t-flaky { border-top-color: var(--skip); }
.bug-stat.t-stale { border-top-color: var(--warn); } .bug-stat.t-regression { border-top-color: var(--fail); }
.flag { display: inline-block; padding: 0 7px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; margin-left: 4px; }
.flag-stale { background: var(--warn-soft); color: var(--warn); } .flag-regression { background: var(--fail); color: #fff; }
.bug-recheck { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.bug-recheck select { width: auto; }
.fixed-list { list-style: none; margin: 0; padding: 0; }
.fixed-list li { padding: 8px 0; border-top: 1px solid var(--border); }
.fixed-list li:first-child { border-top: 0; }
.bug-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.bug-toolbar input[type=search] { flex: 1 1 240px; min-width: 0; width: auto; }
.bug-toolbar select { width: auto; flex: 0 1 200px; min-width: 0; }
.bug-table tbody.bug + tbody.bug .bug-row td { border-top: 0; }
.bug-row { cursor: pointer; }
.bug-row:hover td, .bug-row.open td { background: var(--surface-2); }
.bug-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.bug-title { font-weight: 600; }
.chev { width: 28px; vertical-align: middle; }
.chev::before { content: ""; display: block; width: 7px; height: 7px; border: solid var(--muted); border-width: 0 2px 2px 0;
  transform: rotate(-45deg); transition: transform .15s; }
.bug-row.open .chev::before { transform: rotate(45deg); }
.bug-detail > td { background: var(--surface-2); padding: 14px 16px 18px; }
.bug-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
.bug-grid h4 { margin: 14px 0 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.bug-grid > div > h4:first-child, .bug-er h4 { margin-top: 0; }
.bug-er { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bug-er p, .bug-er .callout { margin: 0; white-space: pre-wrap; }
.bug-side { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px; align-self: start; }
.bug-side .field { margin-bottom: 10px; }
.bug-side textarea { width: 100%; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg .sev { opacity: .45; }
.seg input:checked + .sev { opacity: 1; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px currentColor; }
.seg input:focus-visible + .sev { outline: 2px solid var(--accent); }
.sev, .st { display: inline-block; padding: 1px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.sev-critical { background: var(--fail); color: #fff; } .sev-high { background: var(--fail-soft); color: var(--fail); }
.sev-medium { background: var(--warn-soft); color: var(--warn); } .sev-low { background: var(--accent-soft); color: var(--accent-ink); }
.sev-none { background: transparent; color: var(--muted); border: 1px dashed var(--border-strong); }
.st-new { background: var(--fail-soft); color: var(--fail); } .st-reported { background: var(--accent-soft); color: var(--accent-ink); }
.st-known, .st-notbug { background: var(--notrun-soft); color: var(--notrun); } .st-recheck { background: var(--pass-soft); color: var(--pass); }
.shot img { width: 180px; max-height: 120px; object-fit: cover; object-position: top; border: 1px solid var(--border); border-radius: 6px; display: block; }
.bug-activity { list-style: none; margin: 0; padding: 0; font-size: 12.5px; max-height: 220px; overflow: auto; }
.bug-activity li { padding: 6px 0; border-top: 1px solid var(--border); }
.bug-activity li:first-child { border-top: 0; }
@media (max-width: 900px) {
  .bug-grid, .bug-er { grid-template-columns: 1fr; }
  .bug-table th:nth-child(5), .bug-table .bug-row td:nth-child(5) { display: none; }
}

/* run dialog: the business of the run */
.biz-chosen { margin-top: 6px; padding: 8px 10px; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 8px; }

.biz-chosen.warn { border-color: var(--warn); background: var(--warn-soft); }

/* screen page: latest run + skipped cases */
.skips { margin: 0 0 16px; }
.skip-last { font-size: 13px; }
.skip-upload { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; margin: 6px 0 10px; }
.skip-group { border-top: 1px solid var(--border); padding: 8px 0; font-size: 13px; }
.skip-cases { margin: 6px 0 0 18px; padding: 0; } .skip-cases li { margin: 4px 0; }



.stat .n { font-variant-numeric: tabular-nums; }
td, .mini { font-variant-numeric: tabular-nums; }

/* basic flow: the project from start to finish */
fieldset.plain { border: 0; margin: 0; padding: 0; display: grid; gap: 6px; min-width: 0; }
fieldset.plain legend { padding: 0; margin-bottom: 4px; }
label.inline { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; color: var(--fg); font-size: 13.5px; margin: 0; }
.flow-title { font-size: 16px; margin: 26px 0 10px; }
.flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.flow-step { position: relative; padding: 0 0 18px 46px; }
.flow-step::before { content: ""; position: absolute; left: 15px; top: 34px; bottom: 0; width: 2px; background: var(--border); }
.flow-step:last-child::before { display: none; }
.flow-head { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 8px -46px; }
.flow-head h3 { margin: 4px 0 2px; font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--fg); }
.flow-head p { margin: 0; }
.flow-no { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  font-size: 13px; background: var(--accent-soft); color: var(--accent-ink); border: 1px solid var(--accent); }
.flow-sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.flow-sec { display: block; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--fg); }
.flow-sec:hover { border-color: var(--accent); text-decoration: none; }
.flow-fails { margin-top: 8px; } .flow-fails summary { cursor: pointer; color: var(--fail); }
.case-table td.id { width: 110px; }

/* roles: controls the signed-in role may not use are hidden (the server refuses them anyway, test_center/access.py) */
.no-edit-cases .needs-edit, .no-delete-runs .needs-delete-runs { display: none !important; }
.callout.view-only { margin: 0 0 14px; }

/* live updates (static/live.js): run chip progress, run history progress, a row that just changed */
.running-chip .chip-bar { width: 54px; height: 5px; border-radius: 4px; background: color-mix(in srgb, var(--accent) 22%, transparent); overflow: hidden; }
.running-chip .chip-bar i { display: block; height: 100%; background: var(--accent); transition: width .6s; }
.progress { height: 6px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width .6s; }
.progress.big { height: 10px; margin-top: 10px; }
.card.run-progress { margin: 0 0 14px; }
tr.is-running td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
@keyframes flash { from { background: color-mix(in srgb, var(--accent) 22%, transparent); } to { background: transparent; } }
tr.flash td { animation: flash 1.6s ease-out; }
@media (prefers-reduced-motion: reduce) { tr.flash td { animation: none; } .progress i, .running-chip .chip-bar i { transition: none; } }

/* run dialog (templates/base.html): presets first, everything else under Advanced options */
.run-modal { max-width: 720px; padding: 0; }
.run-modal > * { margin-left: 22px; margin-right: 22px; }
.run-modal .modal-head { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; margin: 0;
  padding: 18px 22px 12px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.run-modal .modal-head h2 { margin: 0; }
.run-modal .modal-foot { margin: 14px 0 0; padding: 12px 22px; border-top: 1px solid var(--border); position: sticky; bottom: 0;
  background: var(--surface); }
.run-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.run-label { display: inline-block; min-width: 92px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
#what-to-test { margin-top: 16px; } #what-to-test .run-label { display: block; margin-bottom: 8px; }
.run-line .biz-chosen { flex: 1; min-width: 240px; margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 9px; overflow: hidden; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: 6px 14px; font-size: 13px; font-weight: 600; color: var(--muted); border-right: 1px solid var(--border); }
.seg label:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--accent); color: var(--on-accent); }
.seg label.live input:checked + span { background: var(--fail); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.preset { position: relative; display: block; cursor: pointer; }
.preset input { position: absolute; opacity: 0; }
.preset > div { height: 100%; border: 1.5px solid var(--border); border-radius: 10px; padding: 11px 13px; background: var(--surface); }
.preset b { display: block; font-size: 14px; } .preset span { display: block; color: var(--muted); font-size: 12.5px; margin: 3px 0 6px; }
.preset em { font-style: normal; }
.preset input:checked + div { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.preset.data input:checked + div { border-color: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.preset input:focus-visible + div { outline: 2px solid var(--accent); outline-offset: 2px; }
.tag.warn { color: var(--warn); border-color: var(--warn); }
#run-advanced { margin-top: 14px; border: 1px solid var(--border); border-radius: 10px; padding: 0 13px; }
#run-advanced summary { cursor: pointer; padding: 10px 0; font-weight: 600; font-size: 13.5px; }
.adv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding-bottom: 12px; }
.adv-grid h3 { margin: 0 0 6px; }
label.tick { display: block; font-size: 13px; padding: 3px 0; cursor: pointer; }
label.tick .faint { font-size: 12px; } label.tick.data { color: var(--warn); }
.case-mode .adv-grid > div:not(:first-child) { display: none; }
.run-summary { margin-top: 14px; padding: 10px 13px; background: var(--surface-2); border-radius: 10px; font-size: 13px; line-height: 1.7; }
#biz-status .callout { margin: 8px 0 0; }
@media (max-width: 640px) { .presets, .adv-grid { grid-template-columns: minmax(0, 1fr); } .run-label { min-width: 0; } }

/* case editor (templates/control_edit.html): three numbered steps, a preview, actions that stay in view */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.editor-main { display: grid; gap: 14px; min-width: 0; }
.step { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; }
.step-n { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid;
  place-items: center; font-weight: 700; }
.step h2 { margin: 3px 0 4px; font-size: 16px; }
.step .field { margin-top: 10px; }
.pick-row { gap: 8px; margin-top: 8px; flex-wrap: wrap; } .pick-row select { max-width: 170px; }
.chosen-button { display: flex; gap: 12px; align-items: flex-end; margin-top: 6px; }
#btn-image img { max-height: 44px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
details.more summary { cursor: pointer; }
.editor-actions { position: sticky; bottom: 0; display: flex; gap: 8px; align-items: center; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; z-index: 3; }
.editor-preview { position: sticky; top: 76px; }
.editor-preview h3 { margin: 6px 0 10px; font-size: 15px; line-height: 1.35; }
.editor-preview ol { margin: 4px 0 10px 18px; padding: 0; font-size: 13px; } .editor-preview p { margin: 4px 0 10px; font-size: 13px; }
.pv-no { font-size: 12px; color: var(--faint); margin-top: 8px; }
.pv-label { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pv-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
@media (max-width: 1100px) { .editor { grid-template-columns: minmax(0, 1fr); } .editor-preview { position: static; } }
.editor-preview h3 { text-transform: none; letter-spacing: normal; color: var(--fg); font-weight: 650; }

/* screen page 'Skipped' panel (static/skips.js): one line, one action; confirmation inline; details folded */
.skip-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; }
.skip-sub { margin: 4px 0 0; }
.skip-confirm { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--warn); background: var(--warn-soft); border-radius: 8px; font-size: 13px; }
.skip-why { margin-top: 8px; } .skip-why summary { cursor: pointer; }

/* run dialog: documents the run needs (one line, upload offer inline) */
.run-docs { margin-top: 10px; font-size: 13px; line-height: 1.8; }
.run-docs-upload { margin-top: 2px; padding-left: 26px; }
.doc-mark { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; font-weight: 700; margin-right: 4px; }
.doc-mark.ok { background: var(--pass-soft); color: var(--pass); } .doc-mark.short { background: var(--warn-soft); color: var(--warn); }

/* Azure DevOps ticket on a bug (bugs.html, _ticket_dialog.html) */
.ticket-box { border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 12px; display: grid; gap: 4px; }
.ticket-box .pill { margin-left: 4px; }
.ticket-modal .modal-head { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; }
.ticket-modal .modal-head h2 { margin: 0 0 2px; }
.ticket-modal textarea { width: 100%; }
