:root {
  --fg:#111; --muted:#6b7280; --border:#e5e7eb; --bg:#fff;
  --radius:12px; --chip:#f3f4f6; --chip-border:#e5e7eb;
  --header-h: 0px;
}
* { box-sizing: border-box; }
html, body { height:100%; }
body {
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color:var(--fg); background:var(--bg); line-height:1.45;
  overflow:hidden;
}

header { position: sticky; top:0; background:#fff; border-bottom:1px solid var(--border); z-index: 5; }
.container { max-width: 1400px; margin: 0 auto; padding: 20px; }
h1 { font-size: 34px; letter-spacing:.2px; margin: 6px 0 14px; }

/* Header row (title + auth buttons) */
.headerRow { display:flex; align-items:center; gap:12px; justify-content:space-between; }
.signinWrap{ display:flex; align-items:center; gap:10px; }
.signinStatus{ font-size:14px; color:var(--muted); }

/* Search */
.search { display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.search input[type="search"]{ width:100%; padding:12px 14px; border:1px solid var(--border); border-radius:10px; font-size:15px; }

/* BELOW-HEADER viewport area (prevents page scroll) */
.belowHeader{ height: calc(100vh - var(--header-h)); overflow: hidden; }

/* Two-column layout that fills the viewport area */
.layout{
  display:grid;
  grid-template-columns: 400px 1fr;
  gap:16px;
  align-items:stretch;
  height: 100%;
}

/* Left list card: header | rows (scroll) | footer */
.listCard{
  background:#fff; border:1px solid var(--border); border-radius:var(--radius);
  display:grid; grid-template-rows:auto 1fr auto;
  height:100%;
  overflow:hidden;
}
.listHead{
  display:grid; grid-template-columns: 140px 1fr auto;
  gap:14px;
  padding:12px 14px; font-weight:600; border-bottom:1px solid var(--border); background:#fafafa;
}
.headActions { display:flex; align-items:center; justify-content:flex-end; }
.rows{ overflow:auto; min-height:0; -webkit-overflow-scrolling:touch; }
.row{
  display:grid; grid-template-columns: 140px 1fr; gap:14px;
  padding:14px; border-bottom:1px solid var(--border); cursor:pointer; overflow:hidden;
}
.row:hover{ background:#f9fafb; }
.ticket{ color:#111; font-weight:600; }
.title{ color:#111; }
.muted{ color:var(--muted); }
.ticket, .title{ overflow-wrap:anywhere; word-break:break-word; }

.listFooter{
  display:flex; align-items:center; gap:8px; justify-content:space-between;
  padding:10px 14px; border-top:1px solid var(--border);
  background:#fafafa; color:var(--muted); font-size:14px;
}
.listFooter .dot{ opacity:.7; }
.meta{ color:var(--muted); font-size:12px; margin-top:4px; line-height:1.25; }

/* Right details pane scrolls internally */
.pane{
  background:#fff; border:1px solid var(--border); border-radius:var(--radius); padding:18px;
  height:100%; overflow:auto;
}
.pane h2{ margin:0 0 10px; font-size:22px; }
.section{ margin-top:18px; }

.progress { display:flex; align-items:center; gap:12px; margin:6px 0 10px; }
.bar{ position:relative; height:8px; background:#eef2f7; border-radius:6px; width:100%; }
.bar > .fill{
  position:absolute; left:0; top:0; height:100%;
  width: var(--progress, 0%); /* ← width via CSS var */
  background:#3b82f6; border-radius:6px; transition: width .25s;
}

video{ width:100%; border:1px solid var(--border); border-radius:10px; background:#000; }

.chips{ display:flex; gap:8px; flex-wrap:wrap; }
.chip{ background:var(--chip); border:1px solid var(--chip-border); border-radius:999px; padding:6px 10px; font-size:14px; }

/* Traces card */
.traceCard{ background:#0b1020; color:#e5e7eb; border:1px solid #1f2937; border-radius:0; padding:14px; display:flex; flex-direction:column; gap:10px; }
.traceCard--flush { padding: 0 !important; }
.traceActions{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; width:100%; }
.traceSep{ color:#64748b; }
#traceViewerFrame, .traceFrame{ width:100%; min-height:640px; border:0; background:#0b1020; display:block; border-radius:0; }
@media (max-width: 600px) { #traceViewerFrame, .traceFrame { min-height: 200px; } }

/* Buttons */
.btn{
  display:inline-flex; align-items:center; gap:.5rem;
  padding:8px 12px; border-radius:10px; border:1px solid #2b3345;
  text-decoration:none; font-weight:600; white-space:nowrap; cursor:pointer; background:#fff;
}
.btn:hover{ filter:brightness(1.08); }
.btn-primary{ background:#1f2937; color:#fff; border-color:#334155; }
.btn-ghost{ background:transparent; color:#1f2937; border-color:#d1d5db; }
.btn-sm{ padding:6px 10px; font-size:13px; border-radius:8px; }

.traceHint{ margin-top:6px; color:#cbd5e1; font-size:13px; padding:12px; }

/* Test Steps */
.stepsPanel{ background:#0b1020; color:#fff; border:1px solid #1f2937; border-radius:12px; padding:12px; }
.stepsPanel .muted{ color:#9ca3af; }
#stepsList{ list-style:none; margin:0; padding:0; max-height:320px; overflow:auto; }
.steps li{ margin:6px 0; line-height:1.35; }
.steps .icon{ display:inline-block; width:1.25em; }
.steps .icon.ok{ color:#22c55e; } .steps .icon.fail{ color:#ef4444; } .steps .icon.info{ color:#9ca3af; }
.stepsPanel details { padding-left:.25rem; }
.stepsPanel summary { cursor:pointer; }
.steps .dur{ color:#9ca3af; }

/* HAR table */
.harWrap{ width:100%; overflow-x:hidden; }
table.har{ width:100%; border-collapse:collapse; margin-top:10px; font-size:14px; border:1px solid var(--border); border-radius:10px; overflow:hidden; table-layout: fixed; }
thead th{ text-align:left; background:#fafafa; border-bottom:1px solid var(--border); padding:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
table.har th, table.har td{ min-width:0; overflow:hidden; vertical-align:top; padding:10px; border-bottom:1px solid var(--border); }
tbody tr:last-child td{ border-bottom:none; }
.col-idx{ width:56px; } .col-method{ width:80px; } .col-status{ width:80px; }
.col-url{ width:68%; } .col-type{ width:16%; }
td.urlCell, td.typeCell{ white-space:normal !important; overflow-wrap:anywhere; word-break:break-word; }
td.methodCell, td.statusCell{ white-space:nowrap; text-overflow:ellipsis; }
td.idxCell{ white-space:nowrap; }

.pager{ display:flex; align-items:center; gap:10px; margin-top:10px; flex-wrap:wrap; }
.pager .spacer{ flex:1; min-width:8px; }
.pager button{ padding:6px 10px; border:1px solid var(--border); border-radius:8px; background:#fff; cursor:pointer; }
.pager button[disabled]{ opacity:.5; cursor:not-allowed; }
.pager .info{ color:var(--muted); font-size:13px; }
.code{ background:#0b1020; color:#e5e7eb; padding:12px; border-radius:10px; overflow:auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size:12px; border:1px solid #1f2937; white-space: pre-wrap; word-break: break-word; }
#harRaw{ max-height: 40vh; min-height: 160px; resize: vertical; overflow: auto; white-space: pre; word-break: normal; max-width: 100%; display: block; }

/* utilities */
.hidden { display: none !important; }
.link-out { color:#2563eb; text-decoration:none; }
.link-out:hover, .link-out:focus { text-decoration: underline; }
.row.is-active { background:#f3f4f6; }
.pad-12 { padding:12px; }
.mt-2 { margin-top:2px; }

/* Visually hidden but accessible */
.sr-only {
  position:absolute !important;
  width:1px; height:1px;
  padding:0; margin:-1px; overflow:hidden;
  clip:rect(0,0,0,0); white-space:nowrap; border:0;
}
