/* JARVIS HOME. Layout: navy sidebar and bars, pale page, white cards with a thin border, caps section labels, pill status
   chips, blue primary action. Brand: the JARVIS Ascend mark and palette (tokens.css). Colours come only from tokens.css;
   no raw hex here. No inline styles anywhere (the server CSP is style-src 'self'). Bars use <meter> or segment
   elements, icons are mask images from /assets/icons. Element selectors and classes only, no id selectors. */
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/PlusJakartaSans-Regular.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/PlusJakartaSans-Bold.woff2") format("woff2"); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 150px; scroll-padding-bottom: 24px; }
body { margin: 0; font-family: var(--jv-font-body); font-size: 14px; line-height: 1.45; background: var(--bg); color: var(--text); }
h1, h2, h3, h4 { font-family: var(--jv-font-headline); font-weight: var(--jv-headline-weight); letter-spacing: var(--jv-headline-tracking); margin: 0; }
h3 { font-size: 18px; }
p { margin: 0; }
a { color: var(--link); }
a:hover { color: var(--text); }
b { font-weight: 700; }
::selection { background: var(--jv-teal); color: var(--jv-navy); }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { min-height: var(--tap); display: inline-flex; align-items: center; position: absolute; left: -999px; top: 0; background: var(--card); color: var(--text); padding: var(--s-2) var(--s-3); z-index: 100; }
.skip:focus { left: var(--s-2); top: var(--s-2); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
button, a, input, select { transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease; }
button:hover:not(:disabled) { box-shadow: 0 0 0 3px var(--ring); }
button { font: inherit; }

/* Icons: a mask image coloured by the text colour. */
.ic { display: inline-block; width: 1.15em; height: 1.15em; flex: none; background: currentColor; vertical-align: -0.2em;
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.ic-check { --ic: url("/assets/icons/check.svg"); } .ic-alert { --ic: url("/assets/icons/alert.svg"); } .ic-clock { --ic: url("/assets/icons/clock.svg"); }
.ic-node { --ic: url("/assets/icons/node.svg"); } .ic-play { --ic: url("/assets/icons/play.svg"); } .ic-shield { --ic: url("/assets/icons/shield.svg"); }
.ic-user { --ic: url("/assets/icons/user.svg"); } .ic-x { --ic: url("/assets/icons/x.svg"); } .ic-lock { --ic: url("/assets/icons/lock.svg"); }
.ic-list { --ic: url("/assets/icons/list.svg"); } .ic-bolt { --ic: url("/assets/icons/bolt.svg"); } .ic-sun { --ic: url("/assets/icons/sun.svg"); }
.ic-moon { --ic: url("/assets/icons/moon.svg"); } .ic-arrow { --ic: url("/assets/icons/arrow.svg"); } .ic-stop { --ic: url("/assets/icons/stop.svg"); }
.ic-chat { --ic: url("/assets/icons/chat.svg"); } .ic-home { --ic: url("/assets/icons/home.svg"); }
.ic-search { --ic: url("/assets/icons/search.svg"); } .ic-menu { --ic: url("/assets/icons/menu.svg"); } .ic-chevron { --ic: url("/assets/icons/chevron.svg"); }

/* Shell: a navy top bar, the main column and the chat rail docked beside it on wide screens */
.shell { display: flex; flex-direction: column; min-height: 100vh; }
.work-row { display: flex; flex: 1 1 auto; min-width: 0; }
.main-col { flex: 1 1 0; min-width: 0; container-type: inline-size; container-name: mc; }
.main { max-width: 1560px; margin: 0 auto; padding: 24px var(--gutter) calc(40px + var(--bubble)); display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.main > * { min-width: 0; }

.top { position: sticky; top: 0; z-index: 30; background: var(--bar-bg); color: var(--bar-ink); border-bottom: 1px solid var(--bar-line); }
.top-bar { display: flex; align-items: center; gap: var(--s-4); min-height: var(--topbar-h); padding: 0 var(--gutter); max-width: 1880px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--bar-ink); text-decoration: none; flex: none; min-height: var(--tap); }
.brand h1 { font-size: 17px; letter-spacing: -0.01em; color: var(--bar-ink); white-space: nowrap; }
.logo { width: 32px; height: 32px; }
.lockup { width: 160px; height: auto; align-self: center; }
/* The sign-in lockup: navy wordmark on the light card, white wordmark on the dark card. */
:root[data-theme="dark"] .lockup-light, :root:not([data-theme="dark"]) .lockup-dark { display: none; }
.tabs { flex: 1 1 auto; min-width: 0; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: stretch; gap: var(--s-4); }
/* Flat text tabs: no card or pill, the page on screen is underlined. */
.nav-link { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 2px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; color: var(--bar-muted); font: inherit; font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.nav-link:hover { color: var(--bar-ink); }
.nav-link[aria-current] { color: var(--bar-ink); border-bottom-color: var(--bar-ink); }
.subtabs { margin: 0 0 var(--s-4); border-bottom: 1px solid var(--border); overflow-x: auto; }
.subtabs .nav-link { color: var(--text-muted); }
.subtabs .nav-link:hover { color: var(--text); }
.subtabs .nav-link[aria-current] { color: var(--text); border-bottom-color: var(--link); }
.top-tools { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; flex: none; }
.top-more { display: flex; align-items: center; gap: var(--s-2); }
.top-more .btn-nav, .top-more .btn-kill { min-height: var(--tap); }
.prefs, .emergency { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; border-top: 1px solid var(--bar-line); border-bottom: 1px solid var(--bar-line); }
.kbd { font: inherit; font-size: 11px; padding: 1px 6px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.3); color: var(--bar-muted); }
.acct { position: relative; }
.acct-menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 240px; padding: 8px; background: var(--bar-bg); border: 1px solid var(--bar-line); border-radius: var(--r-tile); box-shadow: var(--shadow-2); flex-direction: column; gap: 6px; }
.acct.open .acct-menu { display: flex; }
.viewing { padding: 10px 12px; background: var(--jv-navy-2); border-radius: 14px; display: flex; flex-direction: row; align-items: center; gap: 12px; }
.cap { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; color: var(--bar-label); }
.who-name { font-size: 14px; overflow-wrap: anywhere; }
.who-roles { font-size: 12px; color: var(--bar-muted); overflow-wrap: anywhere; }
.top-tools .menu-btn { display: none; }
.avatar { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: var(--jv-navy-3); color: var(--bar-ink); font-size: 13px; font-weight: 700; flex: none; }
.avatar-lg { width: 48px; height: 48px; font-size: 17px; }
.avatar > * { grid-area: 1 / 1; }
.av-canvas { width: 100%; height: 100%; display: block; }
.avatar.has-photo .av-initials { display: none; }
.acct-btn.avatar { width: var(--tap); height: var(--tap); background: transparent; border: 2px solid var(--bar-line); padding: 0; cursor: pointer; }
.who-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pref { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--bar-muted); }
.pref select { min-height: 36px; max-width: 150px; border-radius: var(--r-sm); border: 1px solid var(--bar-line); background: var(--jv-navy-2); color: var(--bar-ink); font: inherit; padding: 0 8px; }

