/* Shell, typography, controls, tables and the shared states. */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
::selection { background: var(--accent-soft); color: var(--text); }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.muted { color: var(--text-dim); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 16px; height: 16px; flex: none; vertical-align: -3px; }

.skip-link { position: absolute; left: 8px; top: -48px; z-index: 10; padding: 8px 12px; background: var(--accent); color: var(--accent-ink); border-radius: var(--radius-sm); font-weight: 600; }
.skip-link:focus { top: 8px; }

.shell-top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px;
  padding: 10px max(16px, calc((100% - 1208px) / 2)); background: var(--bg-raised); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.brand-name { font-weight: 700; letter-spacing: 0.02em; }
.brand-sub { color: var(--text-dim); font-size: 13px; }
.shell-nav { display: flex; gap: 4px; }
.shell-nav a { padding: 6px 12px; border-radius: var(--radius-sm); color: var(--text-dim); text-decoration: none; font-weight: 500; }
.shell-nav a:hover { color: var(--text); background: var(--panel-2); }
.shell-nav a[aria-current="page"] { color: var(--text); background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent); }
.theme-btn { margin-left: auto; }
.shell-main { max-width: 1240px; margin: 0 auto; padding: 24px 16px 64px; outline: none; }

.page-head { margin-bottom: 20px; }
.page-title { margin: 0; font-size: 22px; line-height: 1.25; letter-spacing: -0.01em; outline: none; overflow-wrap: anywhere; }
.page-sub { margin: 4px 0 0; color: var(--text-dim); max-width: 70ch; }
.crumbs { font-size: 13px; color: var(--text-dim); margin-bottom: 4px; overflow-wrap: anywhere; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background-color 150ms ease-out, border-color 150ms ease-out;
}
.btn:hover:not(:disabled) { border-color: var(--text-faint); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { border-color: var(--text); }
.btn-danger { background: var(--bad-soft); border-color: var(--bad); color: var(--text); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); font-weight: 500; }
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--border); }
.input { min-height: 34px; padding: 4px 8px; border-radius: var(--radius-sm); border: 1px solid var(--border-control); background: var(--inset); color: var(--text); font: inherit; }
.input-num { width: 64px; }
.inline-msg { margin: 0; color: var(--text-dim); font-size: 13px; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 7px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--panel-2); color: var(--text-dim); }
.pill .icon { width: 14px; height: 14px; }
.pill-completed, .pill-verdict-passed, .pill-th-pass { background: var(--good-soft); color: var(--good); }
.pill-failed, .pill-timed_out, .pill-verdict-failed, .pill-verdict-timed_out, .pill-th-fail { background: var(--bad-soft); color: var(--bad); }
.pill-aborted, .pill-verdict-aborted, .pill-th-pending { background: var(--warn-soft); color: var(--warn); }
.pill-live { background: var(--accent-soft); color: var(--accent); }
.pill-running .icon { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: 0.03em; color: var(--text-dim); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--panel-2); }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.runs-table tbody tr { transition: background-color 120ms ease-out; }
.runs-table tbody tr:hover { background: var(--panel-2); }
.row-link { display: flex; flex-direction: column; color: var(--text); text-decoration: none; }
.row-link:hover .run-name { text-decoration: underline; }
.run-name { font-weight: 600; }
.run-id { color: var(--text-dim); font-size: 12px; overflow-wrap: anywhere; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }

.test-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.test-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 14px 16px; border-bottom: 1px solid var(--border-soft); }
.test-item:last-child { border-bottom: 0; }
.test-main { min-width: 0; flex: 1 1 320px; }
.test-name { margin: 0; font-size: 15px; }
.test-main p { margin: 2px 0 0; overflow-wrap: anywhere; }
.run-control { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.run-control .inline-msg { flex-basis: 100%; text-align: right; }

.state { max-width: 560px; margin: 48px auto; padding: 32px; text-align: center; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.state-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.state-bad .state-icon { background: var(--bad-soft); color: var(--bad); }
.state-icon .icon { width: 22px; height: 22px; }
.state-title { margin: 14px 0 6px; font-size: 20px; outline: none; }
.state-body { margin: 0 auto 18px; color: var(--text-dim); max-width: 52ch; }
.state-detail { margin: -8px 0 18px; color: var(--text-dim); overflow-wrap: anywhere; }

.skeleton { display: grid; gap: 10px; }
.sk { border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 50%, var(--panel) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.sk-row { height: 44px; }
.sk-strip { height: 132px; border-radius: var(--radius); }
.sk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.sk-panel { height: 250px; border-radius: var(--radius); }
.sk-table { height: 160px; border-radius: var(--radius); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.attrib-tip { position: absolute; z-index: 20; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--bg-raised); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 12.5px; line-height: 1.45; pointer-events: none; }

@media (max-width: 640px) {
  /* Narrow: the nav drops to its own row so brand, identity chip and theme button never share a row they cannot fit. */
  .shell-top { gap: 4px 12px; flex-wrap: wrap; }
  .shell-nav { order: 3; flex: 1 1 100%; min-width: 0; padding: 3px 2px; overflow-x: auto; }
  .brand-sub, .theme-word { display: none; }
  .table th, .table td { padding: 9px 8px; }
  .run-id { font-size: 11px; }
  .shell-main { padding-top: 16px; }
  .table-foot { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  /* The shimmer is gone, so the hidden "Loading" word is shown: loading is still said, not only moved. */
  .skeleton > .visually-hidden { position: static; width: auto; height: auto; clip: auto; overflow: visible; font-size: 13px; color: var(--text-dim); }
}
.test-del-why { max-width: 52ch; }
.tests-announce:not(:empty) { margin-top: 6px; }
