/* LapTest – test runner, tests list and report (tokens from style.css) */

.app-nav { display: flex; gap: 6px; margin-inline: auto 18px; }
.app-nav a { padding: 8px 14px; border-radius: 10px; font-size: 14px; color: rgba(255,255,255,.8); }
.app-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }

.app-main:has(.runner-page), .app-main:has(.report), .app-main:has(.tests-page) { max-width: 1180px; }

/* ---------- tests list ---------- */
.tests-page h1, .runner-page h1 { font-size: 24px; font-weight: 800; }
.access-box { margin: 14px 0 18px; padding: 14px 18px; background: #fff; border: 1px solid var(--line); border-radius: 14px; font-size: 14px; }
.access-box a { color: var(--blue); font-weight: 600; }
.new-test { display: block !important; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.new-test label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }
.new-test input[type="text"] { width: 100%; height: 48px; padding: 0 14px; font: inherit; border: 1.5px solid #d3dcec; border-radius: 12px; }
.new-test .btn { white-space: nowrap; }

/* ---------- runner layout ---------- */
.runner-head { margin-bottom: 16px; }
.runner { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
.runner-main { min-width: 0; }
.stage { min-height: 420px; padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.stage-empty { color: var(--muted); text-align: center; padding: 120px 0; }
.stage h2 { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.stage .lead { margin: 4px 0 16px; color: var(--muted); font-size: 14px; text-align: start; }
.stage .evidence-tag { display: inline-block; margin-bottom: 10px; padding: 2px 10px; font-size: 12px; border-radius: 999px; background: #eef2fa; color: var(--muted); }
.stage .msg { margin: 12px 0; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; background: #eef5ff; color: #1d4ed8; }
.stage .msg.err { background: #fff1f1; color: #9b1c1c; }
.stage .msg.ok { background: #e9f9f1; color: #0a6b45; }
.stage .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }
.stage .btn { height: 42px; padding: 0 18px; font-size: 14px; }
.stage .btn-bad { background: #fff; border-color: #f0b4b4; color: #b42318; }
.stage .btn-bad:hover { background: #fff1f1; }
.stage .btn-good { background: var(--green); color: #fff; }
.stage .btn-good:hover { background: #0a8a58; }
.stage .btn[disabled] { opacity: .45; cursor: not-allowed; }
.stage textarea, .stage input[type="text"] { width: 100%; padding: 10px 12px; font: inherit; font-size: 14px; border: 1.5px solid #d3dcec; border-radius: 10px; }
.stage .checks { display: grid; gap: 8px; margin: 10px 0; }
.stage .checks label { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.stage .verdict-box { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.stage .verdict-box h3 { font-size: 15px; margin-bottom: 8px; }

/* sidebar */
.runner-side { padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 18px; position: sticky; top: 16px; }
.runner-side h2 { font-size: 16px; margin-bottom: 10px; }
.test-list { display: grid; gap: 6px; margin-bottom: 16px; }
.test-list button {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  padding: 10px 12px; text-align: start; font: inherit; font-size: 13.5px;
  background: #f6f8fc; border: 1.5px solid transparent; border-radius: 10px; color: var(--ink);
}
.test-list button:hover:not([disabled]) { border-color: #b9d1ff; }
.test-list button.current { background: #e8f0ff; border-color: var(--blue); }
.test-list button[disabled] { opacity: .55; cursor: not-allowed; }
.test-list .tag { flex: none; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: #e3e8f2; color: var(--muted); }
.test-list .tag.pass { background: #e3f7ee; color: #0a6b45; }
.test-list .tag.warn { background: #fff4d6; color: #8a5a00; }
.test-list .tag.fail { background: #fde8e8; color: #9b1c1c; }
.test-list .tag.info { background: #e5efff; color: #1d4ed8; }
.finish-form { display: block !important; }
.finish-form .hint { margin-top: 8px; }

/* display test */
.swatch { width: 100%; height: 280px; border: 1px solid #c5d0e6; border-radius: 10px; cursor: zoom-in; }
.swatch:fullscreen { border: 0; border-radius: 0; cursor: none; height: 100%; }
.dots { display: flex; gap: 6px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: #d3dcec; }
.dots i.seen { background: var(--green); }

/* keyboard test */
.kb { display: grid; gap: 6px; direction: ltr; margin: 14px 0; padding: 12px; background: #f1f4fa; border-radius: 12px; overflow-x: auto; }
.kb-row { display: flex; gap: 6px; }
.kb .key {
  flex: 1 1 0; min-width: 34px; height: 40px; display: grid; place-items: center;
  font-size: 11px; border: 1px solid #c5d0e6; border-radius: 7px; background: #fff; color: #44506b; user-select: none;
}
.kb .key.opt { background: #f6f8fc; color: #8c97ae; border-style: dashed; }
.kb .key.hit { background: #19a974; border-color: #19a974; color: #fff; }
.kb .spacer { flex: 0.5 1 0; }

/* pointer test */
.pointer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0; }
.zone { min-height: 150px; padding: 14px; display: grid; place-items: center; text-align: center; font-size: 13.5px; background: #f6f8fc; border: 2px dashed #c5d0e6; border-radius: 14px; user-select: none; }
.zone.hot { border-color: var(--blue); background: #eef5ff; }
.zone.scroll { overflow-y: scroll; display: block; height: 150px; }
.zone.scroll div { height: 600px; padding-top: 50px; background: linear-gradient(#f6f8fc, #dbe5f7); text-align: center; }
.checklist { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.checklist span { padding: 4px 12px; font-size: 12.5px; border-radius: 999px; background: #eef2fa; color: var(--muted); }
.checklist span.done { background: #e3f7ee; color: #0a6b45; }

/* mic meter, webcam, perf */
.meter { height: 16px; border-radius: 8px; background: #e3e8f2; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: #19a974; transition: width .08s; }
.video-box { width: 100%; max-width: 560px; aspect-ratio: 16 / 9; background: #0b1220; border-radius: 12px; overflow: hidden; }
.video-box video { width: 100%; height: 100%; object-fit: cover; }
.gl-box { width: 100%; max-width: 560px; aspect-ratio: 16 / 9; border-radius: 12px; background: #0b1220; display: block; }
.kvlist { display: grid; gap: 6px; margin: 12px 0; font-size: 13.5px; }
.kvlist div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; background: #f6f8fc; border-radius: 8px; }
.port-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 10px 0; }
.port-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); }
.port-table label { margin-inline-end: 14px; white-space: nowrap; }

/* ---------- report ---------- */
.report { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.report-head h1 { font-size: 24px; font-weight: 800; }
.verdict { min-width: 150px; padding: 14px 20px; border-radius: 14px; text-align: center; }
.verdict small { display: block; font-size: 12px; opacity: .8; }
.verdict strong { font-size: 20px; }
.verdict-pass { background: #e3f7ee; color: #0a6b45; }
.verdict-warn { background: #fff4d6; color: #8a5a00; }
.verdict-fail { background: #fde8e8; color: #9b1c1c; }
.verdict-none { background: #eef2fa; color: var(--muted); }
.report-note { margin: 14px 0 6px; color: var(--muted); font-size: 14px; }
.report-group { margin-top: 22px; }
.report-group h2 { font-size: 17px; margin-bottom: 8px; }
.chip { display: inline-block; padding: 2px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip-pass { background: #e3f7ee; color: #0a6b45; }
.chip-warn { background: #fff4d6; color: #8a5a00; }
.chip-fail { background: #fde8e8; color: #9b1c1c; }
.chip-info { background: #e5efff; color: #1d4ed8; }
.chip-skipped, .chip-pending { background: #eef2fa; color: var(--muted); }
.details { font-size: 13px; line-height: 1.9; }
.details .kv span { color: var(--muted); }
.report-foot { margin-top: 26px; padding-top: 18px; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--muted); line-height: 2; }
.report-actions { display: flex; gap: 10px; margin-top: 14px; }

@media (max-width: 960px) {
  .runner { grid-template-columns: 1fr; }
  .runner-side { position: static; order: -1; }
  .pointer-grid { grid-template-columns: 1fr; }
}

@media print {
  .app-header, .report-actions, .alert { display: none !important; }
  .app-body { background: #fff; }
  .report { border: 0; padding: 0; }
  .table-wrap { overflow: visible; border-color: #bbb; }
  .report-group { break-inside: avoid; }
}

.check-line { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 14px; }

.agent-steps { margin: 12px 0; padding-inline-start: 22px; list-style: decimal; line-height: 2; font-size: 14px; }
