/* Dormotech E2E Test Lab - colors from dormotech.com; light on white like the site by default, dark (deep green)
   when the viewer picks it with the moon button (theme.js sets <html data-theme>)
   brand #103736 (headings, primary buttons) · accent #3B8E74 · soft greens #CFE4DB / #AED7C5 · ink #1E1B19 */
:root {
  color-scheme: light;
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f6f9f8; --ink: #1e1b19; --ink-2: #2f4f4d; --muted: #5c7572;
  --line: #d9e3de; --line-strong: #c3d5cd;
  --brand: #103736; --brand-ink: #ffffff; --brand-soft: #e6f1ec; --teal: #3b8e74;
  --pass: #2f7d63; --pass-soft: #e3f1eb; --fail: #cc3366; --fail-soft: #fbe9f0; --warn: #9a6200; --warn-soft: #fbf1dc;
  --shadow: 0 1px 2px rgba(16, 55, 54, .05), 0 4px 16px rgba(16, 55, 54, .06);
  --radius: 12px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #061716; --surface: #0b2221; --surface-2: #081c1b; --ink: #e3ecea; --ink-2: #bcd3cc; --muted: #86a39d;
  --line: #17353a; --line-strong: #24484b;
  --brand: #aed7c5; --brand-ink: #053331; --brand-soft: #123a35; --teal: #5fb397;
  --pass: #7fd1ae; --pass-soft: #0f2f27; --fail: #f07ba0; --fail-soft: #3a1524; --warn: #f2c14e; --warn-soft: #33290f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .3);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 "Inter Tight", Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; }
h1 { font-size: 22px; margin: 14px 0 6px; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 14px; margin: 22px 0 4px; font-weight: 650; }
.muted { color: var(--muted); } .small { font-size: 13px; font-weight: 400; } .mono { font-family: ui-monospace, Consolas, monospace; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center;
  justify-content: space-between; padding: 10px 20px; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand picture, .signin-card picture { display: block; line-height: 0; }
.brand-logo { height: 30px; width: auto; display: block; }
.signin-logo { height: 54px; width: auto; display: block; margin: 0 auto 4px; }
.logo-dark, [data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 50%;
  background: transparent; border: 1px solid var(--line); color: var(--ink-2); }
.icon-btn:hover { background: var(--surface-2); border-color: var(--teal); }
.icon-btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.icon-sun, [data-theme="dark"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
.brand-sub { color: var(--muted); font-size: 13px; padding-left: 12px; border-left: 1px solid var(--line); }
.top-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.chip { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.who { display: flex; align-items: center; gap: 8px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.user-email { color: var(--ink-2); font-size: 13px; }

main { max-width: 1280px; margin: 0 auto; padding: 20px 20px 56px; }

/* sign in */
.signin { min-height: 70vh; display: grid; place-items: center; }
.signin-card { text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 36px 32px; max-width: 400px; width: 100%; box-shadow: var(--shadow); }
.signin-card p { margin: 0 0 22px; }

/* status strip */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.stat-note { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.dot.free { background: var(--pass); box-shadow: 0 0 0 4px var(--pass-soft); }
.dot.busy { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }

/* layout */
.layout { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
.main-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.form-panel { position: sticky; top: 70px; }
h1, h2 { color: var(--brand); }

/* recent runs: a section that opens and closes (closed by default) */
.runs-panel > summary { list-style: none; cursor: pointer; margin: 0; user-select: none; }
.runs-panel > summary::-webkit-details-marker { display: none; }
.runs-panel > summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; border-radius: 6px; }
.chev { width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .15s; margin-right: 6px; }
.runs-panel[open] .chev { transform: rotate(-135deg); }
.runs-tools { display: flex; justify-content: flex-end; margin: 6px 0 4px; }
.form-panel h2 { margin-bottom: 14px; }

/* form */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.field.two > div { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.label { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.help { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
select, input { width: 100%; min-width: 0; padding: 9px 11px; font: inherit; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line-strong); border-radius: 9px; outline: none; transition: border-color .15s, box-shadow .15s; }
select:focus, input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--brand-soft); }
.input-row { display: flex; gap: 6px; }
.readonly { padding: 8px 0; color: var(--ink-2); }
.segmented { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 3px; gap: 3px; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; text-align: center; padding: 6px 8px; border-radius: 7px; font-weight: 600; font-size: 14px; color: var(--muted); }
.segmented input:checked + span { background: var(--brand-soft); color: var(--brand); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 45%, transparent); }
.segmented input:focus-visible + span { outline: 2px solid var(--brand); }
/* landing page: one card per suite */
a.brand { color: inherit; text-decoration: none; }
.landing { max-width: 760px; margin: 0 auto; padding: 48px 0 24px; text-align: center; }
.landing h1 { font-size: 26px; margin: 0 0 6px; font-weight: 650; letter-spacing: -.02em; }
.landing > p { margin: 0 0 32px; font-size: 14px; }
.suite-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; text-align: left; }
a.suite-card { display: flex; flex-direction: column; gap: 6px; padding: 22px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s; }
a.suite-card:hover { border-color: var(--teal); transform: translateY(-1px); }
a.suite-card:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.suite-card svg { width: 26px; height: 26px; color: var(--teal); margin-bottom: 6px; }
.suite-card strong { font-size: 16px; font-weight: 650; }
.suite-card span { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.suite-card .open { margin-top: 10px; color: var(--teal); font-weight: 600; }
.suite-head { display: flex; flex-direction: column; gap: 4px; margin: 0 0 16px; }
.suite-head h1 { font-size: 22px; margin: 0; font-weight: 650; letter-spacing: -.01em; }
a.back-link { font-size: 13px; color: var(--muted); text-decoration: none; font-weight: 600; width: fit-content; }
a.back-link:hover { color: var(--teal); }
details.more { margin: 12px 0 16px; border-top: 1px solid var(--line); padding-top: 10px; }
/* the run form in three steps: what to play, where, how */
fieldset.step { border: 0; padding: 0; margin: 0 0 6px; min-width: 0; }
fieldset.step > legend { display: flex; align-items: center; gap: 8px; padding: 0; margin-bottom: 10px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
fieldset.step + fieldset.step { border-top: 1px solid var(--line); padding-top: 14px; }
.step-no { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand); font-size: 11.5px; letter-spacing: 0; }
fieldset.step > .segmented { margin-bottom: 12px; }
details.more .changed { margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--teal); }
.run-summary { margin: 0 0 12px; padding: 10px 12px; border-radius: 9px; background: var(--surface-2);
  border-left: 3px solid var(--teal); font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.run-summary strong { color: var(--ink); font-weight: 650; }
.run-summary.dry { border-left-color: var(--line-strong); }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; user-select: none; }
details.more[open] summary { margin-bottom: 10px; }

/* buttons */
button { font: inherit; cursor: pointer; border-radius: 9px; border: 1px solid transparent; padding: 9px 16px; font-weight: 600; }
button.primary { background: var(--brand); color: var(--brand-ink); }
button.primary:hover { filter: brightness(1.06); }
button.wide { width: 100%; padding: 11px 16px; }
button.ghost { background: transparent; border-color: var(--teal); color: var(--brand); }
button.ghost:hover { background: var(--surface-2); }
button.small { padding: 5px 11px; font-size: 13px; }
button.icon { padding: 6px 10px; line-height: 1; }
button.danger { color: var(--fail); border-color: color-mix(in srgb, var(--fail) 45%, transparent); }
button:disabled { opacity: .55; cursor: default; }

/* playing now */
.playing { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.playing-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.playing-head h2 { margin: 8px 0 2px; font-size: 17px; }
.playing-head p { margin: 0; font-size: 13.5px; }
.live-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--warn);
  background: var(--warn-soft); padding: 3px 10px 3px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--warn) 60%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
.progress { height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; margin: 16px 0 6px; }
.playing-list { display: flex; flex-direction: column; gap: 16px; }
.playing-list:empty { display: none; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--teal)); transition: width .6s ease; }
.progress-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.log-details { margin-top: 12px; }
pre { margin: 8px 0 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px;
  max-height: 300px; overflow: auto; font-size: 12px; line-height: 1.45; white-space: pre-wrap; }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
  padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
table.runs tbody tr { cursor: pointer; transition: background .12s; }
table.runs tbody tr:hover { background: var(--surface-2); }
table.runs tbody tr.load-head { cursor: default; background: var(--brand-soft); }
table.runs tbody tr.load-head td { font-size: 13px; font-weight: 650; color: var(--brand); }
table.runs tbody tr.load-head small { font-weight: 500; color: var(--muted); margin-left: 6px; }
table.runs tbody tr.load-member td:first-child { box-shadow: inset 3px 0 0 var(--teal); }
.when { display: flex; flex-direction: column; line-height: 1.25; } .when small { color: var(--muted); font-size: 12px; }
.patient { font-weight: 600; } .patient small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.PASS { color: var(--pass); background: var(--pass-soft); } .pill.FAIL, .pill.ERROR { color: var(--fail); background: var(--fail-soft); }
.pill.STOPPED { color: var(--warn); background: var(--warn-soft); }
.tag.fast { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.empty { text-align: center; padding: 28px 10px 18px; } .empty p { margin: 2px 0; }

/* drawer */
.scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--surface); z-index: 21;
  border-left: 1px solid var(--line); box-shadow: -10px 0 40px rgba(15, 23, 42, .18); display: flex; flex-direction: column;
  animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 8px 0 2px; font-size: 18px; } .drawer-head p { margin: 0; font-size: 13.5px; }
