:root {
  /* Glitch palette: near-black, cyan for interaction, magenta for the
     split-colour offset, amber for what's open, teal for what's fixed. */
  --bg: #09090c;
  --dots: #17171d;
  --card: #111115;
  --ink: #ececf2;
  --muted: #8b8b99;
  --line: #24242c;
  --cyan: #4fd8ec;
  --cyan-soft: #0e2a30;
  --magenta: #d65cf0;
  --magenta-soft: #2c1233;
  --glitch-a: rgb(79 216 236 / 0.55);   /* cyan ghost */
  --glitch-b: rgb(214 92 240 / 0.55);   /* magenta ghost */
  --amber: #f2a93b;
  --amber-soft: #33240f;
  --amber-ink: #f6c06a;
  --red: #ff4f74;
  --red-soft: #3a1220;
  --green: #45e0bb;
  --green-soft: #0f2c26;
  --code: #18181e;
  --dark-button: #4fd8ec;
  --dark-button-ink: #061317;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dots) 1px, transparent 1px);
  background-size: 22px 22px;
  min-height: 100vh;
  color: var(--ink);
  font: 15px/1.5 var(--sans);
}

a { color: inherit; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.8rem max(1rem, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.brand { font-weight: 700; text-decoration: none; letter-spacing: -0.01em; }
.brand span { color: var(--muted); font-weight: 500; }
.topbar nav { display: flex; gap: 1rem; align-items: center; color: var(--muted); font-size: 0.9rem; flex-wrap: wrap; }

.page { max-width: 56rem; margin: 0 auto; padding: 2rem 1rem 4rem; }
.narrow { max-width: 26rem; }

h1 { font-size: 1.6rem; letter-spacing: -0.02em; margin: 0 0 0.3rem; }
h2 { font-size: 1.1rem; margin: 2rem 0 0.6rem; }
.lead { color: var(--muted); margin: 0 0 1.5rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
}

form { display: grid; gap: 0.9rem; }
label { display: grid; gap: 0.3rem; font-weight: 600; font-size: 0.9rem; }
label .hint { font-weight: 400; color: var(--muted); }
input, select {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  min-width: 0;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

button {
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  background: var(--dark-button);
  color: var(--dark-button-ink);
  cursor: pointer;
}
button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.danger { background: transparent; color: var(--red); border: 1px solid var(--line); }
button.link { background: none; color: inherit; padding: 0; font-weight: 500; text-decoration: underline; }
button:disabled { opacity: 0.6; cursor: progress; }

.row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: end; }
.row > label { flex: 1 1 12rem; }

.message { padding: 0.7rem 0.9rem; border-radius: 8px; margin: 0 0 1rem; }
.message.error { background: var(--red-soft); color: var(--ink); }
.message.ok { background: var(--green-soft); color: var(--ink); }
.muted { color: var(--muted); }

.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); margin: 1.2rem 0 1.5rem; overflow-x: auto; }
.tabs a {
  padding: 0.5rem 0.9rem;
  text-decoration: none;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--amber); font-weight: 600; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
td.actions { text-align: right; white-space: nowrap; }
td code, .mono { font-family: var(--mono); font-size: 0.85rem; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.steps li {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.8rem;
  align-items: start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
}
.steps .mark {
  width: 2rem; height: 2rem;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--muted);
}
.steps li.done .mark { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.steps li.next .mark { background: var(--amber-soft); border-color: var(--amber); color: var(--ink); }
.steps strong { display: block; }
.steps p { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.9rem; }
.pill {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--muted);
  margin-left: 0.4rem;
  font-weight: 500;
}

.org-list { list-style: none; padding: 0; display: grid; gap: 0.6rem; }
.org-list a {
  display: flex; justify-content: space-between; align-items: center;
  text-decoration: none; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 1rem 1.2rem;
}

@media (max-width: 600px) {
  .hide-narrow { display: none; }
  .page { padding-top: 1.25rem; }
}

