/* The console's own layout (3 Oct 2026). Components are Primer's; this file places them and types the few things
 * that are ours (plate IDs in mono, the verdict line, the ladder's colours as text). Palette: css/tokens.css. */
html, body { height: 100%; }
body { font-family: var(--x-sans); background: var(--color-canvas-subtle); }
.brand-box { display: inline-flex; align-items: center; background: var(--x-logo-box); border-radius: 6px; padding: 5px 10px; }
.brand-box img { height: 18px; width: auto; display: block; }
.Header { background: var(--color-header-bg); border-bottom: 1px solid var(--color-border-default); padding: 10px 16px; }
.Header .breadcrumb-item { color: var(--color-fg-muted); } .Header .breadcrumb-item.mono { color: var(--color-fg-default); }
.Header .breadcrumb-item:last-child::after { display: none; }   /* no dangling slash */
/* the pills: counted filters over the list (3 Oct 2026); the chosen one is filled, the rung's colour is a dot */
.Box-row.pills { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border: 1px solid var(--color-border-default); border-radius: 999px; background: var(--color-canvas-default); color: var(--color-fg-default); font: inherit; font-size: 12.5px; line-height: 20px; white-space: nowrap; cursor: pointer; }
.pill:hover { background: var(--color-canvas-subtle); }
.pill .pc { color: var(--color-fg-muted); font-variant-numeric: tabular-nums; }
.pill[aria-pressed=true] { background: var(--color-fg-default); border-color: var(--color-fg-default); color: var(--color-canvas-default); }
.pill[aria-pressed=true] .pc { color: inherit; opacity: .75; }
.pill.red::before, .pill.magenta::before, .pill.amber::before, .pill.green::before, .pill.grey::before, .pill.waiting::before { content: ''; width: 7px; height: 7px; border-radius: 50%; }
.pill.red::before { background: var(--x-red); } .pill.magenta::before, .pill.waiting::before { background: var(--x-magenta); } .pill.amber::before { background: var(--x-amber); } .pill.green::before { background: var(--x-green); } .pill.grey::before { background: var(--x-grey); }
.Box-row.pills[hidden] { display: none; }
#owners .pill { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.pill-more { align-self: center; font-size: 12px; color: var(--color-fg-muted); }

.mono { font-family: var(--x-mono); font-size: 12.5px; letter-spacing: .3px; }
.bad { color: var(--x-red); font-weight: 600; } .warn { color: var(--x-amber); font-weight: 600; } .unk { color: var(--x-magenta); font-weight: 600; }

/* shell: rail + main */
.shell { display: grid; grid-template-columns: 68px 1fr; height: calc(100vh - 53px); }
/* the rail's own rules are css/rail.css — it is on every page now, not only this one */
.brand-mode { margin-left: 10px; font-size: 14px; font-weight: 600; color: var(--color-fg-default); }

