/*
 * NWX COMMAND CENTRE — the staff console.
 *
 * One file, no framework, no external fonts (the page's CSP loads only itself).
 *
 * ────────────────────────────────────────────────────────────────────────────
 * THE SAME SYSTEM AS THE SUPPORT PAGES
 * ────────────────────────────────────────────────────────────────────────────
 *
 * This used to be its own look: a teal wash, boxed panels, and small uppercase monospace
 * labels over everything. It read as an admin panel — the kind of surface that announces
 * it is internal — while the support pages beside it were white, spacious and quiet. Two
 * designs for one product, and the internal one was the louder of the two.
 *
 * So the tokens here are the support stylesheet's tokens (`packages/web/src/pinto.css`),
 * value for value: the same near-black ink, the same single cool grey, the same hairline.
 * Change one there and it should be changed here, deliberately, rather than drifting.
 *
 * Where the two differ, they differ for a reason:
 *
 *   TYPE IS 15px, NOT 17px. Support is one column of prose for somebody reading an answer.
 *   This is tables, queues and counts, read by somebody scanning. The tracking and the
 *   line height are the support page's; only the size steps down.
 *
 *   COLOUR STILL ARRIVES TWICE. On support the accent is the send button and the focus
 *   ring, and nothing else. Here it is the focus ring and the current nav item. Primary
 *   actions are ink, because on a console the loudest thing on screen should be the state
 *   that needs a decision, not the button that starts one.
 *
 *   STATE COLOURS EXIST, QUIETLY. A support page has no failed operations to report; this
 *   has. They are set at the saturation of text, not of a warning label, and only ever on
 *   a pill's border and its letters — never as a filled block, which would pull the eye to
 *   the same three pills on every visit.
 *
 * Light only, deliberately, for the same reason as support: every colour is stated, so the
 * console holds its ground whatever the host theme is.
 *
 * ────────────────────────────────────────────────────────────────────────────
 * 2026-09-16: THE BOXES CAME OFF
 * ────────────────────────────────────────────────────────────────────────────
 *
 * The tokens above were already right and the pages still read as busy, because EVERY
 * object on them was a bordered rectangle with a radius: a panel, a card, an item, a pill,
 * a button, a field. The overview alone stacked five different card treatments — four stat
 * panels, three brand cards, a grid of tool panels, two lists of bordered items — and
 * nothing was ranked above anything else, because an outline gives every object the same
 * weight.
 *
 * So separation now comes from A HAIRLINE AND SPACE, not from an edge:
 *
 *   A SECTION is a heading, a rule under it, and rows. `h2.u26` / `h2.u28` draw that rule
 *   themselves (::after, so it can be animated) — there is no wrapper to add.
 *
 *   A ROW (`.item`) has no border of its own. Consecutive rows share an inset hairline and
 *   the row shades on hover. It is the click target, so a row that leads somewhere needs no
 *   "Open" button sitting on top of it: `.item.click` gets a chevron from `.chev`.
 *
 *   A PANEL is a soft grey surface, not an outlined one — one object rather than a frame
 *   drawn around some content. Fields inside it are white, so the form still reads as a
 *   form.
 *
 *   A CARD (`.card`) keeps its class name and loses everything that made it a card: no
 *   border, no shadow, no lift. A rule the width of the column, the name, a sentence, and
 *   where it answers. The rule is the one thing here that is deliberately NOT quiet: three
 *   brands with a 26px tick each blended into the page, and they are the part of the
 *   overview somebody actually goes to.
 *
 * ────────────────────────────────────────────────────────────────────────────
 * MOTION, AND WHY IT IS IN CSS AND NOT IN THE VIEWS
 * ────────────────────────────────────────────────────────────────────────────
 *
 * The CSP is `style-src 'self'`: there are no inline style attributes anywhere in this
 * console (that is what the `.u*` classes at the foot of this file exist for). So a
 * per-element `animation-delay` is not available, and a stagger written into twelve render
 * functions would have to be maintained in twelve places.
 *
 * Instead the stagger is `:nth-child` on `.main.enter > *`. Every view already renders as a
 * sequence of top-level blocks into `#main`, so each one settles upward a little behind the
 * one above it with no markup change at all, and a view added later gets it for free.
 *
 * `.enter` is put on by `route()` ONLY when the view actually changed — see the comment
 * there. Without that guard the page would re-animate on every 220ms search keystroke and
 * every 3-second poll of an applying operation, which is the difference between calm and
 * flickering.
 *
 * One gesture, repeated: things settle upward into place. Nothing bounces, nothing slides
 * in from off-screen, and everything stops for `prefers-reduced-motion`.
 */

