/* SentinelSwarm UI. No inline styles anywhere (CSP style-src 'self'). */
:root {
  --bg: #f5f7f9; --panel: #ffffff; --ink: #14212d; --ink-2: #44525f; --muted: #5d6b78; --line: #dbe2e8; --line-2: #eef2f5;
  --brand: #14324a; --accent: #0f766e; --accent-ink: #ffffff; --focus: #2563eb;
  --ok: #166534; --ok-bg: #dcfce7; --warn: #854d0e; --warn-bg: #fef3c7; --bad: #991b1b; --bad-bg: #fee2e2; --info-bg: #e0f2fe; --info: #075985;
  --crit: #7f1d1d; --high: #b91c1c; --med: #b45309; --low: #1d4ed8; --inf: #475569;
  --radius: 10px; --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d141b; --panel: #131d27; --ink: #e6edf3; --ink-2: #c3ced8; --muted: #9aa8b5; --line: #263443; --line-2: #1a2633;
    --brand: #0b1a26; --accent: #2bb3a3; --accent-ink: #062521; --focus: #7aa7ff;
    --ok: #86efac; --ok-bg: #12321f; --warn: #fcd34d; --warn-bg: #3a2c0b; --bad: #fca5a5; --bad-bg: #3b1515; --info-bg: #0c2a3d; --info: #7dd3fc;
    --crit: #fca5a5; --high: #f87171; --med: #fbbf24; --low: #93c5fd; --inf: #cbd5e1;
  }
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: .2rem 0 1rem; }
h2 { font-size: 1.12rem; margin: 0 0 .75rem; }
h3 { font-size: .98rem; margin: 1.1rem 0 .4rem; }
p { margin: .4rem 0 .8rem; }
code, .mono, pre { font-family: var(--mono); font-size: .86rem; }
code { background: var(--line-2); padding: .1rem .35rem; border-radius: 5px; overflow-wrap: anywhere; }
pre { background: var(--line-2); border: 1px solid var(--line); border-radius: 8px; padding: .8rem; overflow: auto; max-height: 28rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--panel); padding: .5rem .8rem; z-index: 10; border-radius: 6px; }
.skip:focus { left: .5rem; }
.err { color: var(--bad); }
.wrap { overflow-wrap: anywhere; word-break: break-word; }

/* chrome */
.topbar { background: var(--brand); color: #e8f1f7; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1.25rem; flex-wrap: wrap; }
.brand { color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .01em; display: flex; align-items: center; gap: .55rem; font-size: 1.05rem; }
.brand .logo { width: 22px; height: 22px; background: url(/static/favicon.svg) center / contain no-repeat; }
.brand .wt { font-weight: 500; font-size: .72rem; color: #a9c3d6; border: 1px solid #3c5b74; border-radius: 99px; padding: 0 .45rem; }
.who { display: flex; gap: .8rem; align-items: center; font-size: .88rem; flex-wrap: wrap; }
.who .role { text-transform: capitalize; background: #23485f; border-radius: 99px; padding: 0 .45rem; margin-left: .2rem; }
.who form { margin: 0; }
.who .link { color: #cfe3f1; }
.shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); flex: 1; }
.shell.no-nav { grid-template-columns: minmax(0, 1fr); }
nav[aria-label="Main"] { border-right: 1px solid var(--line); background: var(--panel); padding: 1rem .6rem; }
nav[aria-label="Main"] ul { list-style: none; margin: 0; padding: 0; position: sticky; top: 1rem; }
nav[aria-label="Main"] a { display: block; padding: .5rem .75rem; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
nav[aria-label="Main"] a:hover { background: var(--line-2); color: var(--ink); }
nav[aria-label="Main"] a[aria-current="page"] { background: var(--info-bg); color: var(--info); font-weight: 650; }
main { padding: 1.5rem clamp(1rem, 3vw, 2.25rem) 3rem; max-width: 1120px; width: 100%; }
main.wide { max-width: 1400px; }
main:focus { outline: none; }
.foot { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .9rem 1.25rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; background: var(--panel); }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  nav[aria-label="Main"] { border-right: 0; border-bottom: 1px solid var(--line); padding: .4rem; }
  nav[aria-label="Main"] ul { display: flex; gap: .2rem; overflow-x: auto; position: static; }
  nav[aria-label="Main"] a { white-space: nowrap; }
}

/* surfaces */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.15rem 1.3rem; margin: 0 0 1.1rem; }
.grid { display: grid; gap: 1.1rem; }
.grid > .card { margin: 0; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 1.1rem; }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stat h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0; }
.big { font-size: 1.75rem; font-weight: 700; margin: .1rem 0; line-height: 1.2; }
.label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0; }
.crumbs { font-size: .88rem; color: var(--muted); margin: 0 0 .25rem; }
.titlebar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.titlebar h1 { margin-bottom: .6rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.actions form { margin: 0; }
.notice { background: var(--warn-bg); color: var(--warn); border: 1px solid currentColor; border-radius: var(--radius); padding: .7rem 1rem; margin-bottom: 1.1rem; }
.flash { border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: 1.1rem; font-weight: 500; border: 1px solid currentColor; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--bad-bg); color: var(--bad); }
.step { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: .85rem; margin-right: .4rem; }
.method { border: 1px solid var(--line); border-radius: 8px; padding: .3rem 1rem .6rem; margin-bottom: 1rem; }
.terms { max-height: 15rem; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 0 .8rem; }
.terms pre { background: none; border: 0; padding: .6rem 0; font-family: inherit; font-size: .92rem; max-height: none; }
.limits { margin: .2rem 0 1rem; }
.auth { max-width: 440px; margin: 2.5rem auto; }