.main { display: grid; grid-template-columns: minmax(380px, 30%) 1fr; min-height: 0; }
@media (min-width: 1500px) { .main { grid-template-columns: minmax(480px, 34%) 1fr; } }
.list { overflow-y: auto; min-height: 0; padding: 16px 0 16px 16px; }
.list .Box { border-radius: 6px; }
.listhead, .prow { display: grid; grid-template-columns: 100px 44px 1fr 124px 56px; gap: 12px; align-items: center; }
.listhead { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--color-fg-muted); padding-top: 6px; padding-bottom: 6px; }
.listhead .r { text-align: right; }
.prow { padding: 8px 16px; cursor: pointer; text-decoration: none; color: var(--color-fg-default); }
.prow:hover { background: var(--color-canvas-subtle); text-decoration: none; }
.prow.on { background: var(--color-accent-subtle); box-shadow: inset 3px 0 0 var(--color-accent-emphasis); }
.prow .plate { font-weight: 600; white-space: nowrap; }
.prow .who { font-size: 13px; color: var(--color-fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .st { white-space: nowrap; }
.prow .tempo { text-align: right; font-size: 12px; color: var(--color-fg-muted); font-variant-numeric: tabular-nums; }

.detail { overflow-y: auto; min-height: 0; padding: 16px; }
.back { display: none; align-items: center; gap: 6px; padding: 10px 12px; color: var(--color-fg-muted); font-size: 13px; }

/* the plate: one Box — head, tabs, pane */
.pimg { cursor: pointer; border-radius: 8px; } .pimg:hover { filter: brightness(1.06); } .pimg:focus-visible { outline: 2px solid var(--x-accent); outline-offset: 3px; }   /* the plate opens the dashcam (4 Oct 2026) */
.phead { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; padding: 16px; }
.pimg .agent-license-plate { width: 150px; }
.phead.noimg { grid-template-columns: 1fr auto; }   /* the admin read carries no plate venue, so no plate graphic */
#scope[hidden] { display: none; }
/* headlines as Cohere / Cursor / Anthropic set them: the sans at 400, tracked tight (3 Oct 2026) */
.pname h2 { font-size: 24px; margin: 0 0 2px; }   /* face, weight and tracking from the sitewide heading rule (4 Oct 2026) */
.pname .who { color: var(--color-fg-muted); margin: 0 0 8px; }
.pname .verdict { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.pname .verdict .line { color: var(--color-fg-muted); }
.verdict-link { text-decoration: none; } .verdict-link:hover .Label { filter: brightness(1.15); cursor: pointer; }
.pacts { display: flex; flex-direction: column; gap: 6px; }
.UnderlineNav { padding: 0 8px; }
.UnderlineNav-item .ts { display: none; }
.kv .Box-row { display: grid; grid-template-columns: 160px 1fr; gap: 12px; padding: 8px 16px; align-items: start; }   /* label stays at the first line when the value wraps */
.kv .v { min-width: 0; overflow-wrap: anywhere; }
.kv .k { color: var(--color-fg-muted); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--color-fg-muted); padding: 8px 16px; border-bottom: 1px solid var(--color-border-default); background: var(--color-canvas-subtle); }
.tbl td { padding: 8px 16px; border-bottom: 1px solid var(--color-border-muted); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--color-border-default); background: var(--color-canvas-subtle); }
.pane[hidden] { display: none; }
/* the grants editor (3 Oct 2026): the same table in edit mode — controls where the words were, one Save for the set */
.ge-tbl td { vertical-align: top; }
.ge-tbl .form-select { width: auto; }
.ge-env { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 12.5px; color: var(--color-fg-muted); }
.ge-env label { display: inline-flex; align-items: center; gap: 5px; font-weight: 400; white-space: nowrap; }
.ge-env input[type=number] { width: 78px; } .ge-env input[type=date] { width: 138px; }
.ge-kept { margin-top: 6px; font-size: 12px; color: var(--color-fg-muted); }
.ge-x { width: 36px; text-align: right; }
.ge-add { padding: 10px 16px; border-top: 1px solid var(--color-border-muted); }
.ge-add[hidden] { display: none; }
.ge-add .form-select { width: auto; }
.ge-changes { padding: 10px 16px; border-top: 1px solid var(--color-border-default); font-size: 13px; }
.ge-changes ul { margin: 6px 0 0 18px; }
.nowrap { white-space: nowrap; }
.sv-boot { display: flex; gap: 8px; align-items: flex-start; padding: 10px 16px; border-top: 1px solid var(--color-border-default); }
.sv-boot code { flex: 1; min-width: 0; font-family: var(--x-mono); font-size: 12px; overflow-wrap: anywhere; user-select: all; }
.ge-hist { border-top: 1px solid var(--color-border-default); }
.ge-hist > summary { padding: 9px 16px; cursor: pointer; font-size: 12.5px; color: var(--color-fg-muted); }
.ge-hist[open] > summary { border-bottom: 1px solid var(--color-border-muted); }
.pk-row { margin-bottom: 3px; } .pk-row:last-child { margin-bottom: 0; }
.ge-warn { margin: 6px 0 0; color: var(--x-amber); font-weight: 600; }
.pane p.note { padding: 12px 16px; margin: 0; color: var(--color-fg-muted); font-size: 12.5px; }

@media (max-width: 1100px) { .main { grid-template-columns: minmax(320px, 380px) 1fr; } }
@media (max-width: 860px) {
  /* NARROW (3 Oct 2026, Sean: "boxes don't do well on thinner devices"). Full bleed, as GitHub does on a phone:
   * the Box loses its border and radius and becomes the list; the detail is a page with a back button; the
   * header is one line. Same markup, no second layout. */
  .Header { padding: 8px 12px; gap: 8px; }
  .Header .breadcrumb { white-space: nowrap; }
  .shell { grid-template-columns: 1fr; height: auto; min-height: calc(100vh - 53px); padding-bottom: 58px; }
  .main { grid-template-columns: 1fr; }
  .main.show-detail .list { display: none; }
  .main:not(.show-detail) .detail { display: none; }
  .list { padding: 0; }
  .list .Box { border: 0; border-radius: 0; }
  .list .Box-header { border-radius: 0; position: sticky; top: 0; z-index: 2; }
  .Box-row.pills { padding: 8px 12px; }
  .listhead, .prow { grid-template-columns: 96px 40px 1fr 112px; gap: 8px; padding-left: 12px; padding-right: 12px; }
  .listhead .r, .prow .tempo { display: none; }
  .prow { padding-top: 11px; padding-bottom: 11px; }   /* ≥44px target */
  .detail { padding: 0; }
  .detail .Box { border: 0; border-radius: 0; }
  .back { display: inline-flex; }
  .phead { grid-template-columns: 1fr; gap: 12px; padding: 12px; }
  .pimg { display: none; }   /* the ID is in the breadcrumb; the graphic spends the width the verdict needs */
  .pacts { flex-direction: row; flex-wrap: wrap; }
  /* seven tabs on one line: short labels (Info · Perms · Equip · Proof · Ctrl · Cost · Use), tighter padding, and
   * only the count that is an alarm — a neutral count is on the tab's own page. If a wider face still overflows,
   * the bar scrolls sideways instead of pushing the page wide. */
  .UnderlineNav { overflow-x: auto; padding: 0 2px; scrollbar-width: none; } .UnderlineNav::-webkit-scrollbar { display: none; }
  .UnderlineNav-body { flex-wrap: nowrap; }
  .UnderlineNav-item { padding: 8px 6px; font-size: 13px; white-space: nowrap; }
  .UnderlineNav-item .tl { display: none; } .UnderlineNav-item .ts { display: inline; }
  .UnderlineNav-item .Counter { display: none; }
  .UnderlineNav-item .Counter.Counter--primary { display: inline-block; padding: 0 5px; font-size: 11px; margin-left: 4px; }
  .kv .Box-row { grid-template-columns: 104px 1fr; gap: 10px; padding: 9px 12px; }   /* two columns, as on the desk: label, value */
  .kv .k { font-size: 13px; }
  /* A WIDE TABLE IS A STACK OF CARDS (4 Oct 2026): the first cell is the card's title, the rest read "Heading value"
     on their own lines, the empty-headed action cell sits last. Six columns no longer scroll off the side. */
  .tbl th, .tbl td { padding: 8px 12px; white-space: nowrap; }   /* a narrow table stays a table and scrolls sideways in its pane */
  .tbl:has(td[data-l]) thead { display: none; }
  .tbl:has(td[data-l]), .tbl:has(td[data-l]) tbody { display: block; }
  .tbl:has(td[data-l]) tr { display: grid; grid-template-columns: 1fr; gap: 3px 10px; padding: 10px 12px; border-bottom: 1px solid var(--color-border-muted); }
  .tbl:has(td[data-l]) td { display: block; padding: 0; border: 0; white-space: normal; min-width: 0; font-size: 13px; }
  .tbl:has(td[data-l]) td:first-child { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
  .tbl td[data-l]:not([data-l=""]):not(:first-child)::before { content: attr(data-l) '  '; color: var(--color-fg-muted); font-size: 12px; }
  .tbl td[data-l=""] { margin-top: 6px; }
  .pane { overflow-x: auto; }
  .ge-tbl td { white-space: normal; }
  .rowacts { gap: 4px; }
  .acts { padding: 10px 12px; }
}
/* dialogs: Primer's Overlay on a native <dialog> (3 Oct 2026) */
dialog.Overlay { border: 0; padding: 0; margin: auto; }
dialog.Overlay::backdrop { background: rgba(0,0,0,.45); }
.pp-h { margin: 0; padding: 12px 16px 8px; border-top: 1px solid var(--color-border-default); font-size: 13px; font-weight: 600; }
.pp-venue { padding: 0 16px 14px; }
.pp-toggles { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.pp-toggles .btn[aria-pressed=true] { background: var(--color-accent-subtle); color: var(--color-accent-fg); border-color: var(--color-accent-emphasis); }
.kv .Box-row .v .form-control, .kv .Box-row .v .form-select { max-width: 520px; }
.rowacts { display: inline-flex; gap: 6px; white-space: nowrap; }
.cmd-status { font-weight: 600; margin-bottom: 8px; }
.cmd-out { margin: 8px 0 0; padding: 10px; max-height: 320px; overflow: auto; border: 1px solid var(--color-border-default); border-radius: 6px; background: var(--color-canvas-subtle); font-family: var(--x-mono); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cmd-out[hidden] { display: none; }
.fd-refs { max-height: 132px; overflow-y: auto; margin-bottom: 6px; padding: 6px 10px; border: 1px solid var(--color-border-default); border-radius: 6px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 12px; }
.fd-refs label { font-weight: 400; display: flex; gap: 6px; align-items: center; margin: 0; }
.dnote:empty { display: none; }
@media (max-width: 860px) { dialog.Overlay { width: calc(100vw - 24px); max-width: none; } .Overlay-footer { flex-wrap: wrap; } }

/* off the licence sheet (4 Oct 2026): the attention strip, remote install, the errand dialog, a verified result */
.attn { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--color-border-default); font-size: 12.5px; }
.attn[hidden] { display: none; }
.ri-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 10px 16px; }
.ri-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; min-width: 0; }
.ri-row .flex-1 { flex: 1 1 180px; }
.Overlay-body .ri-row, .Overlay-body .sv-boot, .sv-boot.flush { padding-left: 0; padding-right: 0; }
.sv-boot.flush { border-top: 0; }
.pane .ri-row + .dnote { padding: 0 16px 8px; margin: 0; }
.pp-h.first { border-top: 0; }
.er-presets, .er-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.er-row { margin: 10px 0 0; gap: 10px; }
.er-row label { font-weight: 400; font-size: 13px; }
.art-shelf { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 16px 12px; }
.art-shelf p.note { padding-left: 0; }
.art-card { max-width: 340px; padding: 8px; border: 1px solid var(--color-border-default); border-radius: 6px; background: var(--color-canvas-subtle); }
.art-card img { display: block; max-width: 100%; height: auto; border-radius: 4px; cursor: zoom-in; }
.art-line { margin: 6px 0 0; font: 11px var(--x-mono); color: var(--color-fg-muted); overflow-wrap: anywhere; }
.art-line.ok { color: var(--x-green); } .art-line.bad { color: var(--x-red); } .art-line.warn { color: var(--x-amber); }
.art-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.art-zoom { max-width: 92vw; padding: 12px; border: 1px solid var(--color-border-default); border-radius: 8px; background: var(--color-canvas-default); cursor: zoom-out; }
.art-zoom img { display: block; max-width: 88vw; max-height: 80vh; height: auto; }
@media (max-width: 860px) { .ri-row label, .ri-row .flex-1 { flex: 1 1 100%; } .ri-row { padding: 10px 12px; } }

/* the fleet list's headings sort it; the harness column wears each harness's mark (4 Oct 2026) */
.listhead button { all: unset; cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; white-space: nowrap; }
.listhead button:hover { color: var(--color-fg-default); }
.listhead button[aria-pressed=true] { color: var(--color-fg-default); } .listhead button[aria-pressed=true]::after { content: ' ▾'; } .listhead button[aria-pressed=true][data-dir=up]::after { content: ' ▴'; }
.listhead button.r { text-align: right; }
.hxs { display: inline-flex; gap: 3px; align-items: center; min-width: 0; }
.hx { width: 18px; height: 18px; flex: none; object-fit: contain; border-radius: 4px; }
.hx-l { display: inline-grid; place-items: center; border: 1px solid var(--color-border-default); font-size: 9.5px; font-weight: 700; color: var(--color-fg-muted); letter-spacing: 0; }