:root {
  /* — from pinto.css, unchanged — */
  --ground: #FFFFFF;
  --raised: #F5F5F7;          /* the one grey. Cool, barely there. */
  --line: #E8E8ED;
  --ink: #1D1D1F;             /* near-black, never pure */
  --ink-2: #424245;
  --muted: #86868B;
  --accent: #009FE3;
  --accent-quiet: color-mix(in oklab, var(--accent) 8%, #FFFFFF);
  --accent-edge: color-mix(in oklab, var(--accent) 22%, #FFFFFF);

  /* — this console's own, because support has nothing to say about a failed operation — */
  --ok: #1C7C54;
  --warn: #8A6100;
  --bad: #B42318;
  --decide: #8A6100;

  /* the old names, kept so nothing has to be renamed in the markup */
  --bg: var(--raised);
  --panel: var(--ground);
  --ink-3: var(--muted);
  --line-2: var(--line);
  --accent-ink: #0B6E9C;      /* accent darkened to carry small text at contrast */
  --accent-soft: var(--accent-quiet);
  --decide-soft: #FBF6E9;
  --bad-soft: #FDF3F2;

  /* A hairline BETWEEN rows, one step lighter than the rule that closes a section, so a
     list of six does not read as six sections. */
  --hair: #EFEFF2;

  --mono: ui-monospace, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --r: 10px;
  --r-card: 16px;
  --dur: 180ms;
  --settle: cubic-bezier(.16, 1, .3, 1);   /* the one easing. Fast out, long settle. */
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
*::-webkit-scrollbar { width: 4px; height: 4px; } *::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; } *::-webkit-scrollbar-thumb:hover { background: var(--muted); }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.011em;   /* the tightening that makes system type look set rather than default */
  color: var(--ink-2);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font: inherit; letter-spacing: inherit; }
.hidden { display: none !important; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; color: var(--ink); font-weight: 600; letter-spacing: -0.02em; }
code, .mono { font-family: var(--mono); font-size: .92em; }

/* ── motion ────────────────────────────────────────────────────────────────── */

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes ease-in-left { from { opacity: 0; transform: translateX(-7px); } to { opacity: 1; transform: none; } }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes soften { from { opacity: 0; } to { opacity: 1; } }

/*
 * The page-load stagger. Ten steps is enough for every view in the console; anything
 * beyond the tenth block arrives with the tenth rather than after a wait nobody would sit
 * through.
 */
.main.enter > * { animation: rise 620ms var(--settle) both; }
.main.enter > *:nth-child(1) { animation-delay: 30ms; }
.main.enter > *:nth-child(2) { animation-delay: 90ms; }
.main.enter > *:nth-child(3) { animation-delay: 145ms; }
.main.enter > *:nth-child(4) { animation-delay: 195ms; }
.main.enter > *:nth-child(5) { animation-delay: 240ms; }
.main.enter > *:nth-child(6) { animation-delay: 280ms; }
.main.enter > *:nth-child(7) { animation-delay: 315ms; }
.main.enter > *:nth-child(8) { animation-delay: 345ms; }
.main.enter > *:nth-child(9) { animation-delay: 370ms; }
.main.enter > *:nth-child(n+10) { animation-delay: 390ms; }

/* Inside a list, the first few rows follow the same gesture. Past the sixth they arrive
   together: a queue of forty must not take four seconds to finish appearing. */
.main.enter .card-list > .item { animation: rise 520ms var(--settle) both; animation-delay: 260ms; }
.main.enter .card-list > .item:nth-child(1) { animation-delay: 150ms; }
.main.enter .card-list > .item:nth-child(2) { animation-delay: 185ms; }
.main.enter .card-list > .item:nth-child(3) { animation-delay: 215ms; }
.main.enter .card-list > .item:nth-child(4) { animation-delay: 240ms; }

/* The nav runs once, when the shell stops being `hidden` after a sign-in. */
.nav__brand { animation: ease-in-left 460ms var(--settle) both; animation-delay: 30ms; }
.nav__links > * { animation: ease-in-left 440ms var(--settle) both; }
.nav__links > *:nth-child(1) { animation-delay: 70ms; }
.nav__links > *:nth-child(2) { animation-delay: 100ms; }
.nav__links > *:nth-child(3) { animation-delay: 130ms; }
.nav__links > *:nth-child(4) { animation-delay: 160ms; }
.nav__links > *:nth-child(5) { animation-delay: 190ms; }
.nav__links > *:nth-child(6) { animation-delay: 220ms; }
.nav__links > *:nth-child(7) { animation-delay: 248ms; }
.nav__links > *:nth-child(8) { animation-delay: 274ms; }
.nav__links > *:nth-child(9) { animation-delay: 298ms; }
.nav__links > *:nth-child(10) { animation-delay: 320ms; }
.nav__links > *:nth-child(11) { animation-delay: 340ms; }
.nav__links > *:nth-child(12) { animation-delay: 358ms; }
.nav__links > *:nth-child(n+13) { animation-delay: 374ms; }
.nav__foot { animation: soften 700ms ease both; animation-delay: 420ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card:hover { transform: none; }
}

/* The eyebrow was uppercase monospace over every heading — the strongest "internal tool"
   signal on the page. It stays as a label, in the muted grey, at the weight of a caption. */
.eyebrow { margin: 0 0 8px; font-size: 12.5px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.lead { color: var(--ink-2); margin: 10px 0 0; max-width: 58ch; }
.lead b { color: var(--ink); font-weight: 600; }
.muted { color: var(--muted); }

/* ── the gate ──────────────────────────────────────────────────────────────────
   A sign-in page is the quietest moment in the product, so it can BE the page: no
   bordered, shadowed card floating on grey. The fields carry the grey instead. */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 40px 24px; }
.gate__card { background: var(--ground); border: 0; border-radius: 0; padding: 0; width: min(360px, 100%); box-shadow: none; }
.gate h1 { font-size: 32px; line-height: 1.15; letter-spacing: -0.028em; margin-top: 7px; }
.gate .eyebrow { animation: rise 720ms var(--settle) both; animation-delay: 120ms; }
.gate h1 { animation: rise 720ms var(--settle) both; animation-delay: 170ms; }
.gate .lead { animation: rise 720ms var(--settle) both; animation-delay: 230ms; font-size: 14.5px; }
.gate .form { animation: rise 720ms var(--settle) both; animation-delay: 300ms; }
.form { display: grid; gap: 14px; margin-top: 30px; }
.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px; border: 1px solid transparent; border-radius: 12px;
  background: var(--raised); color: var(--ink); font-size: 15px;
  transition: border-color var(--dur), box-shadow var(--dur), background var(--dur);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; background: var(--ground); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-edge); }