.drawer-body { padding: 8px 20px 28px; overflow-y: auto; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 18px; margin: 12px 0 0; font-size: 14px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; overflow-wrap: anywhere; } .facts a { color: var(--brand); }
.chart { margin: 8px 0 6px; } .chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; } .chart .axis { fill: var(--muted); font-size: 11px; }
/* expected = wide soft band, stored = crisp line on top: a match reads as "line inside the band" */
.chart .exp { fill: none; stroke: var(--teal); stroke-width: 9; stroke-opacity: .28; stroke-linejoin: round; }
.chart .sto { fill: none; stroke: var(--brand); stroke-width: 2.2; stroke-linejoin: round; }
.chart .sto.epap { opacity: .6; } .chart .exp.epap { stroke-opacity: .16; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.sw { display: inline-block; width: 18px; height: 0; border-top: 2.5px solid var(--brand); vertical-align: middle; margin-right: 6px; }
.sw.expected { border-top: 9px solid color-mix(in srgb, var(--teal) 28%, transparent); border-radius: 4px; }
.cmp-details { margin-top: 10px; }
td.ok { color: var(--pass); font-weight: 700; } td.bad { color: var(--fail); font-weight: 700; }

/* confirm dialog */
.modal { border: 1px solid var(--line); border-radius: 16px; padding: 0; width: min(440px, calc(100vw - 32px));
  background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(15, 23, 42, .3); }
.modal::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); }
.modal[open] { animation: pop .16s ease-out; }
@keyframes pop { from { transform: translateY(6px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal form { padding: 22px 22px 18px; }
.modal h2 { font-size: 18px; margin: 0 0 6px; }
.modal p { margin: 0 0 12px; font-size: 14px; }
.modal .facts { margin: 0 0 4px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.modal .facts:empty { display: none; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
button.danger-solid { background: var(--fail); color: #fff; }
[data-theme="dark"] button.danger-solid { color: #0b0f17; }

/* toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 30; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--surface); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); font-size: 14px;
  animation: slide .2s ease-out; }
.toast.err { background: var(--fail); color: #fff; } .toast.ok { background: var(--pass); color: #fff; }
[data-theme="dark"] .toast.ok, [data-theme="dark"] .toast.err { color: #0b0f17; }

/* responsive */
@media (max-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .form-panel { position: static; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  main { padding: 14px 12px 48px; }
  .topbar { padding: 10px 12px; }
  .brand-sub, .user-email { display: none; }
  .stat-value { font-size: 17px; }
}
.help.bad { color: var(--fail); }