/* Glitch accents (shared with the local UI). */
.brand, h1 { text-shadow: -1px 0 var(--glitch-a), 1px 0 var(--glitch-b); }
.brand { text-transform: lowercase; letter-spacing: 0.04em; }
.brand span { font-family: var(--mono); font-size: 0.85em; letter-spacing: 0.12em; }
th, .pill { font-family: var(--mono); }
.pill { letter-spacing: 0.06em; }
.card, .steps li, .org-list a { box-shadow: 0 1px 0 rgb(255 255 255 / 0.02) inset, 0 12px 32px rgb(0 0 0 / 0.45); }
.topbar { background: rgb(17 17 21 / 0.85); backdrop-filter: blur(8px); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 2; }
a { color: var(--cyan); }
.brand, .tabs a, .org-list a { color: var(--ink); }
.tabs a[aria-current="page"] { border-bottom-color: var(--cyan); box-shadow: 0 2px 0 -0px var(--glitch-b); }
button { transition: box-shadow 0.12s; }
button:not(.secondary):not(.danger):not(.link):hover { box-shadow: -2px 0 0 var(--glitch-b), 2px 0 0 var(--glitch-a); }
button.secondary:hover { border-color: var(--cyan); color: var(--cyan); }
button.danger:hover { border-color: var(--red); }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline-color: var(--cyan); }
.org-list a:hover { border-color: var(--cyan); }
.steps li.done .mark { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.steps li.next { border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); }
.message.error { background: var(--red-soft); border-left: 3px solid var(--red); }
.message.ok { background: var(--green-soft); border-left: 3px solid var(--green); }
::selection { background: var(--magenta-soft); color: var(--ink); }

/* Robots */
.kicker { display: block; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 0.15rem 0 0; }
.button-link {
  display: inline-block; font-weight: 600; text-decoration: none; border-radius: 8px; padding: 0.55rem 1rem;
  background: var(--dark-button); color: var(--dark-button-ink);
}
.button-link.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); padding: 0.45rem 0.9rem; }
.button-link:hover { box-shadow: -2px 0 0 var(--glitch-b), 2px 0 0 var(--glitch-a); }
.button-link.secondary:hover { box-shadow: none; border-color: var(--cyan); color: var(--cyan); }
.step-action { margin-top: 0.6rem; }
.empty-state p { margin: 0.3rem 0 0; }
.small { font-size: 0.82rem; }
.crumbs { margin: 0 0 0.6rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--cyan); }
.robot-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.robot-name { margin: 0; font-size: 1.4rem; text-shadow: -1px 0 var(--glitch-a), 1px 0 var(--glitch-b); }
.robot-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 760px) { .robot-layout { grid-template-columns: 1fr; } }
h3 { margin: 0 0 0.8rem; font-size: 1rem; }
.stage { position: relative; width: fit-content; max-width: 100%; margin: 0 auto; }
.stage img { display: block; max-width: 100%; max-height: 52vh; height: auto; border-radius: 10px; }
.marker {
  position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--cyan); box-shadow: 0 0 0 4px var(--cyan-soft);
}
.marker-label {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%); white-space: nowrap;
  font-family: var(--mono); font-size: 0.72rem; background: var(--card); border: 1px solid var(--line);
  border-radius: 6px; padding: 0.1rem 0.4rem; color: var(--ink);
}
.picture-tools { display: flex; justify-content: flex-end; margin-top: 0.8rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.45rem 1rem; margin: 0 0 1rem; font-size: 0.92rem; }
.facts dt { color: var(--muted); font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; padding-top: 0.15rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 0.8rem 1rem; margin: 0; min-width: 0; }
legend { font-weight: 600; font-size: 0.9rem; padding: 0 0.3rem; }
.check { display: flex; flex-direction: row; gap: 0.5rem; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 0.25rem; accent-color: var(--cyan); }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip-check { border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.8rem; align-items: center; }
.chip-check input { margin: 0; }
.questions, .followups { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.followups { padding: 0.5rem 0 0 1.6rem; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.6rem; }
.pick-card {
  display: grid; gap: 0.3rem; justify-items: center; text-align: center; font-weight: 500; font-size: 0.85rem;
  border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem; cursor: pointer; background: var(--bg);
}
.pick-card img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.pick-card input { position: absolute; opacity: 0; pointer-events: none; }
.pick-card:has(input:checked) { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
.pick-card:has(input:focus-visible) { outline: 2px solid var(--cyan); outline-offset: 2px; }
.preview { margin-top: 1rem; }
.preview-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.6rem; }
.preview pre, .notice-text {
  margin: 0; max-height: 26rem; overflow: auto; background: var(--code); border-radius: 8px; padding: 0.8rem;
  font-family: var(--mono); font-size: 0.8rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
}
.notice-text { margin-bottom: 1rem; }
input[type=file] { padding: 0.4rem; }
.pill { white-space: nowrap; }

/* Runners */
.side { display: grid; gap: 1rem; }
.runner-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.8rem; }
.runner-head, .job-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem 1rem; flex-wrap: wrap; }
.job-head { justify-content: flex-start; }
.row-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0.6rem 0; }
.status { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.status::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.4rem; background: var(--muted); vertical-align: 1px; }
.status.online::before, .status.done::before { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.status.online, .status.done { color: var(--green); }
.status.waiting::before, .status.queued::before, .status.running::before { background: var(--cyan); animation: pulse 1.2s ease-in-out infinite; }
.status.paused::before, .status.refused::before { background: var(--amber); }
.status.paused, .status.refused { color: var(--amber); }
.status.failed::before, .status.expired::before, .status.cancelled::before { background: var(--red); }
@keyframes pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .status::before { animation: none !important; } }
.job { border-top: 1px solid var(--line); padding-top: 0.8rem; margin-top: 0.8rem; }
.job p { margin: 0.3rem 0; }
.pairing .code { font-family: var(--mono); font-size: 1.8rem; letter-spacing: 0.15em; color: var(--cyan);
  text-shadow: -1px 0 var(--glitch-b), 1px 0 var(--glitch-a); margin: 0.2rem 0 1rem; }