.field textarea { resize: vertical; min-height: 84px; }
.why { min-height: 1.2em; font-size: 13px; color: var(--bad); margin: 0; }
.why.ok { color: var(--ok); }
/* On the gate the one action is the whole width of the column. */
.gate .btn.primary { width: 100%; padding: 13px 18px; font-size: 15px; }

/* ── buttons ───────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px; text-decoration: none; border: 1px solid var(--line); border-radius: 999px; background: var(--ground); color: var(--ink); cursor: pointer; font-weight: 500; font-size: 13.5px; transition: background var(--dur), border-color var(--dur), color var(--dur); white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn:focus-visible { outline: 3px solid var(--accent-edge); outline-offset: 2px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #000; border-color: #000; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: color-mix(in oklab, var(--bad) 30%, #fff); }
.btn.small { padding: 5px 13px; font-size: 13px; }
.btn.quiet { border-color: transparent; color: var(--muted); }
.btn.quiet:hover { color: var(--ink); border-color: var(--line); }

/* ── the shell ─────────────────────────────────────────────────────────────────
   The left panel was already right. Three things changed and nothing else:
   the current item is ink on the one grey with a thin accent rail rather than a blue
   wash; a count is a plain figure rather than a grey lozenge; and the foot is a person
   rather than a bordered button. */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.nav { background: var(--ground); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.nav__brand { display: flex; align-items: center; gap: 10px; padding: 26px 20px 22px; font-weight: 600; font-size: 14px; color: var(--ink); }
.nav__brand .mark { font: 600 11px var(--mono); letter-spacing: .1em; background: var(--ink); color: #fff; padding: 4px 7px; border-radius: 6px; }
.nav__links { display: flex; flex-direction: column; padding: 2px 12px; gap: 1px; }
.nav__links a { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 11px; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-size: 14px; transition: background var(--dur), color var(--dur); }
.nav__links a:hover { background: #FAFAFB; color: var(--ink); }
/* The current page. The accent is a 3px rail rather than a wash across the whole item:
   present, but not a second block of colour in a column that has no other. */
.nav__links a.active { background: var(--raised); color: var(--ink); font-weight: 600; }
.nav__links a.active::before { content: ""; position: absolute; left: -12px; top: 50%; margin-top: -9px; width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--accent); }
/*
 * The heading that separates the desk's work from the platform's administration. Quiet to
 * the point of being scenery: it is a divider with a word on it, not a thing to click.
 * Hidden along with the links it introduces (it carries data-admin), so a staff member
 * never sees a heading with nothing under it.
 */
.nav__group {
  margin: 18px 11px 5px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
/* A count, not a badge. It was a filled grey lozenge on every item that had one, which in
   a column of twelve is a column of lozenges. */
.nav__links a .n { float: none; font-size: 12.5px; font-variant-numeric: tabular-nums; background: none; color: var(--muted); padding: 0; border-radius: 0; }
.nav__links a.active .n { color: var(--ink-2); font-weight: 600; }
.nav__foot { margin-top: auto; padding: 16px 14px 18px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
/* Who you are is a person — initials, name, role — not a button drawn around them. */
.who { flex: 1; min-width: 0; text-align: left; border: 0; background: none; border-radius: var(--r); padding: 0; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.who:hover .avatar { background: var(--line); }
.who .avatar { width: 30px; height: 30px; flex: none; border-radius: 999px; background: var(--raised); display: grid; place-items: center; font-size: 11.5px; font-weight: 600; color: var(--ink-2); letter-spacing: .02em; transition: background var(--dur); }
.who .whotext { min-width: 0; }
.who b { display: block; font-size: 13.5px; color: var(--ink); font-weight: 600; line-height: 1.3; }
.who span { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav__foot .btn.quiet { flex: none; padding: 6px 10px; }

.main { padding: 52px clamp(20px, 4vw, 56px) 72px; min-width: 0; max-width: 1240px; }
.main h1 { font-size: 30px; letter-spacing: -0.028em; line-height: 1.2; margin-bottom: 0; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 0; flex-wrap: wrap; }
.head .actions { display: flex; gap: 9px; flex-wrap: wrap; padding-top: 4px; }

/* ── panels, cards, rows ───────────────────────────────────────────────────── */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
/* A panel is a soft surface now. The outline it used to have made every form and every
   note on the page into another rectangle competing for an edge. */
.panel { background: var(--raised); border: 0; border-radius: var(--r-card); padding: 22px 26px 24px; }
/* Panel headings were uppercase monospace at 13px. A count is easier to place under a
   plain sentence-case label, and the panel stops looking like a dashboard widget. */
.panel h3 { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-bottom: 12px; }
/* Fields sit on white inside a grey panel, so a form still reads as a form. */
.panel .field input, .panel .field select, .panel .field textarea { background: var(--ground); border-color: var(--line); }
.stat { font-size: 36px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat + .muted { display: block; margin-top: 6px; font-size: 13px; }

/*
 * THE FIGURE BAND. Four counts were four bordered panels in a grid — four objects, each
 * with an edge, none of them ranked. They are one soft band now: one object on the page,
 * read left to right like a line of type.
 */
.figures { margin-top: 34px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; background: var(--raised); border-radius: var(--r-card); padding: 26px 32px 28px; }
.figures > div .stat { font-size: 36px; }
.figures > div .stat.mono { font-size: 19px; letter-spacing: -.01em; }
@media (max-width: 1100px) { .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 28px; } }

/* Three across, and three across at every width that can hold them. 13rem rather than the
   grid's usual 15: at this console's content width the wider minimum wraps three brands to
   2+1, which reads as one card having been added later. The support hub learned this first
   and its stylesheet says so; the same three cards should not learn it twice. */
.grid.cards { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 56px; }

/*
 * A CARD, WITHOUT BEING A CARD.
 *
 * The class name stays because the support hub and this console render the same three
 * brands from the same markup. What goes is everything that made it a card: the border,
 * the radius, the shadow and the two-pixel lift on hover. A short ink tick above the name
 * does the work the edge was doing — it says "this is one of three" — and the tick grows
 * on hover, which is the only thing that moves.
 */
.card {
  position: relative; display: flex; flex-direction: column; gap: .45rem; height: 100%;
  padding: 24px 20px 20px; margin: 0 -20px; border: 0; border-radius: 14px;
  background: none; text-decoration: none; color: inherit; cursor: pointer;
  transition: background 200ms ease;
}
/*
 * A FULL-WIDTH RULE, NOT A 26px TICK.
 *
 * The tick was too quiet to separate three brands from the page around them — they blended
 * into it. A rule the whole width of the column is a structural mark rather than a
 * decorative one: three of them across the page say "three things" before a word is read,
 * and it is still a line, not an outline, so nothing has gone back to being a card.
 */
.card::before { content: ""; position: absolute; left: 20px; right: 20px; top: 0; height: 2px; border-radius: 2px; background: var(--line); }
/*
 * THE HOVER: THE CARD GOES TO INK.
 *
 * The three brands are the part of the overview somebody actually goes to, so the hover is
 * the one loud moment in the console — the surface inverts to near-black and a white rule
 * wipes across its top from the left, the same gesture the section hairlines make as the
 * page settles. The card darkens first (200ms) and the wipe follows it (60ms later, over
 * 460ms), because a white line drawn across a white card is a line nobody sees.
 *
 * Nothing moves position. A list of three that lifts on hover is the card behaviour this
 * design took off in the first place; inverting says the same thing without shoving the
 * page around.
 */
.card::after { content: ""; position: absolute; left: 20px; right: 20px; top: 0; height: 2px; border-radius: 2px; background: #fff; transform: scaleX(0); transform-origin: left; transition: transform 460ms var(--settle); }
.card:hover::after { transform: scaleX(1); transition-delay: 60ms; }
.card:hover { background: var(--ink); border-color: transparent; box-shadow: none; transform: none; }

.card-top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 24px; }
/* The Tools launcher puts an icon where the overview puts the owner's name. Same slot,
   same weight — it recolours with the card when it inverts. */
.card__icon { display: inline-grid; place-items: center; color: var(--ink); transition: color var(--dur); }
.card:hover .card__icon { color: #FFFFFF; }
/* A registered tool with no address in its registry file. It keeps the card, so it is not
   hidden, and loses everything that would promise a tab: no pointer, no invert, no wipe. */
.card--shut { cursor: default; }
.card--shut:hover { background: none; }
.card--shut:hover::after { transform: scaleX(0); }
.card--shut:hover .card-name { color: var(--ink); }
.card--shut:hover .card-holdings { color: var(--ink-2); }
.card--shut:hover .card-host, .card--shut:hover .card-owner { color: var(--muted); }
.card--shut:hover .card__icon { color: var(--ink); }
.card-owner { font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); transition: color var(--dur); }
.card-name { margin: .15rem 0 0; font-size: 1.4rem; font-weight: 600; color: var(--ink); letter-spacing: -.026em; line-height: 1.2; transition: color var(--dur); }
.card-holdings { margin: .35rem 0 0; font-size: .875rem; color: var(--ink-2); transition: color var(--dur); }
.card-note { margin: 0; font-size: .8rem; color: var(--muted); font-style: italic; transition: color var(--dur); }
.card-foot { margin: auto 0 0; padding-top: 1.15rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.card-host { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; transition: color var(--dur); }

/* Everything on an inked card has to be legible on it. The state pills keep their meaning
   rather than flattening to white outlines — they are lightened versions of the same three
   tokens, so "answering" is still green and a failure is still red at a glance. */
.card:hover .card-name { color: #FFFFFF; }
.card:hover .card-holdings { color: rgba(255, 255, 255, .82); }
.card:hover .card-owner, .card:hover .card-note { color: rgba(255, 255, 255, .56); }
.card:hover .card-host { color: rgba(255, 255, 255, .72); }
.card:hover .hop { color: #FFFFFF; }
.card:hover .pill { border-color: rgba(255, 255, 255, .26); color: rgba(255, 255, 255, .78); }
.card:hover .pill.ok { border-color: color-mix(in oklab, var(--ok) 60%, #fff); color: color-mix(in oklab, var(--ok) 40%, #fff); }
.card:hover .pill.warn { border-color: color-mix(in oklab, var(--warn) 60%, #fff); color: color-mix(in oklab, var(--warn) 35%, #fff); }
.card:hover .pill.bad { border-color: color-mix(in oklab, var(--bad) 60%, #fff); color: color-mix(in oklab, var(--bad) 38%, #fff); }
.card:hover .pill.accent { border-color: var(--accent); color: var(--accent); }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; text-transform: none; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 13px 12px; border-bottom: 1px solid var(--hair); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--raised); }
.tblwrap { overflow-x: auto; }

/* A pill is a border and its letters. Never a filled block: the same three would then be
   the loudest thing on a page whose actual news is somewhere else. */
.pill { display: inline-block; font-size: 11.5px; font-weight: 500; letter-spacing: 0; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.ok { border-color: color-mix(in oklab, var(--ok) 30%, #fff); color: var(--ok); }
.pill.warn { border-color: color-mix(in oklab, var(--warn) 30%, #fff); color: var(--warn); }
.pill.bad { border-color: color-mix(in oklab, var(--bad) 30%, #fff); color: var(--bad); }
.pill.accent { border-color: var(--accent-edge); color: var(--accent-ink); }
.pill.s-planned { color: var(--muted); }
.pill.s-approved, .pill.s-applying { border-color: var(--accent-edge); color: var(--accent-ink); }
.pill.s-verified { border-color: color-mix(in oklab, var(--ok) 30%, #fff); color: var(--ok); }
.pill.s-requires_attention, .pill.s-partially_applied, .pill.s-failed { border-color: color-mix(in oklab, var(--bad) 30%, #fff); color: var(--bad); }
.pill.s-abandoned { color: var(--muted); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 12px; }
/* A note is a surface with a word of colour at its edge, not a bordered callout. */
.note { background: var(--decide-soft); border-left: 2px solid var(--decide); padding: 13px 18px; border-radius: 0 var(--r) var(--r) 0; font-size: 14px; }
.note.ok { background: var(--accent-quiet); border-color: var(--accent); }
.note.bad { background: var(--bad-soft); border-color: var(--bad); }
.empty { color: var(--muted); padding: 34px 28px; text-align: center; border: 0; background: var(--raised); border-radius: var(--r-card); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 7px 18px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; color: var(--ink); }
pre.json { background: var(--raised); border: 0; border-radius: var(--r); padding: 14px 16px; font: 12.5px/1.5 var(--mono); overflow-x: auto; margin: 0; max-height: 320px; }

/*
 * A LIST IS ROWS, NOT A STACK OF BOXES.
 *
 * `.card-list` held `.item`s, each a bordered rectangle with 10px between them, so ten
 * operations were ten outlines. Now the list is flush and consecutive rows share one
 * inset hairline; the row shades on hover, and a row that leads somewhere is itself the
 * link.
 */
.card-list { display: flex; flex-direction: column; }
.item { background: none; border: 0; border-radius: 11px; padding: 18px 14px; margin: 0 -14px; display: grid; gap: 6px; transition: background var(--dur); }
.item + .item { box-shadow: inset 0 1px 0 var(--hair); }
.item.click { cursor: pointer; }
.item.click:hover, .item:hover { background: var(--raised); box-shadow: none; }
.item .top { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; }
.item .top b { font-size: 15px; color: var(--ink); font-weight: 600; letter-spacing: -.012em; }
.item .meta { font-size: 13px; color: var(--muted); }
/* A row that opens something says so with a chevron. It does not also carry an "Open"
   button — that is the same sentence twice, and it puts a control on top of the target. */
.chev { color: color-mix(in oklab, var(--muted) 50%, var(--ground)); display: inline-grid; place-items: center; transition: color var(--dur), transform var(--dur); }
.item:hover .chev, .card:hover .chev { color: var(--ink); transform: translateX(2px); }
/* An external hop — a tool's own UI, a brand's support site — leans the other way. */
.hop { color: color-mix(in oklab, var(--muted) 50%, var(--ground)); display: inline-grid; place-items: center; transition: color var(--dur), transform var(--dur); }
.item:hover .hop, .card:hover .hop { color: var(--ink); transform: translate(1px, -1px); }

.steps { display: grid; gap: 4px; margin-top: 8px; }
.step { display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: center; font-size: 14px; padding: 9px 12px; border-radius: 9px; background: var(--raised); }
.item:hover .step { background: var(--ground); }
.step .i { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.step .err { color: var(--bad); font-size: 13px; }

/* A segmented control, for two or three mutually exclusive MODES — the brand chooser on
   Ask, the public/internal switch on a reply. Queues use tabs instead; see below. */
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--raised); border-radius: 999px; }
.seg button { border: 0; background: transparent; color: var(--ink-2); padding: 6px 15px; border-radius: 999px; cursor: pointer; font-size: 13.5px; font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--ground); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / 8%); }

/*
 * TABS, FOR THE VIEWS OF A QUEUE.
 *
 * Cases offers eight views and Intelligence seven. As a segmented control that is eight
 * filled lozenges in a grey trough — the busiest object on a page whose job is to be
 * scanned. The same buttons, as a row of words on one rule with the current one underlined,
 * carry the same information and stop shouting. Addressed by id so the segmented control
 * above keeps its own job; the markup is identical either way.
 */
#caseTabs.seg, #intelTabs.seg, #rmaTabs.seg {
  display: flex; gap: 26px; padding: 0; background: none; border-radius: 0;
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
#caseTabs.seg button, #intelTabs.seg button, #rmaTabs.seg button {
  position: relative; padding: 0 0 12px; border-radius: 0; background: none;
  color: var(--muted); font-size: 14px; font-weight: 400;
}
#caseTabs.seg button:hover, #intelTabs.seg button:hover, #rmaTabs.seg button:hover { color: var(--ink-2); }
#caseTabs.seg button[aria-pressed="true"], #intelTabs.seg button[aria-pressed="true"], #rmaTabs.seg button[aria-pressed="true"] {
  background: none; box-shadow: none; color: var(--ink); font-weight: 600;
}
#caseTabs.seg button[aria-pressed="true"]::after, #intelTabs.seg button[aria-pressed="true"]::after, #rmaTabs.seg button[aria-pressed="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--ink); border-radius: 2px 2px 0 0;
}

/*
 * ────────────────────────────────────────────────────────────────────────────
 * ASK — the support page's shape, inside the console
 * ────────────────────────────────────────────────────────────────────────────
 *
 * Every value here that has a twin in `packages/web/src/pinto.css` is that twin's value:
 * the 40rem measure, the 1.75rem between turns, the grey pill for the question, the answer
 * as unboxed 17px prose at 1.6, the pill composer and its focus ring, the chip. Staff and
 * customers talk to the same Pinto; they should see the same conversation. Change one
 * there and change it here.
 *
 * The one thing support does not have is `.draft` — a planned operation somebody approves.
 * It is the only boxed object on the page, and that is on purpose: it is not something
 * to read, it is something to decide about.
 */
.ask { --measure: 40rem; display: flex; flex-direction: column; min-height: calc(100vh - 124px); max-width: var(--measure); margin-inline: auto; }
.ask__middle { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 0; }
.ask.has-thread .ask__middle { justify-content: flex-end; }

.ask__stage { display: flex; flex-direction: column; align-items: center; gap: 1rem; text-align: center; padding-block: 2rem; }
.ask.has-thread .ask__stage { display: none; }
.ask__stage h1 { font-size: 34px; letter-spacing: -0.03em; line-height: 1.15; text-wrap: balance; }
.ask__stage .eyebrow { margin: 0; }
.ask__sub { margin: 0; font-size: 1.05rem; color: var(--muted); max-width: 36ch; text-wrap: balance; }
.ask__stage .seg { margin-top: .4rem; }
.ask__chips { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: .25rem; }
.chip {
  font: inherit; font-size: .9rem; padding: .5rem .95rem;
  border: 1px solid var(--line); border-radius: 980px;
  background: var(--ground); color: var(--ink-2); cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .12s ease;
}
.chip:hover { background: var(--raised); }
.chip:active { transform: scale(.97); }
.chip:focus-visible { outline: 3px solid var(--accent-edge); outline-offset: 2px; }

/* the stage settles in a beat behind the page itself */
.main.enter .ask__stage > * { animation: rise 620ms var(--settle) both; }
.main.enter .ask__stage > *:nth-child(2) { animation-delay: 80ms; }
.main.enter .ask__stage > *:nth-child(3) { animation-delay: 140ms; }
.main.enter .ask__stage > *:nth-child(4) { animation-delay: 200ms; }
.main.enter .ask__stage > *:nth-child(5) { animation-delay: 250ms; }

/* ── the conversation ─────────────────────────────────────────────────────── */
.thread { display: flex; flex-direction: column; gap: 1.75rem; padding-block: 1rem .75rem; }
.thread:empty { display: none; }
.turn { display: flex; flex-direction: column; gap: .6rem; animation: rise .35s cubic-bezier(.4, 0, .2, 1); }
.turn.you { align-items: flex-end; }
.bubble { max-width: 85%; overflow-wrap: anywhere; }
/* The question gets a shape. The answer does not — it is the page's content, not a message
   in a chat app, and boxing it makes the reader work harder to read it. */
.turn.you .bubble { padding: .65rem 1.05rem; border-radius: 20px; background: var(--raised); color: var(--ink); font-size: .95rem; white-space: pre-wrap; }
.turn.pinto .bubble { color: var(--ink); font-size: 1.0625rem; line-height: 1.6; max-width: 100%; }
.bubble > p { margin: 0 0 .75rem; }
.bubble > p:last-child { margin-bottom: 0; }
.sources { margin: 0; font-size: 12.5px; color: var(--muted); }
.ask__thinking { color: var(--muted); }
.ask__thinking::after { content: ''; display: inline-block; width: 1.1em; text-align: left; animation: ask-dots 1.2s steps(4) infinite; }
@keyframes ask-dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* ── the drafted operation — the one boxed object on the page ─────────────── */
.draft { background: var(--raised); border-radius: var(--r-card); padding: 22px 24px 20px; }
.draft__eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.draft__title { margin: 0; font-size: 18px; letter-spacing: -0.02em; line-height: 1.3; }
.draft__steps { list-style: none; counter-reset: step; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; }
.draft__steps li { counter-increment: step; display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: baseline; padding: 11px 0; font-size: 14.5px; color: var(--ink-2); }
.draft__steps li + li { border-top: 1px solid var(--line); }
.draft__steps li::before { content: counter(step); font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.draft__line b { color: var(--ink); font-weight: 600; }
.draft__tool { font-size: 12px; color: var(--muted); white-space: nowrap; }
.draft__acts { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.draft__done { margin: 0; font-size: 14px; color: var(--ink-2); }
.draft__why { flex-basis: 100%; margin: 6px 0 0; font-size: 13.5px; color: var(--bad); }

/* ── the foot: mode, composer, one line of what will happen ───────────────── */
.ask__foot { position: sticky; bottom: 0; padding: 14px 0 6px; background: linear-gradient(to bottom, rgb(255 255 255 / 0), var(--ground) 22px); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ask__mode { align-self: center; }
.composer {
  align-self: stretch; display: flex; gap: .5rem; align-items: center;
  border: 1px solid var(--line); border-radius: 980px;
  padding: .35rem .35rem .35rem 1.15rem; background: var(--ground);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.composer:focus-within { border-color: var(--accent-edge); box-shadow: 0 0 0 4px var(--accent-quiet); }
/* 17px, so iOS never zooms the page in on focus and then refuses to zoom back out. */
.composer input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font: inherit; font-size: 17px; color: var(--ink); padding: .55rem 0; }
.composer input::placeholder { color: var(--muted); }
.composer__send { flex: none; width: 38px; height: 38px; border-radius: 999px; border: 0; background: var(--ink); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background var(--dur), transform .12s ease; }
.composer__send:hover { background: #000; }
.composer__send:active { transform: scale(.94); }
.composer__send:focus-visible { outline: 3px solid var(--accent-edge); outline-offset: 2px; }
.ask__note { margin: 0; font-size: 12.5px; color: var(--muted); text-align: center; max-width: 52ch; }
.qr { font: 12.5px var(--mono); word-break: break-all; background: var(--raised); padding: 10px 12px; border-radius: var(--r); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 14px; transition: transform var(--dur), opacity var(--dur); pointer-events: none; z-index: 50; max-width: min(90vw, 620px); box-shadow: 0 8px 24px rgb(0 0 0 / 14%); }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.bad { background: var(--bad); }

@media (max-width: 860px) { .shell { grid-template-columns: 1fr; } .nav { position: static; height: auto; } .nav__links { flex-direction: row; flex-wrap: wrap; } .nav__links a.active::before { display: none; } .nav__group { flex-basis: 100%; margin: 8px 10px 2px; } .nav__foot { margin-top: 0; } .main { padding: 24px 18px 48px; } .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.cards { gap: 40px; } }

/* utility classes generated from the console's former inline styles (the CSP forbids style attributes) */
.u0 { margin:8px 0 0;font-size:13px; }
.u1 { margin-bottom:22px; }
.u2 { font-size:16px; }
.u3 { margin-bottom:16px; }
.u4 { align-items:end; }
.u5 { flex:1;min-width:260px; }
.u6 { font-size:12.5px;margin:14px 0 0; }
.u7 { margin-top:14px; }
.u8 { flex:1;min-width:220px; }
.u9 { justify-content:space-between;margin-bottom:8px; }
.u10 { margin-bottom:14px; }
.u11 { margin-top:12px;max-width:46rem; }
.u12 { flex:1;padding:11px 16px;border:0;background:var(--raised);border-radius:999px; }
.u13 { flex:1; }
.u14 { font-size:13px;word-break:break-all; }
.u15 { align-items:end;margin-top:6px; }
.u16 { grid-template-columns:auto 1fr;display:flex;align-items:center;gap:6px;padding-bottom:9px; }
.u17 { margin-top:6px; }
.u18 { margin-top:10px; }
.u19 { font-size:13.5px;color:var(--ink-2); }
.u20 { width:120px;padding:9px 12px;border:1px solid var(--line);border-radius:10px; }
.u21 { cursor:pointer; }
.u22 { align-self:center; }
.u23 { margin-bottom:14px; }
.u24 { max-width:46rem; }
.u25 { flex:1;padding:11px 16px;border:0;background:var(--raised);border-radius:999px; }
/*
 * THE SECTION HEADING, AND THE RULE IT DRAWS ITSELF.
 *
 * This was a 17px heading with margin and nothing else, so a page of five sections was
 * five headings floating in space with no telling where one ended. It is a smaller
 * heading ON a hairline now — the rule is an ::after rather than a border-bottom so it can
 * be drawn out from the left as the page settles, and so no wrapper element is needed in
 * any of the twelve views.
 */
.u26, .u28 {
  position: relative; font-size: 15.5px; letter-spacing: -0.014em;
  padding-bottom: 13px; margin: 46px 0 0;
}
.u28 { margin-top: 42px; }
.u26 .muted, .u28 .muted { font-weight: 400; margin-left: 7px; font-size: 15.5px; }
.u26::after, .u28::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--line); transform-origin: left;
}
.main.enter .u26::after, .main.enter .u28::after { animation: draw 900ms cubic-bezier(.22, 1, .36, 1) both; animation-delay: 300ms; }
.u27 { margin-top:12px; }
.u29 { color:var(--bad); }
.u30 { color:var(--ok); }
/* A quiet closing line — a count and a way through — where a whole grid used to repeat a
   page that already exists in the nav. */
.u31 { margin:44px 0 0;padding-top:18px;border-top:1px solid var(--line);font-size:13.5px;color:var(--muted);display:flex;gap:10px;align-items:center; }

/*
 * THE QUEUE SEARCH. One control, three views — see searchBox() in centre.js.
 *
 * Full width and above the tabs, because it narrows everything below it including the tab
 * counts. A search that sits beside one tab reads as filtering that tab alone.
 *
 * It is on the grey rather than in an outline, and it only grows a ring when it is being
 * used — the resting state of a search box should not be the loudest edge on the page.
 */
.searchbox { display: flex; gap: 10px; align-items: center; margin: 30px 0 0; max-width: 680px; }
.searchbox input[type="search"] {
  flex: 1; min-width: 0; font: inherit; font-size: 14.5px;
  padding: 12px 16px; border: 1px solid transparent; border-radius: 12px;
  background: var(--raised); color: var(--ink);
  transition: border-color var(--dur), box-shadow var(--dur), background var(--dur);
}
.searchbox input[type="search"]::placeholder { color: var(--muted); }
.searchbox input[type="search"]:focus-visible { outline: none; background: var(--ground); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-edge); }
.searchbox__hint { margin: 9px 2px 0; font-size: 12.5px; color: var(--muted); }