/* Breadcrumbs */
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 14px; color: var(--text-muted); }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--text-muted); }
.crumbs a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; min-height: 24px; }
.crumbs a:hover { text-decoration: underline; color: var(--text); }
.crumbs [aria-current="page"] { color: var(--text); font-weight: 700; overflow-wrap: anywhere; }

/* Buttons and pills */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 22px; border-radius: var(--r-pill); border: 1px solid transparent;
  font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background: var(--action); color: var(--action-ink); }
.btn-primary:hover { color: var(--action-ink); }
.btn-ghost { background: var(--card); color: var(--link); border-color: var(--link); }
.btn-ghost:hover { color: var(--link); }
.btn-nav { min-height: 36px; padding: 0 14px; font-size: 13px; background: transparent; color: var(--jv-slate); border-color: rgba(255, 255, 255, 0.3); justify-content: flex-start; }
.btn-nav:hover { color: var(--bar-ink); }
.btn-light { min-height: 36px; padding: 0 14px; font-size: 13px; background: var(--jv-ink-on-dark); color: var(--jv-navy); }
.btn-light:hover { color: var(--jv-navy); }
.btn-small { min-height: 32px; padding: 0 14px; font-size: 13px; }
.icon-btn { width: var(--tap); height: var(--tap); border-radius: var(--r-pill); border: 1px solid rgba(255, 255, 255, 0.3); background: transparent; color: var(--bar-ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--r-pill); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; white-space: nowrap; border: 1px solid transparent; }
.pill-ok { background: var(--ok-bg); color: var(--ok-ink); }
.pill-watch { border-color: var(--text); color: var(--text); background: transparent; }
.pill-bad { background: var(--danger-bg); color: var(--danger-ink); }
.pill-run { background: var(--jv-navy); color: var(--jv-teal); }
.pill-done { background: var(--jv-teal-deep); color: var(--jv-ink-on-dark); }
.pill-needs { background: var(--card); color: var(--text); border: 2px solid var(--text); padding: 1px 7px; }
.pill-wait { background: var(--card-2); color: var(--text-muted); border-color: var(--border-strong); }
.pill-dark { background: var(--jv-navy); color: var(--jv-ink-on-dark); }
.pill-night { background: var(--action); color: var(--action-ink); }
.pill-warn { background: var(--warn-bg); color: var(--warn-ink); }

/* Page header, zone labels, cards */
.page { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; }
.head-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; min-width: 0; }
.page-title { font-size: 32px; letter-spacing: -0.02em; line-height: 1.15; }
/* The title takes focus when a page opens; keep the ring clear of the glyphs. */
.page-title:focus-visible { outline-offset: 6px; }
.head-sub { font-size: 15px; font-weight: 700; min-width: 0; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.zone { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 12px 4px 0; border-top: 1px solid var(--zone-line); margin-top: 4px; }
.zone b { font-size: 11px; letter-spacing: 0.14em; color: var(--label); }
.zone-sub { font-size: 13px; color: var(--text-muted); }
.cap-label { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; color: var(--label); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; min-width: 0; }
.card.pad { padding: var(--pad-card); }
/* A caption or note that sits directly in a table card takes the cell gutter, so it lines up with the column below. */
.table-card > .pad, .table-card > .pad-x { padding-left: var(--pad-card); padding-right: var(--pad-card); }
.table-card > .cap-label.pad { padding-top: 14px; padding-bottom: 6px; margin: 0; }
.table-card > p.pad { padding-top: 0; padding-bottom: 10px; margin: 0; }
.card > .pad-x { padding-left: var(--pad-card); padding-right: var(--pad-card); }
.card-head { padding: var(--pad-head) var(--pad-card); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 10px; }
.head-note { font-size: 13px; color: var(--text-muted); }
.notice { margin: 0; padding: 0 var(--gutter); }
.notice:empty { display: none; }
.notice.ok, .notice.error, .notice.info { margin: var(--s-3) var(--gutter) 0; padding: var(--s-3) var(--s-4); border-radius: var(--r-sm); border: 1px solid var(--border-strong); }
.notice.ok { background: var(--ok-bg); color: var(--text); }
.notice.error { background: var(--danger-bg); color: var(--danger-ink); font-weight: 700; border-color: var(--danger-ink); }
.notice.info { background: var(--card); }
.notice .retry { margin-left: var(--s-3); }
.signin { max-width: 440px; margin: var(--s-6) auto; padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); align-items: flex-start; }
.more { font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; min-height: 28px; }
.plain-list { list-style: none; padding: 0; margin: var(--s-2) 0 0; display: flex; flex-direction: column; gap: var(--s-2); }
.log-tail { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 16em; overflow: auto; font-size: 12px; border: 1px solid var(--bar-line); padding: var(--s-2); }