.pairing pre, details pre { background: var(--code); border-radius: 8px; padding: 0.8rem; overflow-x: auto;
  font-family: var(--mono); font-size: 0.78rem; line-height: 1.5; }
details summary { cursor: pointer; color: var(--muted); margin: 0.8rem 0 0.4rem; }

/* Sidebar */
:root { --select: #24205a; --sidebar-w: 17rem; }
.topbar-start { display: flex; align-items: center; gap: 0.8rem; }
.menu-toggle { display: none; background: transparent; color: var(--ink); border: 1px solid var(--line); padding: 0.35rem 0.7rem; }
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: calc(100vh - 3.4rem); }
.shell > .page { width: 100%; }
.sidebar {
  position: sticky; top: calc(3.4rem + env(safe-area-inset-top, 0px)); align-self: start;
  height: calc(100vh - 3.4rem); overflow-y: auto;
  padding: 1rem 0.75rem 2rem; border-right: 1px solid var(--line); background: rgb(13 13 17 / 0.9);
}
.side-org { display: grid; gap: 0.15rem; padding: 0.3rem 0.6rem 0.9rem; border-bottom: 1px solid var(--line); margin-bottom: 0.4rem; }
.side-org strong { font-size: 1rem; text-shadow: -1px 0 var(--glitch-a), 1px 0 var(--glitch-b); }
.side-org select { font-weight: 600; }
.side-role { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.side-label { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 1.2rem 0.6rem 0.4rem; }
.side-gap { height: 0.6rem; }
.side-item {
  display: flex; align-items: center; gap: 0.8rem; padding: 0.6rem 0.75rem; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-weight: 500;
}
.side-item .icon { flex-shrink: 0; color: var(--muted); }
.side-item .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item:hover { color: var(--ink); background: var(--code); }
.side-item:hover .icon { color: var(--ink); }
.side-item[aria-current="page"] { background: var(--select); color: var(--ink); box-shadow: inset 2px 0 0 var(--cyan); }
.side-item[aria-current="page"] .icon { color: var(--ink); }
.side-item .count { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.side-robots { list-style: none; margin: 0.15rem 0 0; padding: 0; display: grid; gap: 0.1rem; }
.side-item.robot { padding-left: 1.4rem; font-size: 0.93rem; }
.side-item.add { margin-top: 0.3rem; padding-left: 1.4rem; }
.side-item.add .icon { color: var(--cyan); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--muted); opacity: 0.6; }
.dot.online { background: var(--green); opacity: 1; box-shadow: 0 0 0 3px var(--green-soft); }
.dot.offline { background: var(--amber); opacity: 1; }

@media (max-width: 760px) {
  .menu-toggle:not([hidden]) { display: inline-block; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; z-index: 3; left: 0; top: calc(3.4rem + env(safe-area-inset-top, 0px)); bottom: 0; width: min(18rem, 85vw);
    height: auto; transform: translateX(-100%); transition: transform 0.18s ease; background: var(--card);
    box-shadow: 0 12px 40px rgb(0 0 0 / 0.6);
  }
  body.menu-open .sidebar { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }
.topbar { height: 3.4rem; padding-block: 0; }
.topbar { flex-wrap: nowrap; }
@media (max-width: 760px) {
  #who, #admin-link { display: none; }
  .topbar nav { flex-wrap: nowrap; }
}

/* Robots & devices: a group that opens and closes */
.side-group-head { display: flex; align-items: center; gap: 0.15rem; }
.side-group-head > .side-item { flex: 1; min-width: 0; }
.side-toggle {
  flex-shrink: 0; display: grid; place-items: center; width: 2rem; height: 2rem; padding: 0;
  background: transparent; color: var(--muted); border-radius: 8px;
}
.side-toggle:hover { background: var(--code); color: var(--ink); box-shadow: none !important; }
.side-toggle .icon { stroke-width: 2; }
.side-toggle[aria-expanded="true"] .icon:last-child, .side-toggle[aria-expanded="false"] .icon:first-child { display: none; }
.side-group-head .side-item { padding-right: 0.4rem; }

/* Components & SBOM: hardware and software */
.components-head { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.segmented button { background: transparent; color: var(--muted); padding: 0.4rem 0.9rem; border-radius: 7px; font-weight: 600; }
.segmented button[aria-selected="true"] { background: var(--select); color: var(--ink); }
.segmented button:hover { box-shadow: none !important; color: var(--ink); }
.pill.kind-sensor { color: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 40%, var(--line)); }
.pill.kind-actuator { color: var(--magenta); border-color: color-mix(in srgb, var(--magenta) 40%, var(--line)); }
.pill.kind-compute, .pill.kind-controller { color: var(--ink); }
.pill.kind-network, .pill.kind-interface { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 40%, var(--line)); }
.add-part { margin-top: 0.8rem; }
.add-part summary { cursor: pointer; color: var(--cyan); font-weight: 600; margin-bottom: 0.6rem; }
td a { white-space: nowrap; }

/* Hardware BOM */
.bom-tools { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
.warn { color: var(--amber); font-family: var(--mono); font-size: 0.8rem; }
.report { margin: 0.5rem 0 0; padding-left: 1.2rem; font-size: 0.88rem; }
.report li { margin: 0.15rem 0; }

.shell > .page { max-width: 76rem; }
table.bom { font-size: 0.9rem; }
table.bom td, table.bom th { padding: 0.55rem 0.4rem; }
table.bom td:first-child { min-width: 12rem; }
button.remove { background: none; border: 0; padding: 0.2rem 0.3rem; color: var(--muted); font-weight: 500; font-size: 0.85rem; }
button.remove:hover { color: var(--red); box-shadow: none !important; text-decoration: underline; }

/* Overview */
:root { --sev-critical: #ff4f74; --sev-high: #f2a93b; --sev-medium: #e6d35a; --sev-low: #8b8b99; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.8rem; margin-bottom: 1rem; }
.tile { display: grid; gap: 0.2rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem;
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.45); }
.tile-label { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.tile-value { font-size: 2.1rem; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.tile-value.empty { color: var(--muted); }
.tile-sub { color: var(--muted); font-size: 0.85rem; }
.panels { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 1100px) { .panels { grid-template-columns: minmax(0, 1fr); } }
.panel h2 { margin: 0; font-size: 1rem; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.panel-empty { color: var(--muted); margin: 1.5rem 0; text-align: center; font-size: 0.92rem; }
.sev-icon.sev-critical { fill: var(--sev-critical); } .sev-icon.sev-high { fill: var(--sev-high); }
.sev-icon.sev-medium { fill: var(--sev-medium); } .sev-icon.sev-low { fill: var(--sev-low); }
.sev-chip { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; font-weight: 600; color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.1rem 0.55rem; white-space: nowrap; }
.sev-bars { display: grid; gap: 0.7rem; }
.sev-row { display: grid; grid-template-columns: 6.5rem 1fr 2.5rem; align-items: center; gap: 0.8rem; outline-offset: 4px; border-radius: 6px; }
.sev-name { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.9rem; }
.bar-track { height: 10px; background: var(--code); border-radius: 4px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.bar-fill.sev-critical { background: var(--sev-critical); } .bar-fill.sev-high { background: var(--sev-high); }
.bar-fill.sev-medium { background: var(--sev-medium); } .bar-fill.sev-low { background: var(--sev-low); }
.sev-count { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
svg.trend { width: 100%; height: auto; display: block; overflow: visible; }
svg.trend .grid { stroke: var(--line); stroke-width: 1; }
svg.trend .axis { fill: var(--muted); font: 11px var(--mono); }
svg.trend .trend-line { fill: none; stroke: var(--cyan); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg.trend .trend-area { fill: var(--cyan); opacity: 0.1; }
svg.trend .end-label { fill: var(--ink); font: 600 12px var(--sans); }
svg.trend .crosshair { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
svg.trend .trend-marker { fill: var(--cyan); stroke: var(--card); stroke-width: 2; }
svg.trend .hit { fill: transparent; outline: none; }
.chart-table { margin-top: 0.6rem; }
.chart-tooltip { position: absolute; z-index: 10; pointer-events: none; background: var(--ink); color: var(--bg);
  font-size: 0.82rem; font-weight: 500; padding: 0.35rem 0.6rem; border-radius: 6px; max-width: 20rem; box-shadow: 0 8px 24px rgb(0 0 0 / 0.5); }
.message.demo { background: var(--magenta-soft); border-left: 3px solid var(--magenta); }
.message.demo code { font-family: var(--mono); font-size: 0.85em; }
@media (max-width: 640px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .tile { padding: 0.8rem; }
  .tile-value { font-size: 1.7rem; }
}

/* Priority issues table and status chips */
.see-all { color: var(--muted); text-decoration: none; font-size: 0.88rem; }
.see-all:hover { color: var(--cyan); }
table.issues th { font-family: var(--sans); text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 0.82rem; }
table.issues tr.clickable { cursor: pointer; }
table.issues tbody tr:hover td { background: rgb(255 255 255 / 0.02); }
table.issues a { color: var(--ink); text-decoration: none; }
table.issues a.finding-link { font-weight: 600; }
table.issues a:hover { color: var(--cyan); text-decoration: underline; }
.sev-chip.tint-critical { background: color-mix(in srgb, var(--sev-critical) 14%, transparent); border-color: color-mix(in srgb, var(--sev-critical) 40%, var(--line)); }
.sev-chip.tint-high { background: color-mix(in srgb, var(--sev-high) 14%, transparent); border-color: color-mix(in srgb, var(--sev-high) 40%, var(--line)); }
.sev-chip.tint-medium { background: color-mix(in srgb, var(--sev-medium) 12%, transparent); border-color: color-mix(in srgb, var(--sev-medium) 35%, var(--line)); }
.sev-chip.tint-low { background: color-mix(in srgb, var(--sev-low) 14%, transparent); }
.sev-chip { border-radius: 6px; }
.status-chip { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; font-weight: 500; color: var(--ink);
  border-radius: 6px; padding: 0.15rem 0.55rem; white-space: nowrap; background: var(--code); }
.status-chip .dot-mark { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status-chip.bad { background: color-mix(in srgb, var(--red) 14%, transparent); } .status-chip.bad .dot-mark { background: var(--red); }
.status-chip.pending { background: color-mix(in srgb, var(--amber) 14%, transparent); } .status-chip.pending .dot-mark { background: var(--amber); }
.status-chip.good { background: color-mix(in srgb, var(--green) 14%, transparent); } .status-chip.good .dot-mark { background: var(--green); }

/* Attack path drawn on the robot */
.attack { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.2rem; align-items: center; }
@media (max-width: 1200px) and (min-width: 1101px), (max-width: 560px) { .attack { grid-template-columns: minmax(0, 1fr); } }
.path-figure { padding: 0.5rem 0 0.5rem 4.5rem; }
.path-figure:not(.has-path) { padding-left: 0; }
.path-stage { position: relative; width: min(100%, 300px); margin: 0 auto; }
.path-stage img { display: block; width: 100%; height: auto; }
.path-figure.has-path .path-stage img { filter: saturate(0.6) brightness(0.85); }
.path-overlay { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.path-overlay path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.path-glow { stroke: var(--magenta); stroke-width: 7; opacity: 0.18; }
.path-line { stroke-width: 2.5; stroke-dasharray: 6 5; animation: march 1.2s linear infinite; }
.sev-stroke-critical { stroke: var(--sev-critical); } .sev-stroke-high { stroke: var(--sev-high); }
.sev-stroke-medium { stroke: var(--sev-medium); } .sev-stroke-low { stroke: var(--sev-low); }
@keyframes march { to { stroke-dashoffset: -22; } }
@media (prefers-reduced-motion: reduce) { .path-line { animation: none; } }
.path-marker { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 0.35rem; z-index: 1; }
.path-marker .num, .path-legend .num {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  background: var(--card); border: 2px solid var(--muted); font: 700 0.75rem var(--mono); color: var(--ink);
}
.path-marker .num { box-shadow: 0 0 0 4px rgb(0 0 0 / 0.55); }
.ring-critical .num, .num.ring-critical { border-color: var(--sev-critical); }
.ring-high .num, .num.ring-high { border-color: var(--sev-high); }
.ring-medium .num, .num.ring-medium { border-color: var(--sev-medium); }
.ring-low .num, .num.ring-low { border-color: var(--sev-low); }
.stage-impact .num, .num.impact { border-color: var(--magenta); background: var(--magenta-soft); }
.path-marker.stage-impact .num { animation: halo-impact 1.8s ease-out infinite; }
@keyframes halo-impact { 0% { box-shadow: 0 0 0 0 rgb(214 92 240 / 0.6); } 100% { box-shadow: 0 0 0 12px rgb(214 92 240 / 0); } }
@media (prefers-reduced-motion: reduce) { .path-marker.stage-impact .num { animation: none; } }
.path-tag { font: 0.68rem var(--mono); background: rgb(9 9 12 / 0.85); border: 1px solid var(--line); border-radius: 5px;
  padding: 0.05rem 0.35rem; white-space: nowrap; color: var(--ink); }
.path-marker.tag-left { flex-direction: row-reverse; }
.path-origin { position: absolute; left: 0; transform: translate(calc(-100% - 0.6rem), -50%); display: inline-flex; gap: 0.35rem;
  align-items: center; font-size: 0.75rem; font-weight: 600; white-space: nowrap; color: var(--ink);
  background: var(--code); border: 1px dashed var(--muted); border-radius: 999px; padding: 0.15rem 0.55rem; }
.path-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.2rem; position: relative; }
.path-legend li { display: grid; grid-template-columns: 24px 1fr; gap: 0.7rem; align-items: start; padding: 0.45rem 0; position: relative; }
.path-legend li:not(:last-child)::before { content: ""; position: absolute; left: 11px; top: 2.2rem; bottom: -0.4rem; border-left: 2px dashed var(--line); }
.path-legend li > div { display: grid; gap: 0.15rem; }
.path-legend li a { color: var(--ink); text-decoration: none; }
.path-legend li a:hover strong { color: var(--cyan); text-decoration: underline; }
.path-legend strong { font-size: 0.9rem; line-height: 1.3; }
.path-legend .sev-chip { justify-self: start; margin-top: 0.15rem; }
.path-legend .num.origin { border-style: dashed; font-family: var(--sans); }
.path-stage-label { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.not-assessed { display: grid; gap: 0.3rem; }
.not-assessed p { margin: 0; }
.panels.stacked { grid-template-columns: minmax(0, 1fr); }
.panels.stacked .attack { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
@media (max-width: 760px) { .panels.stacked .attack { grid-template-columns: minmax(0, 1fr); } }
.panels.stacked .path-stage { width: min(100%, 360px); }
.path-marker.tag-below .path-tag, .path-marker.tag-above .path-tag { position: absolute; left: 50%; transform: translateX(-50%); }
.path-marker.tag-below .path-tag { top: calc(100% + 4px); }
.path-marker.tag-above .path-tag { bottom: calc(100% + 4px); }
.show-narrow { display: none; }
@media (max-width: 760px) {
  .show-narrow { display: inline; }
  .path-figure.has-path { padding-left: 4.2rem; }
  .path-origin { white-space: normal; max-width: 4rem; text-align: center; line-height: 1.2; border-radius: 10px;
    flex-direction: column; gap: 0.1rem; font-size: 0.7rem; }
}
table.issues a.finding-link { white-space: normal; }