/* forms */
form.stack { display: grid; gap: .9rem; }
form.inline { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
form.inline .grow { flex: 1 1 260px; }
label { display: grid; gap: .3rem; font-weight: 550; font-size: .92rem; }
label small, fieldset small { font-weight: 400; color: var(--muted); }
label.check { display: inline-flex; align-items: center; gap: .45rem; font-weight: 500; }
input, select, textarea { font: inherit; color: inherit; background: var(--panel); border: 1px solid #9aa7b4; border-radius: 8px; padding: .5rem .65rem; min-height: 2.5rem; width: 100%; }
input[type="checkbox"] { width: 1.1rem; height: 1.1rem; min-height: 0; accent-color: var(--accent); }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .9rem .8rem; margin: 0; }
legend { font-weight: 600; font-size: .92rem; padding: 0 .3rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end; }
.row label:not(.check) { width: 8rem; }
button, .button { font: inherit; font-weight: 600; font-size: .92rem; display: inline-flex; align-items: center; gap: .4rem; min-height: 2.5rem; padding: .45rem 1rem; border-radius: 8px; border: 1px solid #9aa7b4; background: var(--panel); color: var(--ink); cursor: pointer; text-decoration: none; }
button:hover, .button:hover { background: var(--line-2); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--bad); border-color: currentColor; }
button.link { border: 0; background: none; padding: 0; min-height: 0; text-decoration: underline; font-weight: 500; }
button.copy { min-height: 0; padding: .1rem .5rem; font-size: .78rem; margin-left: .4rem; vertical-align: middle; }

/* data */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom-color: var(--line); }
table.dense td { padding: .35rem .5rem; }
tr.blocked td { background: var(--warn-bg); }
table.coverage td.notes { min-width: 18rem; }
table.coverage td.stds { max-width: 10rem; }
table.coverage td:first-child { min-width: 12rem; }
tr.error td, tr.cancelled td { color: var(--muted); }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: .4rem 0 1rem; }
dl.kv.wide { grid-template-columns: 1fr; gap: .1rem; }
dl.kv.wide dd { margin-bottom: .6rem; }
dt { font-weight: 600; color: var(--ink-2); }
dd { margin: 0; overflow-wrap: anywhere; }
ul.plain { list-style: none; padding: 0; margin: .3rem 0; }
ul.plain li { padding: .3rem 0; border-bottom: 1px solid var(--line-2); }
ul.log { font-size: .86rem; color: var(--ink-2); }
ul.assets { list-style: none; padding: 0; margin: .3rem 0 .8rem; columns: 1; }
ul.assets li { padding: .25rem 0; border-bottom: 1px dashed var(--line-2); overflow-wrap: anywhere; }
details { margin: .6rem 0; }
summary { cursor: pointer; font-weight: 600; padding: .3rem 0; }
.count { display: inline-block; min-width: 1.6rem; text-align: center; background: var(--line-2); border-radius: 99px; padding: 0 .45rem; font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.checklist li { display: flex; gap: .6rem; align-items: center; }
.checklist .tick { width: 1.2rem; height: 1.2rem; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.checklist .done .tick { background: var(--ok); border-color: var(--ok); }
.checklist .done span:not(.tick) { color: var(--muted); text-decoration: line-through; }
.evidence { border-top: 1px solid var(--line); padding-top: .6rem; margin-top: .8rem; }
.evidence h3 { margin-top: .2rem; }
.meta { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }

/* badges and severity: text always carries the meaning, color only reinforces it */
.badge { display: inline-block; font-size: .76rem; font-weight: 650; letter-spacing: .02em; padding: .1rem .55rem; border-radius: 99px; background: var(--line-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.b-verified, .b-authorized, .b-confirmed, .b-completed, .b-done, .b-tested { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.b-running, .b-queued, .b-reproduced, .b-pending, .b-candidate { background: var(--info-bg); color: var(--info); border-color: transparent; }
.b-paused, .b-cancelling, .b-inconclusive, .b-skipped, .b-requires_auth, .b-requires_review, .b-fixture, .b-inferred, .b-blocked { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.b-failed, .b-cancelled, .b-error { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.sev { display: inline-block; font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; padding: .08rem .5rem; border-radius: 6px; border: 1.5px solid currentColor; }
.sev-critical { color: var(--crit); } .sev-high { color: var(--high); } .sev-medium { color: var(--med); } .sev-low { color: var(--low); } .sev-info { color: var(--inf); }
.sevrow { display: flex; gap: .35rem; flex-wrap: wrap; }

/* progress */
.meter { height: .5rem; background: var(--line-2); border-radius: 99px; overflow: hidden; margin: .35rem 0; }
.meter span { display: block; height: 100%; background: var(--accent); transition: width .4s ease; }
.w-0{width:0}.w-5{width:5%}.w-10{width:10%}.w-15{width:15%}.w-20{width:20%}.w-25{width:25%}.w-30{width:30%}.w-35{width:35%}.w-40{width:40%}.w-45{width:45%}.w-50{width:50%}.w-55{width:55%}.w-60{width:60%}.w-65{width:65%}.w-70{width:70%}.w-75{width:75%}.w-80{width:80%}.w-85{width:85%}.w-90{width:90%}.w-95{width:95%}.w-100{width:100%}
.events { list-style: none; padding: 0; margin: .4rem 0; max-height: 16rem; overflow: auto; font-size: .87rem; border: 1px solid var(--line-2); border-radius: 8px; }
.events li { padding: .35rem .6rem; border-bottom: 1px solid var(--line-2); }
.events time { font-family: var(--mono); color: var(--muted); font-size: .8rem; }
.events .agent { font-size: .75rem; color: var(--ink-2); background: var(--line-2); border-radius: 4px; padding: 0 .3rem; }
.events .lv-warn { background: var(--warn-bg); }
.events .lv-error { background: var(--bad-bg); }
.tabs ul { list-style: none; display: flex; gap: .25rem; padding: 0; margin: 0 0 -.05rem; overflow-x: auto; }
.tabs a { display: block; padding: .55rem .9rem; border-radius: 8px 8px 0 0; text-decoration: none; color: var(--ink-2); font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.tabs a[aria-current="page"] { background: var(--panel); border-color: var(--line); border-bottom-color: var(--panel); color: var(--ink); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { nav, .topbar, .actions, .foot, form { display: none !important; } .card { box-shadow: none; break-inside: avoid; } }