/* Scorecards */
.scores { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container mc (min-width: 760px) { .scores { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container mc (max-width: 560px) { .score-act { display: none; } .score { padding: 12px 12px; } .score-label { flex-wrap: wrap; gap: 4px; } .score-big { font-size: 19px; } }
.score { padding: 14px 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-tile); color: var(--text); display: flex; flex-direction: column; gap: 4px; min-width: 0; text-decoration: none; }
.score.dark { background: var(--jv-navy); color: var(--jv-ink-on-dark); border-color: var(--jv-navy); }
.score-label { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--text-muted); }
.score.dark .score-label { color: var(--bar-label); }
.score-big { font-family: var(--jv-font-headline); font-weight: 700; font-size: 22px; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.score-sub { font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere; }
.score.dark .score-sub { color: var(--jv-slate); }
meter { width: 100%; height: 8px; display: block; border: 0; background: var(--track); border-radius: var(--r-pill); margin-top: 4px; }
meter::-webkit-meter-bar { background: var(--track); border-radius: var(--r-pill); border: 0; height: 8px; }
meter::-webkit-meter-optimum-value, meter::-webkit-meter-suboptimum-value, meter::-webkit-meter-even-less-good-value { border-radius: var(--r-pill); }
meter::-webkit-meter-optimum-value { background: var(--jv-teal-deep); }
meter::-webkit-meter-suboptimum-value { background: var(--action); }
meter::-webkit-meter-even-less-good-value { background: var(--danger-ink); }
meter::-moz-meter-bar { border-radius: var(--r-pill); background: var(--jv-teal-deep); }
meter:-moz-meter-sub-optimum::-moz-meter-bar { background: var(--action); }
meter:-moz-meter-sub-sub-optimum::-moz-meter-bar { background: var(--danger-ink); }

/* Overview columns and rail */
.ov-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.ov-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ov-rail { display: flex; flex-direction: column; gap: 12px; min-width: 0; background: rgba(37, 99, 235, 0.06); border-radius: var(--r-card); padding: 12px; }
.ov-rail .card .cap-label { margin-bottom: var(--s-2); display: block; }
.ov-rail .links { display: flex; flex-direction: column; gap: 2px; }
@container mc (min-width: 1000px) {
  .ov-cols { grid-template-columns: minmax(0, 1fr) 320px; }
  .ov-rail { position: sticky; top: var(--s-4); }
}

/* Interrupt rows (Needs you now) and initiative rows */
.rows { display: flex; flex-direction: column; }
.irow { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text); }
.irow .pill { justify-self: start; }
.irow-text { min-width: 0; overflow-wrap: anywhere; }
.irow-text .sub { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.irow-act { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.irow-detail { padding: 4px 16px 16px; background: rgba(37, 99, 235, 0.035); border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--s-2); }
.irow-detail .rec { color: var(--text-muted); }
.irow-detail .question { font-weight: 700; }
.act-link { font-weight: 700; color: var(--link); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none; }
.hash { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }
.confirm-box { border: 2px solid var(--action); background: var(--card); border-radius: var(--r-tile); padding: var(--s-3) var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); }
.confirm-box dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px var(--s-3); font-size: 13px; }
.confirm-box dt { color: var(--text-muted); }
.confirm-box dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.role-note { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: var(--s-1); }
.empty { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4); color: var(--text-muted); }
.empty .ic { width: 1.6em; height: 1.6em; color: var(--ok-ink); }
.empty b { color: var(--text); display: block; }
details.grp { border-top: 1px solid var(--border); }
details.grp > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 16px; }
details.grp > summary::-webkit-details-marker { display: none; }
details.grp > summary .chev { transition: transform 0.15s ease; }
details.grp[open] > summary .chev { transform: rotate(90deg); }
details.grp > summary .pill { justify-self: start; }
.grp-title { font-weight: 700; overflow-wrap: anywhere; }
.grp-sub { display: block; font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.steps { border-top: 1px solid var(--border); background: rgba(37, 99, 235, 0.035); }
.step { display: grid; grid-template-columns: 170px minmax(0, 1fr) minmax(0, 220px); gap: 12px; align-items: center; padding: 8px 16px 8px 32px; border-top: 1px solid var(--border); font-size: 13px; }
.step:first-child { border-top: 0; }
.step-text { min-width: 0; overflow-wrap: anywhere; }
.step-meta { color: var(--text-muted); overflow-wrap: anywhere; }
.tracker { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; margin-top: 6px; max-width: 420px; }
.seg { height: 6px; border-radius: var(--r-pill); background: var(--track); }
.seg.done { background: var(--jv-teal-deep); } .seg.run { background: var(--action); } .seg.bad { background: var(--danger-ink); } .seg.block { background: var(--warn-ink); }

/* Tables */
.table-card .scroll { overflow-x: auto; max-width: 100%; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
.grid th { text-align: left; font-size: 11px; letter-spacing: 0.08em; color: var(--text-muted); padding: 8px 8px; font-weight: 700; }
.grid th:first-child, .grid td:first-child { padding-left: 16px; }
.grid th:last-child, .grid td:last-child { padding-right: 16px; }
.grid td { padding: var(--pad-cell) 8px; border-top: 1px solid var(--border); vertical-align: top; overflow-wrap: break-word; }
.grid tbody tr:hover td { background: var(--row-hover); }
.grid td a { font-weight: 700; }
.grid .num { color: var(--label); font-weight: 700; }
.grid .sub { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.grid .empty-cell { color: var(--text-muted); padding: var(--s-4); }
.grid tr.empty-row:hover td { background: transparent; }
.tag-row { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { padding: 1px 8px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); font-size: 11px; font-weight: 700; }

/* Queue page */
.qbar { background: var(--jv-navy); color: var(--jv-ink-on-dark); border-radius: var(--r-card); padding: 14px 18px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
@container mc (min-width: 1000px) { .qbar { position: sticky; top: 0; z-index: 5; } }
.qbar-main { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.qbar .cap-label { color: var(--bar-label); letter-spacing: 0.12em; }
.qbar-line { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.qbar-sub { font-size: 12px; color: var(--jv-slate); overflow-wrap: anywhere; }
.qbar-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--card); color: var(--text); font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none; }
.chip b { font-size: 15px; }
.chip[aria-pressed="true"] { background: var(--jv-navy); color: var(--jv-ink-on-dark); border-color: var(--jv-navy); }
.qlist { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-top: 6px; max-width: 260px; }
.pbar .seg.on { background: var(--action); }
.pbar .seg.full { background: var(--jv-teal-deep); }
.finish-main { font-weight: 700; }

.score { position: relative; }
.score:hover { box-shadow: 0 0 0 3px var(--ring); }
.score-act { margin-top: auto; padding-top: 6px; font-size: 12px; font-weight: 700; color: var(--link); }
.score.dark .score-act { color: var(--jv-teal); }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 24px; margin-top: 4px; }
.spark i { display: block; width: 4px; border-radius: 2px; background: var(--jv-teal-deep); }
.h0 { height: 3px; } .h1 { height: 5px; } .h2 { height: 7px; } .h3 { height: 9px; } .h4 { height: 11px; } .h5 { height: 13px; }
.h6 { height: 15px; } .h7 { height: 17px; } .h8 { height: 19px; } .h9 { height: 21px; } .h10 { height: 24px; }
.nowrap { white-space: nowrap; }
/* Builders: a usage bar is 20 segments in an outlined track, filled in the window's tone. The words beside each bar and
   its accessible name carry the same facts, so colour is never the only signal (contrast pairs in contrast.test.mjs). */
.uwin { display: grid; gap: 2px; min-width: 140px; }
.ubar { display: flex; gap: 1px; padding: 1px; height: 12px; border: 1px solid var(--text-muted); border-radius: var(--r-sm); }
.ubar i { flex: 1; border-radius: 2px; background: transparent; }
.ubar-ok i.on { background: var(--ok-ink); }
.ubar-warn i.on { background: var(--warn-ink); }
.ubar-bad i.on { background: var(--danger-ink); }
.ubar i.stop { border-left: 2px solid var(--text); }
.sub-line { display: block; }
.stale-note { color: var(--warn-ink); font-weight: 700; }
.cut-warning { border: 2px solid var(--warn-ink); background: var(--warn-bg); border-radius: var(--r-tile); padding: var(--s-3); display: flex; flex-direction: column; gap: var(--s-2); align-items: flex-start; }
.fulltext { align-self: stretch; max-height: 18rem; overflow-y: auto; background: var(--card); border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: var(--s-2) var(--s-3); font-size: 13px; }
.fulltext p { margin: 0 0 var(--s-1); overflow-wrap: anywhere; }
.act-link { min-height: 32px; display: inline-flex; align-items: center; }
.loading { display: flex; align-items: center; gap: var(--s-3); color: var(--text-muted); }
.btn-kill { min-height: 36px; padding: 0 14px; font-size: 13px; background: transparent; color: var(--kill-ink); border-color: var(--kill-ink); justify-content: flex-start; }
.btn-kill:hover { color: var(--kill-ink); }
.rail-title { font-size: 16px; margin-bottom: var(--s-2); }
.card.dark-card { background: var(--jv-navy); color: var(--jv-ink-on-dark); border-color: var(--jv-navy); }
.dark-card .muted { color: var(--jv-slate); }
.dark-card .rail-item { border-color: var(--bar-line); }
/* The run page's way back to the list: a 24 px target (WCAG 2.5.8). */
.pb-back { display: inline-flex; align-items: center; min-height: 24px; }
.foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; max-width: 1560px; margin: 0 auto; padding: 0 var(--gutter) var(--s-4); }
.hb { position: relative; width: 12px; height: 12px; border-radius: 50%; background: var(--text-muted); outline-offset: 4px; cursor: default; }
.hb-none { background: var(--text-muted); }
.hb-ok { background: var(--hb-ok); }
.hb-warn { background: var(--hb-warn); }
.hb-bad { background: var(--hb-bad); }
.hb:hover::after, .hb:focus::after { content: attr(data-tip); position: absolute; right: 0; bottom: 22px; z-index: 40; width: max-content; max-width: min(320px, 80vw); padding: 8px 10px; border-radius: var(--r-sm); background: var(--bar-bg); color: var(--bar-ink); font-size: 12px; line-height: 1.4; box-shadow: var(--shadow-2); }
.kill-state { padding: 8px 14px; border-radius: var(--r-pill); background: var(--danger-bg); color: var(--danger-ink); font-size: 13px; font-weight: 700; line-height: 1.3; }
.qbar .pill-watch, .score.dark .pill-watch { border-color: var(--jv-ink-on-dark); color: var(--jv-ink-on-dark); }
.num { font-weight: 700; color: var(--label); white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-bad td:first-child { box-shadow: inset 4px 0 0 var(--danger-ink); }
.row-warn td:first-child { box-shadow: inset 4px 0 0 var(--warn-ink); }
.irow.foot { grid-template-columns: 170px minmax(0, 1fr) auto; }
.empty.neutral .ic { color: var(--text-muted); }
.chips { padding: 0 2px; }

/* Digest, rail lists */
.digest { list-style: none; margin: 0 0 var(--s-2); padding: 0; display: flex; flex-direction: column; gap: 10px; }
.digest li { display: flex; flex-direction: column; gap: 3px; font-size: 13px; overflow-wrap: anywhere; }
.digest .when { font-size: 11px; color: var(--text-muted); }
.rail-item { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; border-top: 1px solid var(--border); font-size: 13px; overflow-wrap: anywhere; }
.rail-item:first-child { border-top: 0; }

/* Kill confirm */
.kill-confirm { position: sticky; top: 0; z-index: 19; background: var(--danger-bg); border-bottom: 2px solid var(--danger-ink); color: var(--text); }
.kill-confirm-in { padding: var(--s-3) var(--gutter); display: flex; flex-direction: column; gap: var(--s-2); }
.row { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.kill-confirm .btn-light, .kill-confirm .btn-nav { border-color: var(--text); color: var(--text); background: var(--card); }

/* Staff */
.staff { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.staff-hero { grid-column: 1 / -1; }
.staff h3 { margin-bottom: var(--s-2); }

/* Chat: the docked agent rail on wide screens, a full screen sheet below 1200 px */
.agent-rail { position: fixed; inset: 0; z-index: 60; background: var(--card); color: var(--text); display: flex; flex-direction: column; gap: 12px; padding: 16px var(--gutter) 16px; height: 100vh; height: 100dvh; }
.rail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.rail-head h2 { font-size: 20px; }
.rail-head .close-btn { border-color: var(--border-strong); color: var(--text); }
.rail-note { font-size: 13px; color: var(--text-muted); }
.thread { flex: 1 1 0; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-right: 2px; }
.msg { display: flex; flex-direction: column; gap: 4px; max-width: 92%; min-width: 0; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.jarvis { align-self: flex-start; }
.bubble { padding: 8px 12px; border-radius: 16px 16px 16px 4px; background: var(--card-2); border: 1px solid var(--border); overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 4px; }
.msg.me .bubble { background: var(--jv-navy); color: var(--jv-ink-on-dark); border-color: var(--jv-navy); border-radius: 16px 16px 4px 16px; }
.bubble p { margin: 0; }
.msg-time { font-size: 11px; color: var(--text-muted); }
.pending-dots { display: inline-flex; gap: 4px; align-items: center; }
.pending-dots i { width: 6px; height: 6px; border-radius: var(--r-pill); background: var(--text-muted); animation: pulse 1s ease-in-out infinite; }
.pending-dots i:nth-child(2) { animation-delay: 0.15s; } .pending-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes pulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.intent { border: 1px solid var(--border-strong); border-radius: var(--r-tile); background: var(--card); padding: var(--s-3); display: flex; flex-direction: column; gap: var(--s-2); }
.intent.cannot { background: var(--warn-bg); border-color: var(--warn-ink); }
.intent.confirm { border: 2px solid var(--action); }
.intent h4 { font-size: 14px; }
.intent dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px var(--s-3); font-size: 12px; }
.intent dt { color: var(--text-muted); } .intent dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick .chip { min-height: 32px; font-size: 12px; }
.chat-form { display: flex; gap: var(--s-2); }
.chat-form input { flex: 1; min-width: 0; font: inherit; padding: 0 16px; min-height: var(--tap); border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--card); color: var(--text); }
.chat-form input::placeholder { color: var(--text-muted); opacity: 1; }
/* The Access page revoke form (Admin). */
.access-form { display: grid; gap: var(--s-2); }
.access-form label { font-size: 13px; color: var(--text-muted); }
.access-form textarea, .access-form input { font: inherit; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--card); color: var(--text); }
.access-form textarea { font-family: ui-monospace, monospace; resize: vertical; }
.access-actions { display: flex; gap: var(--s-2); }
.access-plan { margin: 0; padding-left: 20px; }
.chat-form input:focus { border-color: var(--jv-teal-deep); box-shadow: 0 0 0 3px var(--ring); }
@media (min-width: 1200px) {
  .agent-rail { position: sticky; inset: auto; top: var(--topbar-h); flex: 0 0 var(--chat-w); width: var(--chat-w); height: calc(100vh - var(--topbar-h)); height: calc(100dvh - var(--topbar-h)); border-left: 1px solid var(--border); z-index: 10; }
}

/* Confirm step for approve, deny, kill and unkill: a modal, so it is in view wherever the row sat on the page. */
.modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: var(--s-3); background: var(--scrim); }
.modal-box { width: min(100%, 560px); max-height: 100%; overflow-y: auto; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-2); padding: var(--s-4) var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); }
.modal-box h2 { font-size: 20px; }
.facts { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px var(--s-3); font-size: 13px; }
.facts dt { color: var(--text-muted); font-weight: 700; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.job-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.prio-box { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.prio-label { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.ask-box { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
input.ask-input { width: 14rem; min-height: 32px; font: inherit; padding: 0 var(--s-2); border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--card); color: var(--text); }
.live-line, .q-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.q-answer { display: block; margin-top: 2px; padding: 4px var(--s-2); border-left: 3px solid var(--border-strong); }
.q-label { display: block; font-size: 11px; color: var(--text-muted); }
.q-text { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }
input.prio { width: 4rem; min-height: 32px; font: inherit; padding: 0 var(--s-2); border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--card); color: var(--text); }
.tag-bad { border-color: var(--danger-ink); color: var(--danger-ink); }

/* Narrow containers: interrupt and group rows stack, tables become cards */
@container mc (max-width: 760px) {
  .irow, .irow.foot, details.grp > summary, .step { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .step { padding-left: 16px; }
  .irow-act { justify-content: flex-start; }
  .page-title { font-size: 26px; }
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: var(--s-2) 16px; border-top: 1px solid var(--border); }
  table.stack td { border: 0; padding: 2px 0; display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: var(--s-2); }
  table.stack td:first-child, table.stack td:last-child { padding-left: 0; padding-right: 0; }
  table.stack td::before { content: attr(data-label); color: var(--text-muted); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
  table.stack td.empty-cell { display: block; }
  table.stack td.empty-cell::before { content: none; }
  table.stack tbody tr:hover td { background: transparent; }
}

/* Phone and tablet: the bar keeps the brand, Search and a menu button; the menu opens the groups, the account, the theme
   and the kill switch as one panel under the bar. */
@media (max-width: 899px) {
  .top-bar { flex-wrap: wrap; gap: 0 var(--s-2); }
  .brand h1 { font-size: 16px; }
  .top-tools .menu-btn { display: inline-flex; }
  .kbd { display: none; }
  .tabs, .top-more { display: none; }
  .menu-open .tabs { display: block; order: 3; flex: 1 0 100%; padding: 4px 0 8px; border-top: 1px solid var(--bar-line); }
  .menu-open .top-tools { display: contents; }
  .menu-open .top-more { display: flex; order: 4; flex: 1 0 100%; flex-wrap: wrap; padding: 0 0 14px; }
  .menu-open .menu-btn, .menu-open .kill-state { order: 2; }
  .menu-open .menu-btn { margin-left: auto; }
  .tabs .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .tabs .nav-link { width: 100%; }
  .acct-menu { display: flex; position: static; box-shadow: none; border: 0; padding: 0; min-width: 0; width: 100%; }
  .acct-btn.avatar { display: none; }
  .acct { flex: 1 0 100%; }
  html { scroll-padding-top: 72px; scroll-padding-bottom: 96px; }
  .main { padding-top: 16px; }
  .btn-small, .chip, .more, .act-link { min-height: var(--tap); }
  .btn-nav, .btn-kill { min-height: var(--tap); }
  .btn-ghost, .btn-primary { min-height: 48px; }
  .quick .chip { min-height: 36px; }
  .act-link { display: inline-flex; align-items: center; }
  .agent-rail { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
.notice-detail { display: block; margin-top: var(--s-1); font-size: 12px; font-weight: 400; opacity: .85; overflow-wrap: anywhere; }

/* Box work: figures from the box report ride on a scorecard as their own labelled line, never in the big number. */
.score-box { font-size: 12px; color: var(--text); border-top: 1px solid var(--border); padding-top: 6px; margin-top: 2px; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: baseline; }
.score-box.box-muted, .score-box.box-bad { color: var(--text-muted); }
.score-box-age { color: var(--text-muted); flex-basis: 100%; }
.score.dark .score-box, .score.dark .score-box-age { color: var(--jv-slate); }
.score-box-rows { list-style: none; margin: 0; padding: 0; font-size: 12px; display: grid; gap: 2px; overflow-wrap: anywhere; }
.box-sec .box-facts { display: grid; gap: 4px; margin: 6px 0 12px; }
.box-sec .box-block { margin-top: 14px; }
.box-sec .box-block h4 { margin: 0; font-size: 14px; }
.box-sec .box-block .btn { margin-top: 8px; }
/* Fleet admin (docs/fleet.md): forms, the one-time code panel. */
.fleet-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--s-3); margin-top: var(--s-3); }
.fleet-form h3, .code-panel h3 { margin: 0 0 var(--s-2); font-size: 16px; }
.field { display: grid; gap: 4px; margin: 0 0 var(--s-2); }
.field label { font-size: 13px; font-weight: 700; }
.field input, .field select { font: inherit; min-height: var(--tap); padding: 0 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--card); color: var(--text); }
.field input:focus, .field select:focus { border-color: var(--jv-teal-deep); box-shadow: 0 0 0 3px var(--ring); }
.field input[aria-invalid="true"] { border-color: var(--danger-ink); }
.form-error { min-height: 1em; margin: 0 0 var(--s-2); color: var(--danger-ink); font-size: 13px; font-weight: 700; }
.code-panel { border: 2px solid var(--text); margin-bottom: var(--s-3); }
.enroll-code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 18px; font-weight: 700; overflow-wrap: anywhere; user-select: all; }
.row-actions { display: flex; flex-wrap: wrap; gap: 4px; }

/* Planner (op-l267). Timeline bars are placed by class name on a CSS grid: no inline style, so the CSP stays strict. */
.plan-meter { display: grid; grid-template-columns: auto; gap: 2px; min-width: 9rem; }
.plan-meter-label { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.plan-meter meter, .plan-ws meter { width: 100%; height: 10px; }
.plan-meter-text { font-size: 13px; }
.plan-head h3 { margin: var(--s-2) 0; }
.plan-facts { margin: var(--s-2) 0; }
.plan-bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--s-3); margin-top: var(--s-3); }
.plan-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: var(--s-3); }
.plan-task { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.plan-task-title { font-weight: 600; flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
.plan-task-meta { flex-basis: 100%; font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere; }
.plan-sub { margin: var(--s-3) 0 0; }
.plan-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.plan-timeline .tl-head { min-width: 16rem; font-weight: 400; color: var(--text-muted); }
.tl-cell { min-width: 16rem; }
.plan-timeline tbody th { font-size: 14px; font-weight: 600; letter-spacing: normal; text-transform: none; color: var(--text); text-align: left; }
.tl-track { display: grid; position: relative; height: 14px; background: var(--card-2); border-radius: 3px; }
.tl-track > i { grid-row: 1; display: block; min-height: 14px; border-radius: 3px; }
.tl-bar { border: 1px solid var(--text); background: var(--text-muted); }
.tl-bar.tl-doing { background: var(--text); }
.tl-bar.tl-done { background: var(--jv-teal-deep); }
.tl-bar.tl-blocked { background: var(--danger-ink); }
.tl-bar.tl-dropped { background: transparent; border-style: dashed; }
.tl-bar.tl-cut { border-right-width: 3px; border-right-style: double; }
.tl-today { border-left: 2px solid var(--action); z-index: 1; }
.tl-cols-1 { grid-template-columns: repeat(1, 1fr); }
.tl-cols-2 { grid-template-columns: repeat(2, 1fr); }
.tl-cols-3 { grid-template-columns: repeat(3, 1fr); }
.tl-cols-4 { grid-template-columns: repeat(4, 1fr); }
.tl-cols-5 { grid-template-columns: repeat(5, 1fr); }
.tl-cols-6 { grid-template-columns: repeat(6, 1fr); }
.tl-cols-7 { grid-template-columns: repeat(7, 1fr); }
.tl-cols-8 { grid-template-columns: repeat(8, 1fr); }
.tl-cols-9 { grid-template-columns: repeat(9, 1fr); }
.tl-cols-10 { grid-template-columns: repeat(10, 1fr); }
.tl-cols-11 { grid-template-columns: repeat(11, 1fr); }
.tl-cols-12 { grid-template-columns: repeat(12, 1fr); }
.tl-cols-13 { grid-template-columns: repeat(13, 1fr); }
.tl-cols-14 { grid-template-columns: repeat(14, 1fr); }
.tl-cols-15 { grid-template-columns: repeat(15, 1fr); }
.tl-cols-16 { grid-template-columns: repeat(16, 1fr); }
.tl-cols-17 { grid-template-columns: repeat(17, 1fr); }
.tl-cols-18 { grid-template-columns: repeat(18, 1fr); }
.tl-cols-19 { grid-template-columns: repeat(19, 1fr); }
.tl-cols-20 { grid-template-columns: repeat(20, 1fr); }
.tl-cols-21 { grid-template-columns: repeat(21, 1fr); }
.tl-cols-22 { grid-template-columns: repeat(22, 1fr); }
.tl-cols-23 { grid-template-columns: repeat(23, 1fr); }
.tl-cols-24 { grid-template-columns: repeat(24, 1fr); }
.tl-cols-25 { grid-template-columns: repeat(25, 1fr); }
.tl-cols-26 { grid-template-columns: repeat(26, 1fr); }
.tl-cols-27 { grid-template-columns: repeat(27, 1fr); }
.tl-cols-28 { grid-template-columns: repeat(28, 1fr); }
.tl-cols-29 { grid-template-columns: repeat(29, 1fr); }
.tl-cols-30 { grid-template-columns: repeat(30, 1fr); }
.tl-cols-31 { grid-template-columns: repeat(31, 1fr); }
.tl-cols-32 { grid-template-columns: repeat(32, 1fr); }
.tl-cols-33 { grid-template-columns: repeat(33, 1fr); }
.tl-cols-34 { grid-template-columns: repeat(34, 1fr); }
.tl-cols-35 { grid-template-columns: repeat(35, 1fr); }
.tl-cols-36 { grid-template-columns: repeat(36, 1fr); }
.tl-cols-37 { grid-template-columns: repeat(37, 1fr); }
.tl-cols-38 { grid-template-columns: repeat(38, 1fr); }
.tl-cols-39 { grid-template-columns: repeat(39, 1fr); }
.tl-cols-40 { grid-template-columns: repeat(40, 1fr); }
.tl-cols-41 { grid-template-columns: repeat(41, 1fr); }
.tl-cols-42 { grid-template-columns: repeat(42, 1fr); }
.ps-1 { grid-column-start: 1; }
.ps-2 { grid-column-start: 2; }
.ps-3 { grid-column-start: 3; }
.ps-4 { grid-column-start: 4; }
.ps-5 { grid-column-start: 5; }
.ps-6 { grid-column-start: 6; }
.ps-7 { grid-column-start: 7; }
.ps-8 { grid-column-start: 8; }
.ps-9 { grid-column-start: 9; }
.ps-10 { grid-column-start: 10; }
.ps-11 { grid-column-start: 11; }
.ps-12 { grid-column-start: 12; }
.ps-13 { grid-column-start: 13; }
.ps-14 { grid-column-start: 14; }
.ps-15 { grid-column-start: 15; }
.ps-16 { grid-column-start: 16; }
.ps-17 { grid-column-start: 17; }
.ps-18 { grid-column-start: 18; }
.ps-19 { grid-column-start: 19; }
.ps-20 { grid-column-start: 20; }
.ps-21 { grid-column-start: 21; }
.ps-22 { grid-column-start: 22; }
.ps-23 { grid-column-start: 23; }
.ps-24 { grid-column-start: 24; }
.ps-25 { grid-column-start: 25; }
.ps-26 { grid-column-start: 26; }
.ps-27 { grid-column-start: 27; }
.ps-28 { grid-column-start: 28; }
.ps-29 { grid-column-start: 29; }
.ps-30 { grid-column-start: 30; }
.ps-31 { grid-column-start: 31; }
.ps-32 { grid-column-start: 32; }
.ps-33 { grid-column-start: 33; }
.ps-34 { grid-column-start: 34; }
.ps-35 { grid-column-start: 35; }
.ps-36 { grid-column-start: 36; }
.ps-37 { grid-column-start: 37; }
.ps-38 { grid-column-start: 38; }
.ps-39 { grid-column-start: 39; }
.ps-40 { grid-column-start: 40; }
.ps-41 { grid-column-start: 41; }
.ps-42 { grid-column-start: 42; }
.pe-2 { grid-column-end: 2; }
.pe-3 { grid-column-end: 3; }
.pe-4 { grid-column-end: 4; }
.pe-5 { grid-column-end: 5; }
.pe-6 { grid-column-end: 6; }
.pe-7 { grid-column-end: 7; }
.pe-8 { grid-column-end: 8; }
.pe-9 { grid-column-end: 9; }
.pe-10 { grid-column-end: 10; }
.pe-11 { grid-column-end: 11; }
.pe-12 { grid-column-end: 12; }
.pe-13 { grid-column-end: 13; }
.pe-14 { grid-column-end: 14; }
.pe-15 { grid-column-end: 15; }
.pe-16 { grid-column-end: 16; }
.pe-17 { grid-column-end: 17; }
.pe-18 { grid-column-end: 18; }
.pe-19 { grid-column-end: 19; }
.pe-20 { grid-column-end: 20; }
.pe-21 { grid-column-end: 21; }
.pe-22 { grid-column-end: 22; }
.pe-23 { grid-column-end: 23; }
.pe-24 { grid-column-end: 24; }
.pe-25 { grid-column-end: 25; }
.pe-26 { grid-column-end: 26; }
.pe-27 { grid-column-end: 27; }
.pe-28 { grid-column-end: 28; }
.pe-29 { grid-column-end: 29; }
.pe-30 { grid-column-end: 30; }
.pe-31 { grid-column-end: 31; }
.pe-32 { grid-column-end: 32; }
.pe-33 { grid-column-end: 33; }
.pe-34 { grid-column-end: 34; }
.pe-35 { grid-column-end: 35; }
.pe-36 { grid-column-end: 36; }
.pe-37 { grid-column-end: 37; }
.pe-38 { grid-column-end: 38; }
.pe-39 { grid-column-end: 39; }
.pe-40 { grid-column-end: 40; }
.pe-41 { grid-column-end: 41; }
.pe-42 { grid-column-end: 42; }
.pe-43 { grid-column-end: 43; }
.notice-detail { display: block; margin-top: var(--s-1); font-size: 12px; font-weight: 400; opacity: .85; overflow-wrap: anywhere; }

/* Chat bubble: fixed bottom right, clear of the phone's safe area; the page keeps room for it at the bottom. Hidden while
   the chat is a full screen sheet. */
.chat-bubble { position: fixed; right: calc(var(--s-4) + env(safe-area-inset-right, 0px)); bottom: calc(var(--s-4) + env(safe-area-inset-bottom, 0px)); z-index: 50;
  width: var(--bubble); height: var(--bubble); border-radius: var(--r-pill); border: 2px solid var(--bar-ink); background: var(--action); color: var(--action-ink); box-shadow: var(--shadow-2);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.chat-bubble .ic { width: 24px; height: 24px; }
.unread-dot { position: absolute; top: -2px; right: -2px; width: 16px; height: 16px; border-radius: var(--r-pill); background: var(--jv-danger-ink); border: 2px solid var(--bar-ink); }
@media (max-width: 1199px) { .chat-open .chat-bubble { display: none; } }
@media (min-width: 1200px) { .chat-open .chat-bubble { right: calc(var(--chat-w) + var(--s-4)); } }

/* Command palette */
.palette-modal { align-items: flex-start; padding-top: 12vh; }
.palette-box { width: min(100%, 640px); gap: var(--s-2); }
.palette-box input { font: inherit; font-size: 16px; min-height: 48px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--card); color: var(--text); width: 100%; }
.palette-box input::placeholder { color: var(--text-muted); opacity: 1; }
.palette-list { list-style: none; margin: 0; padding: 0; max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.pal-opt { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); min-height: var(--tap); padding: 6px 12px; border-radius: 10px; cursor: pointer; border: 2px solid transparent; }
.pal-opt:hover { background: var(--row-hover); }
.pal-opt[aria-selected="true"] { border-color: var(--focus); background: var(--row-hover); }
.pal-label { font-weight: 700; overflow-wrap: anywhere; }
.pal-hint { font-size: 12px; color: var(--text-muted); text-align: right; overflow-wrap: anywhere; }

/* Loading skeletons, and the one look for empty and failed blocks */
.skel { display: flex; flex-direction: column; gap: 10px; flex: 1 1 auto; width: 100%; min-width: 0; }
.skel-line { display: block; height: 12px; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--track) 0%, var(--card-2) 50%, var(--track) 100%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.w40 { width: 40%; } .w60 { width: 60%; } .w75 { width: 75%; } .w90 { width: 90%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.state-block { display: flex; gap: var(--s-3); align-items: flex-start; }
.state-block > .ic { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--text-muted); }
.state-block .btn { margin-top: var(--s-2); }
.state-error { border-color: var(--danger-ink); }
.state-error > .ic { color: var(--danger-ink); }

/* Relative times: the absolute local time shows on hover and on keyboard focus; Escape hides it */
.rt { position: relative; text-decoration: underline dotted; text-underline-offset: 3px; white-space: nowrap; }
.rt:is(:hover, :focus-visible):not(.rt-off)::after { content: attr(data-abs); position: absolute; left: 0; top: calc(100% + 4px); z-index: 45; padding: 4px 8px; border-radius: 8px;
  background: var(--bar-bg); color: var(--bar-ink); font-size: 12px; font-weight: 400; white-space: nowrap; box-shadow: var(--shadow-2); }

/* Lists: filter row, sortable headers, record links */
.list-tools { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); align-items: center; justify-content: space-between; }
.list-search { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; min-height: var(--tap); border: 1px solid var(--border-strong); border-radius: var(--r-pill); background: var(--card); color: var(--text-muted); }
.list-text { font: inherit; border: 0; background: transparent; color: var(--text); min-width: 12rem; min-height: 40px; border-radius: 6px; }
.list-right { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.list-sort-box { display: inline-flex; align-items: center; gap: 6px; }
.list-sort { font: inherit; min-height: var(--tap); padding: 0 10px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--card); color: var(--text); }
.sort-btn { font: inherit; font-size: inherit; font-weight: inherit; letter-spacing: inherit; color: inherit; background: transparent; border: 0; padding: 0 4px; margin: 0 -4px; min-height: var(--tap); display: inline-flex; align-items: center; gap: 4px; cursor: pointer; text-transform: inherit; }
.sort-btn:hover { color: var(--text); }
.sort-ind { font-size: 10px; min-width: 10px; }
.rec-link { font-weight: 700; color: var(--link); overflow-wrap: anywhere; }
.rec-link.plain { font-weight: 400; }

/* Overview builder cards: each builder's own meters */
.zone-more { margin-left: auto; }
.bcards { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.bcards > .state-block { grid-column: 1 / -1; }
.bcard { display: flex; flex-direction: column; gap: 8px; padding: var(--s-3) var(--s-4); background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-tile); text-decoration: none; box-shadow: var(--shadow-1); min-width: 0; }
.bcard:hover { border-color: var(--border-strong); }
.bcard.stale { border-style: dashed; }
.bcard-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.bcard-name { font-size: 16px; }
.bcard-head .pill { margin-left: auto; }
.bcard-state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bmeter { display: flex; flex-direction: column; gap: 2px; }
.bmeter-name { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }

/* Hubs and detail pages */
.hub { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.hub-tile { display: flex; flex-direction: column; gap: 6px; padding: var(--s-4); background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-tile); text-decoration: none; box-shadow: var(--shadow-1); }
.hub-tile:hover { border-color: var(--border-strong); }
.detail-grid { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
/* The one section card (kit.js card): a titled card whose parts sit one gap apart. */
.sec { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.sec h3 { margin: 0 0 var(--s-2); font-size: 15px; }
.sec h4 { font-size: 14px; margin-top: var(--s-2); }
.allow-row { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.allow { display: flex; flex-direction: column; gap: 6px; }
.stat-row { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.stat { display: flex; flex-direction: column; min-width: 96px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 12px; }
.stat b { font-size: 20px; }
.stat-bad { border-color: var(--danger-ink); }
.stat-bad b { color: var(--danger-ink); }
.job-mini li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 0; border-top: 1px solid var(--border); }
.job-mini li:first-child { border-top: 0; }
/* Azure area (azure.js). Colours only from tokens.css. */
.azure { display: flex; flex-direction: column; gap: var(--s-3); }
.az-nav { margin-top: var(--s-1); }
.az-nav .chip[aria-current="page"] { background: var(--jv-navy); color: var(--jv-ink-on-dark); border-color: var(--jv-navy); }
.az-counts, .az-strip { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.az-count { display: inline-flex; flex-direction: column; min-width: 120px; min-height: var(--tap); padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r-card); color: var(--text); text-decoration: none; }
.az-count b { font-size: 22px; }
.az-strip li { display: inline-flex; align-items: center; gap: 6px; }
.az-big { font-size: 24px; font-weight: 700; margin: 0; }
.az-bars { height: 32px; }
.az-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-2); }
.az-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; }
.az-field select, .az-field input { min-height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--card); color: var(--text); font: inherit; font-weight: 400; }
.az-metrics li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* Data visuals (viz.js): a width is one of the quantised classes, never a style attribute. */
.stackb { display: flex; height: 14px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); overflow: hidden; background: var(--track); }
.stackb i { display: block; height: 100%; flex: none; }
.w0{width:0%}.w2{width:2%}.w4{width:4%}.w6{width:6%}.w8{width:8%}
.w10{width:10%}.w12{width:12%}.w14{width:14%}.w16{width:16%}.w18{width:18%}
.w20{width:20%}.w22{width:22%}.w24{width:24%}.w26{width:26%}.w28{width:28%}
.w30{width:30%}.w32{width:32%}.w34{width:34%}.w36{width:36%}.w38{width:38%}
.w40{width:40%}.w42{width:42%}.w44{width:44%}.w46{width:46%}.w48{width:48%}
.w50{width:50%}.w52{width:52%}.w54{width:54%}.w56{width:56%}.w58{width:58%}
.w60{width:60%}.w62{width:62%}.w64{width:64%}.w66{width:66%}.w68{width:68%}
.w70{width:70%}.w72{width:72%}.w74{width:74%}.w76{width:76%}.w78{width:78%}
.w80{width:80%}.w82{width:82%}.w84{width:84%}.w86{width:86%}.w88{width:88%}
.w90{width:90%}.w92{width:92%}.w94{width:94%}.w96{width:96%}.w98{width:98%}
.w100{width:100%}
.mdl-haiku { background: var(--jv-teal-deep); } .mdl-sonnet { background: var(--link); } .mdl-opus { background: var(--jv-slate-deep); }
.mdl-other { background: var(--jv-amber); } .mdl-unknown { background: var(--text-muted); }
.stack-legend { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.capbar { width: 100%; height: 12px; }
.metric { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.trend { font-size: 12px; color: var(--text-muted); }
.trend-watch { color: var(--warn-ink); }
.stgbar { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; min-width: 0; }
.stg { color: var(--text); flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 1px; padding: 4px 3px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--card); text-align: center; font-size: 10px; line-height: 1.2; overflow: hidden; }
.stg-name { font-weight: 700; overflow-wrap: anywhere; }
.stg-state { color: var(--text-muted); }
.stg-done { background: var(--ok-bg); border-color: var(--ok-ink); }
.stg-current { background: var(--jv-teal-deep); border-color: var(--jv-teal-deep); color: var(--jv-ink-on-dark); }
.stg-current .stg-state { color: var(--jv-ink-on-dark); }
.stg-failed { background: var(--danger-bg); border-color: var(--danger-ink); }
.stg-hold, .stg-waiting { background: var(--warn-bg); border-color: var(--warn-ink); }
.stg-unknown { border-style: dashed; background: var(--card); }
.stg-todo { background: var(--card-2); }
.stackbar { min-width: 0; }
.stage-tracker { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; min-width: 0; }
.stage-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12px; }
.stage-basis { font-size: 11px; }
.score.dark .stage-basis, .score.dark .stage-banner { color: var(--jv-ink-on-dark); }
.item-pair .stage-row td { padding-top: 0; }
.score .stgbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
@container mc (max-width: 900px) { .stgbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* Overview showcase (op-l307b item 13): the headline tile is large with the spend widget beside it, the account headroom
   widget runs full width under them with one card per builder, and the rest vary in width. Small screens stack the three and keep two small tiles per row. */
.ov-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: dense; align-items: stretch; }
.scores { display: contents; }
.ov-grid > .bcards { display: flex; flex-direction: column; gap: var(--s-3); grid-column: 1 / -1; order: 3; padding: var(--pad-card); background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card); min-width: 0; }
.bcards-head { display: flex; flex-direction: column; gap: 2px; }
.head-link { text-decoration: none; color: var(--label); }
.score { order: 9; }
.score.k-overall { grid-column: 1 / -1; order: 1; }
.score.k-spend { grid-column: 1 / -1; order: 2; }
.score.k-overall .score-big { font-size: 34px; }
@container mc (min-width: 760px) {
  .ov-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .score { grid-column: span 3; }
  .score.k-overall { grid-column: span 7; }
  .score.k-spend { grid-column: span 5; }
  .ov-grid > .bcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-column: 1 / -1; align-items: start; }
  .bcards-head { grid-column: 1 / -1; }
  .score.k-clear, .score.k-success, .score.k-attention { grid-column: span 4; }
  .score.k-health { grid-column: span 6; }
}
.stgbar.mini { display: flex; gap: 2px; }
.stgbar.mini .stg { padding: 0; height: 8px; border-radius: 2px; }
.stgbar.mini .stg-name, .stgbar.mini .stg-state { display: none; }
