/* Thaumaturgy — the Geode surface.
 *
 * One stylesheet, no build step, no framework. Written against the Geode design file rather
 * than invented: the palette, the type scale and the geometry below are read off it, and the
 * places where this file makes a decision the design could not are commented as such.
 *
 * Two rules that explain most of what follows:
 *
 *   1. Manrope for anything a person reads as language; JetBrains Mono for anything that is
 *      an identifier, a number or a path. A model id, an agent name, a dollar figure and a
 *      criterion id are all machine facts, and setting them in a proportional face makes
 *      them look like prose someone wrote.
 *
 *   2. Uppercase + 0.08em tracking is reserved for *section captions* — QUORUM, SPEND,
 *      DECISION LOG. It is a structural marker, not emphasis. Uppercasing content is how
 *      the previous iteration of this interface ended up shouting a Cyrillic display name
 *      and a three-line agent id at people.
 */

:root {
  /* Surfaces, darkest first. The page is darker than the frame so the frame reads as a
     held object rather than as the window. */
  --page: #040405;
  --frame: #060708;
  --panel: #0c0d0f;
  --panel-2: #1a1b1e;
  --raised: #222428;

  /* Lines, lightest contrast first. Four is more than it sounds: a table's row rule, a
     panel's edge, an input's edge and a focused input's edge are four different jobs. */
  --line: #1e2023;
  --line-2: #222428;
  --line-3: #2a2c31;
  --line-strong: #3a3d44;

  /* Ink, brightest first. */
  --ink: #f5f6f7;
  --ink-2: #d4d6da;
  --ink-3: #a8abb2;
  --ink-4: #8c9098;
  --ink-5: #6e727a;
  --ink-6: #55595f;

  /* The signal. Cyan is the only colour that means "you can act on this". */
  --signal: #4cc7d2;
  --signal-bright: #7adae2;
  --on-signal: #062227;
  --signal-wash: rgba(76, 199, 210, 0.12);
  --signal-edge: rgba(76, 199, 210, 0.45);

  /* States. Green/amber/red mean finished-well, waiting, failed — and nothing else. */
  --ok: #5fc98a;
  --warn: #e8a33d;
  --bad: #f0616d;
  --idle: #8c9098;

  /* The quorum's colour. Violet marks a decision a group made, which is a different kind
     of fact from a state and gets a different hue. */
  --quorum: #b9a4ff;
  --quorum-bright: #a48cff;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: Manrope, ui-sans-serif, system-ui, -apple-system, sans-serif;

  --rail: 272px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* Tabular figures everywhere. A spend column whose digits change width shifts the whole
     row every time the page refreshes, which on a live task is every few seconds. */
  font-variant-numeric: tabular-nums;
}

a {
  color: var(--signal);
  text-decoration: none;
}

a:hover {
  color: var(--signal-bright);
}

::selection {
  background: rgba(76, 199, 210, 0.28);
}

input::placeholder,
textarea::placeholder {
  color: var(--ink-6);
  opacity: 1;
}

/* Focus is always visible and never only a colour change: a cyan border on a cyan-adjacent
   background is not a focus ring for anyone navigating by keyboard. */
:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------------- *
 * Shell
 * ------------------------------------------------------------------------- */

.shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 100vh;
}

/* The nebula.
 *
 * A full-bleed WebGL canvas behind everything, painted by thaumaturgy.js. Fixed rather than
 * absolute so it does not scroll with a long task page — it is a backdrop, and a backdrop
 * that slides up as you read reads as a bug.
 *
 * Dim in the app and full strength on sign-in: the sign-in page has one thing on it and can
 * carry a picture, while a page with a decision log on it cannot. The two strengths are the
 * same shader with a different uniform, so there is one thing to look at rather than two.
 *
 * `z-index: 0` with everything above it at 1 and 2, because the order of a canvas, two
 * pseudo-element layers and the chrome is not something to leave to DOM order. */
.nebula {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* The generated fallback, for a browser with no WebGL at all. Built by the script only on
   the sign-in page — in the app the nebula is nearly invisible anyway, so 380 blurred nodes
   would be a lot of work for something nobody would see. */
.nebula-css {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(ellipse at 55% 50%, #140a2a 0%, #08060f 55%, #040405 100%);
}

@keyframes nebdrift {
  0% {
    transform: translate(-2%, 1%) rotate(-2deg) scale(1);
  }
  100% {
    transform: translate(2%, -1.5%) rotate(2deg) scale(1.05);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.15;
  }
  50% {
    opacity: 0.9;
  }
}

@keyframes starburst {
  0%,
  70% {
    transform: scale(0.2);
    opacity: 0;
  }
  78% {
    transform: scale(1);
    opacity: 1;
  }
  86% {
    transform: scale(2.4);
    opacity: 0.8;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

/* The dotted field. Decorative, and the one thing in here that is purely so — it gives the
   large empty areas of the index and the error page a texture, so they read as deliberate
   space rather than as a page that failed to load. */
.shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, #1f2126 1px, transparent 1.5px);
  background-size: 18px 18px;
  background-position: 9px 9px;
  z-index: 1;
}

/* The same field in violet, revealed in a circle around the cursor. `--mx`/`--my` are set
   by thaumaturgy.js; with JS off they stay at their default and the layer never shows,
   which is why the fallback is -999px rather than 0. */
.shell::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--quorum-bright) 1.3px, transparent 1.8px);
  background-size: 18px 18px;
  background-position: 9px 9px;
  -webkit-mask-image: radial-gradient(
    160px circle at var(--mx, -999px) var(--my, -999px),
    #000 0%,
    rgba(0, 0, 0, 0.35) 45%,
    transparent 75%
  );
  mask-image: radial-gradient(
    160px circle at var(--mx, -999px) var(--my, -999px),
    #000 0%,
    rgba(0, 0, 0, 0.35) 45%,
    transparent 75%
  );
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .shell::after {
    display: none;
  }
}

.rail {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  max-height: 100vh;
  border-right: 1px solid var(--line);
  /* Translucent, not `--frame`. The nebula has to read as something the interface is
     sitting on rather than as a border around it, and an opaque rail cuts a hard edge
     through the only part of the picture that is at eye level. */
  background: rgba(6, 7, 8, 0.55);
  backdrop-filter: blur(10px);
}

.rail-head {
  padding: 18px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand:hover {
  color: var(--ink);
}

.brand .star {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.find {
  position: relative;
  display: flex;
  align-items: center;
}

.find input {
  width: 100%;
  height: 32px;
  padding: 0 28px 0 10px;
  font-family: var(--sans);
  font-size: 12.5px;
}

.find kbd {
  position: absolute;
  right: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-5);
  pointer-events: none;
}

.rail-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 8px;
}

.rail-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.rail-task {
  display: block;
  padding: 9px 8px;
  border-radius: 7px;
  color: var(--ink-3);
}

.rail-task:hover {
  background: var(--panel-2);
  color: var(--ink);
}

.rail-task.current {
  background: var(--panel-2);
  color: var(--ink);
}

/* Two lines, then clipped. A rail is for recognising a task, not for reading its brief,
   and a six-line entry pushes everything else below the fold. */
.rail-task .title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.4;
}

.rail-task .meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-5);
}

.rail-foot {
  border-top: 1px solid var(--line-3);
  padding: 8px;
  position: relative;
}

.who {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}

.who:hover,
.menu-wrap[open] .who {
  background: var(--panel-2);
  border-color: var(--line-strong);
}

.who .initials {
  flex: 0 0 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--raised);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-2);
}

.who .names {
  min-width: 0;
  flex: 1 1 auto;
}

/* The one place a user's own name appears at size. Never uppercased and never tracked: a
   display name can be in any script, and a transform that looks like styling in Latin
   looks like damage in Cyrillic or Georgian. */
.who .name {
  display: block;
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.who .mail {
  display: block;
  font-size: 10.5px;
  color: var(--ink-5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The account menu is a native <details>, so it opens, closes and traps focus correctly
   with no script at all. */
.menu-wrap {
  position: relative;
}

.menu-wrap > summary {
  list-style: none;
  cursor: pointer;
}

.menu-wrap > summary::-webkit-details-marker {
  display: none;
}

.menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--panel-2);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  z-index: 5;
}

.menu a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 12.5px;
}

.menu a:hover {
  background: var(--line-3);
  color: var(--ink);
}

.menu a.danger:hover {
  color: var(--bad);
}

.menu hr {
  margin: 4px 6px;
  border: 0;
  border-top: 1px solid var(--line-3);
}

main {
  position: relative;
  z-index: 2;
  min-width: 0;
  padding: 32px 36px 72px;
}

/* ------------------------------------------------------------------------- *
 * Type
 * ------------------------------------------------------------------------- */

h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

h1.big {
  font-size: 34px;
  letter-spacing: -0.03em;
}

.lede {
  max-width: 66ch;
  color: var(--ink-3);
  font-size: 13.5px;
  line-height: 1.65;
}

/* The structural caption. Uppercase and tracked, and only ever a label. */
.cap {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.cap.warn {
  color: var(--warn);
}

.cap.ok {
  color: var(--ok);
}

.quiet {
  color: var(--ink-4);
}

.num {
  font-family: var(--mono);
  font-size: 12px;
}

.id {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
}

code {
  font-family: var(--mono);
  font-size: 0.92em;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--raised);
  color: var(--ink-2);
}

/* ------------------------------------------------------------------------- *
 * Panels and tables
 * ------------------------------------------------------------------------- */

.panel {
  margin-bottom: 18px;
  border: 1px solid var(--line-3);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-2);
  background: #0a0b0d;
}

.panel-body {
  padding: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-2);
  text-align: left;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-5);
  white-space: nowrap;
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

td.actions {
  text-align: right;
  white-space: nowrap;
}

td.actions form {
  display: inline;
}

.empty {
  padding: 40px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  text-align: center;
  color: var(--ink-4);
}

.notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-left-width: 3px;
  border-radius: 8px;
  background: var(--panel);
  font-size: 12.5px;
  color: var(--ink-2);
}

.notice strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 12.5px;
}

.notice.ok {
  border-left-color: var(--ok);
}

.notice.warn {
  border-left-color: var(--warn);
}

.notice.bad {
  border-left-color: var(--bad);
}

/* ------------------------------------------------------------------------- *
 * Badges
 * ------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10.5px;
  white-space: nowrap;
}

.badge .bdot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 5px;
}

.badge.ok {
  color: var(--ok);
  background: rgba(95, 201, 138, 0.1);
  border-color: rgba(95, 201, 138, 0.3);
}

.badge.waiting {
  color: var(--warn);
  background: rgba(232, 163, 61, 0.1);
  border-color: rgba(232, 163, 61, 0.3);
}

.badge.bad {
  color: var(--bad);
  background: rgba(240, 97, 109, 0.1);
  border-color: rgba(240, 97, 109, 0.3);
}

.badge.idle {
  color: var(--idle);
  background: rgba(140, 144, 152, 0.1);
  border-color: rgba(140, 144, 152, 0.3);
}

/* A waiting badge pulses, because waiting is the one state the reader is being asked to do
   something about. Motion is removed for anyone who asked for less of it. */
.badge.waiting .bdot {
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .badge.waiting .bdot {
    animation: none;
  }
}

/* ------------------------------------------------------------------------- *
 * Controls
 * ------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--ink-5);
  color: var(--ink);
}

.btn-signal {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--on-signal);
}

.btn-signal:hover {
  background: var(--signal-bright);
  border-color: var(--signal-bright);
  color: var(--on-signal);
}

.btn-ghost {
  background: transparent;
}

.btn-sm {
  height: 26px;
  padding: 0 9px;
  font-size: 11.5px;
  font-weight: 600;
}

.btn-icon {
  width: 26px;
  height: 26px;
  padding: 0;
  justify-content: center;
  font-family: var(--mono);
  font-size: 12px;
}

.btn-danger:hover {
  border-color: var(--bad);
  color: var(--bad);
}

.btn-go:hover {
  border-color: var(--ok);
  color: var(--ok);
}

.btn:disabled {
  background: var(--raised);
  border-color: var(--raised);
  color: var(--ink-6);
  cursor: not-allowed;
}

.btn .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="url"],
input[type="search"],
select,
textarea {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px 11px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--signal);
}

textarea {
  resize: vertical;
  min-height: 112px;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
}

.field {
  margin-bottom: 14px;
}

.field > label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.hint {
  margin-top: 6px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-5);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0 12px;
}

.row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

/* A checkbox as a row you click. The native box is kept and restyled rather than hidden,
   so the control is still a checkbox to a screen reader and to keyboard tab order. */
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--ink-3);
  cursor: pointer;
}

.check:hover {
  background: var(--panel-2);
}

.check input {
  appearance: none;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin: 0;
  border: 1px solid var(--ink-5);
  border-radius: 4px;
  background: var(--panel);
  cursor: pointer;
  position: relative;
}

.check input:checked {
  background: var(--signal);
  border-color: var(--signal);
}

.check input:checked::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--on-signal);
  font-size: 10px;
  font-weight: 700;
}

.check input:checked ~ span {
  color: var(--signal-bright);
}

/* A chip is a checkbox that reads as a tag: package ecosystems, MCP roles. */
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-4);
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--ink-5);
}

.chip input {
  appearance: none;
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.chip:has(input:checked) {
  background: var(--signal-wash);
  border-color: var(--signal-edge);
  color: var(--signal-bright);
}

.chip:has(input:focus-visible) {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

/* A read-only chip, for a table cell listing roles. */
.tag {
  display: inline-flex;
  padding: 3px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-4);
  font-family: var(--mono);
  font-size: 10.5px;
}

/* A segmented radio group: the quorum selector. */
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  border: 1px solid var(--line-3);
  border-radius: 9px;
  background: var(--panel-2);
}

.segmented label {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 28px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--ink-4);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.segmented input {
  appearance: none;
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.segmented label:has(input:checked) {
  background: var(--line-3);
  color: var(--ink);
}

.segmented label:has(input:focus-visible) {
  outline: 2px solid var(--signal);
  outline-offset: 1px;
}

/* ------------------------------------------------------------------------- *
 * Index
 * ------------------------------------------------------------------------- */

.hero {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: calc(100vh - 104px);
}

.hero-top {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.waiting-panels {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 20px 0 4px;
}

/* The composer.
 *
 * Translucent with a blur behind it, so the nebula carries on underneath rather than
 * stopping at a solid rectangle. The blur is what makes that readable: text over an
 * unblurred nebula is text over bright noise.
 *
 * Rounded hard — 20px here, a full pill on the index — because this is the one control on
 * the page that is being offered rather than filled in, and the panels around it are all
 * square. */
.compose {
  position: relative;
  margin-top: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: rgba(12, 13, 15, 0.55);
  backdrop-filter: blur(8px);
  transition: border-color 0.15s ease;
}

.compose:focus-within {
  border-color: var(--signal);
}

.compose textarea {
  border: 0;
  border-radius: 20px;
  background: transparent;
  min-height: 56px;
  padding: 14px 18px 0;
}

.compose-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 4px 10px 10px;
}

/* Every control inside the composer is a pill, to match its own shape. */
.compose-foot .btn,
.compose-foot input {
  border-radius: 999px;
}

/* The index's composer is a single line: a pill with the send button inside it. The
   textarea still grows, so a long brief is not typed through a letterbox. */
.compose.pill {
  border-radius: 28px;
}

.compose.pill textarea {
  min-height: 34px;
  padding: 15px 22px 0;
  border-radius: 28px;
}

.compose.pill .compose-foot {
  padding: 2px 10px 10px 22px;
  justify-content: space-between;
}

.jump {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  margin: 14px 0 0;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-4);
  font-family: var(--sans);
  font-size: 12.5px;
  cursor: pointer;
}

.jump:hover {
  border-color: var(--line-strong);
  color: var(--ink-2);
}

.jump .arrow {
  font-size: 15px;
}

/* ------------------------------------------------------------------------- *
 * Questions
 * ------------------------------------------------------------------------- */

.question {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.question:last-of-type {
  border-bottom: 0;
}

.question-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.question-head .n {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-5);
}

/* What is being asked, at reading size and never uppercased. */
.question-head .ask {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}

.blocking {
  padding: 1px 6px;
  border: 1px solid rgba(232, 163, 61, 0.4);
  border-radius: 999px;
  background: rgba(232, 163, 61, 0.1);
  color: var(--warn);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.why {
  margin: 6px 0 10px 28px;
  max-width: 72ch;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-4);
}

.answers {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: 28px;
}

.answers .other {
  flex: 1 1 200px;
  min-width: 160px;
}

/* An option is a radio that reads as a button. */
.opt {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 12.5px;
  cursor: pointer;
}

.opt:hover {
  border-color: var(--ink-5);
}

.opt input {
  appearance: none;
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.opt:has(input:checked) {
  background: rgba(76, 199, 210, 0.14);
  border-color: rgba(76, 199, 210, 0.5);
  color: var(--signal-bright);
}

.opt:has(input:focus-visible) {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------------- *
 * The composer's model picker
 * ------------------------------------------------------------------------- */

/* The sentence form: "You are going to spawn a task with [3 ▾] leads: a › b › c, …".
   Flex with wrapping, so a five-lead quorum reflows instead of overflowing. */
.spawn {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 14px;
  line-height: 2.1;
  color: var(--ink-3);
}

.spawn .lit {
  color: var(--ink);
}

.pick {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* The button that opens the cascade. Shows the whole path, because the path is the answer:
   `anthropic › Claude Sonnet › 4.5` names the vendor, the family and the version at a
   glance, and a bare model id names only the last of the three. */
.pick-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11.5px;
  cursor: pointer;
}

.pick-button:hover {
  border-color: var(--ink-5);
}

.pick-button[aria-expanded="true"] {
  border-color: var(--signal);
}

.pick-button .sep,
.pick-button .caret {
  color: var(--ink-5);
}

.pick-button .caret {
  font-size: 9px;
}

/* Three panes: providers, families, versions. Hover or arrow keys move the highlight left
   to right; a click in the third pane commits. */
.cascade {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 150px 170px 240px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel-2);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.cascade[hidden] {
  display: none;
}

.cascade.right {
  left: auto;
  right: 0;
}

.cascade-pane {
  max-height: 268px;
  overflow-y: auto;
  padding: 4px;
  border-right: 1px solid var(--line-3);
}

.cascade-pane:last-child {
  border-right: 0;
}

.cascade-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11.5px;
  text-align: left;
  cursor: pointer;
}

.cascade-item:hover,
.cascade-item.on {
  background: var(--line-3);
  color: var(--ink);
}

.cascade-item.picked {
  background: var(--signal-wash);
  color: var(--signal-bright);
}

.cascade-item .count,
.cascade-item .ctx {
  color: var(--ink-5);
  font-size: 10.5px;
}

.cascade-item .price {
  color: var(--ink-4);
  font-size: 10.5px;
}

.cascade-item .price.unpriced {
  color: var(--warn);
}

/* The no-JS form of the same control: one native select per slot, grouped
   provider › family. The two forms swap, driven by the `js` class the script sets on
   <html> — so with the script blocked, every slot is still pickable. */
.pick-fallback {
  min-width: 0;
  flex: 1 1 240px;
}

.js .pick-fallback {
  display: none;
}

html:not(.js) .pick-button {
  display: none;
}

/* One role's model row, in the AGENTS panel. */
.role-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.role-row:first-child {
  border-top: 0;
}

.role-row .lab {
  flex: 0 0 150px;
  font-size: 12.5px;
  color: var(--ink-4);
}

/* Slots past the chosen quorum. Hidden by the script when the quorum changes; always
   visible without it, with their own note saying they are ignored. */
.lead-slot[hidden] {
  display: none;
}

.lead-note {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--ink-5);
  white-space: nowrap;
}

/* ------------------------------------------------------------------------- *
 * Task
 * ------------------------------------------------------------------------- */

.task-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.task-head .obj {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}

.task-head .tools {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.task-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

@media (max-width: 1180px) {
  .task-cols {
    grid-template-columns: minmax(0, 1fr);
  }
}

.brief p {
  margin: 0 0 10px;
  max-width: 76ch;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-2);
}

.brief .turn {
  display: flex;
  gap: 10px;
  color: var(--ink-3);
}

.brief .turn .when {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-5);
}

.criterion {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}

.criterion:first-child {
  border-top: 0;
}

.criterion .cid {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-5);
}

/* The evidence line. Quieter and under the criterion, because a criterion is a claim and
   this is what was actually observed — the distinction the verifier exists for. */
.criterion .seen {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-5);
}

.log-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 28px;
  gap: 10px;
  align-items: baseline;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}

.log-row:first-child {
  border-top: 0;
}

.log-row .when {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-5);
}

.log-row .actor {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink);
}

.log-row .actor.human {
  color: var(--signal-bright);
}

.log-row .actor.quorum {
  color: var(--quorum);
}

.log-row .verb {
  font-weight: 700;
}

.log-row .verb.ok {
  color: var(--ok);
}

.log-row .verb.warn {
  color: var(--warn);
}

.log-row .verb.bad {
  color: var(--bad);
}

.log-row .verb.quorum {
  color: var(--quorum);
}

.log-row .verb.plain {
  color: var(--ink-2);
}

.log-row .said {
  color: var(--ink-3);
}

/* The vote board. A card per lead, with the model it ran on underneath. */
.votes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 8px;
}

.vote {
  padding: 12px 8px;
  border: 1px solid var(--line-3);
  border-radius: 9px;
  text-align: center;
}

.vote .mark {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.vote .model {
  display: block;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-5);
  word-break: break-all;
}

.vote.accept {
  background: linear-gradient(
    135deg,
    rgba(138, 92, 240, 0.32),
    rgba(208, 107, 232, 0.22) 55%,
    rgba(66, 80, 224, 0.34)
  );
  border-color: rgba(164, 140, 255, 0.5);
}

.vote.accept .mark {
  color: #ede6ff;
}

.vote.reject {
  background: linear-gradient(
    135deg,
    rgba(240, 60, 80, 0.32),
    rgba(200, 40, 120, 0.22) 55%,
    rgba(140, 20, 40, 0.38)
  );
  border-color: rgba(240, 97, 109, 0.55);
}

.vote.reject .mark {
  color: #ffe0e3;
}

/* Parked and lost are not abstentions. A pod that died has failed, and it must not read as
   a lead that thought about it and declined to say. */
.vote.out {
  background: linear-gradient(135deg, #2a2c31, #17181b 60%, #222428);
  border-color: var(--line-strong);
}

.vote.out .mark {
  color: var(--ink-3);
}

.vote.pending .mark {
  color: var(--ink-5);
}

.meter {
  margin-bottom: 14px;
}

.meter:last-child {
  margin-bottom: 0;
}

.meter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 5px;
}

.meter-bar {
  height: 4px;
  border-radius: 999px;
  background: var(--raised);
  overflow: hidden;
}

.meter-bar span {
  display: block;
  height: 100%;
  background: var(--signal);
}

.meter.warn .meter-bar span {
  background: var(--warn);
}

.meter.bad .meter-bar span {
  background: var(--bad);
}

.meter-foot {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}

.tele {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
  color: var(--ink-4);
}

.tele b {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--ink);
}

/* An agent row opens its log. A link, so it works with the script blocked. */
.agent-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  padding: 8px 9px;
  border-radius: 7px;
  color: inherit;
}

.agent-row:hover {
  background: var(--raised);
  color: inherit;
}

.agent-row .nm {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-row .sp {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  text-align: right;
}

.agent-row .rl {
  font-size: 10.5px;
  color: var(--ink-5);
}

.agent-row .st {
  font-family: var(--mono);
  font-size: 10.5px;
  text-align: right;
}

.verdict-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
}

.verdict-actions input {
  flex: 1 1 220px;
  min-width: 180px;
}

.downloads {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 10px 0 4px;
  font-family: var(--mono);
  font-size: 11.5px;
}

/* ------------------------------------------------------------------------- *
 * The log drawer
 * ------------------------------------------------------------------------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(4, 4, 5, 0.6);
  border: 0;
  padding: 0;
  cursor: pointer;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 31;
  width: min(680px, 92vw);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line-strong);
  background: var(--frame);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.6);
  animation: slidein 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes slidein {
  from {
    transform: translateX(40px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .drawer {
    animation: none;
  }
}

/* Served on its own it is a page, not an overlay. */
.drawer.standalone {
  position: static;
  width: auto;
  min-height: 100vh;
  border-left: 0;
  box-shadow: none;
  animation: none;
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-3);
}

.drawer-head .grow {
  flex: 1 1 auto;
  min-width: 0;
}

.drawer-head .nm {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  word-break: break-all;
}

.drawer-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-5);
}

.drawer-said {
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-3);
  background: var(--panel);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-2);
}

.drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 0 24px;
}

.line {
  display: grid;
  grid-template-columns: 70px 44px minmax(0, 1fr);
  gap: 10px;
  padding: 3px 16px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
}

.line .t {
  color: var(--ink-6);
}

.line .lv {
  font-weight: 700;
  color: var(--ink-5);
}

.line .msg {
  color: var(--ink-3);
  white-space: pre-wrap;
  word-break: break-word;
}

.line.error {
  background: rgba(240, 97, 109, 0.07);
}

.line.error .lv {
  color: var(--bad);
}

.line.error .msg {
  color: #e7b3b8;
}

.line.warn .lv {
  color: var(--warn);
}

.line.tool .lv {
  color: var(--quorum);
}

/* ------------------------------------------------------------------------- *
 * Preferences
 * ------------------------------------------------------------------------- */

.tabs {
  display: flex;
  gap: 2px;
  margin: 16px 0 20px;
  border-bottom: 1px solid var(--line-3);
}

.tabs a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  border-bottom: 2px solid transparent;
  color: var(--ink-4);
  font-size: 12.5px;
  font-weight: 700;
}

.tabs a:hover {
  color: var(--ink-2);
}

.tabs a[aria-current="page"] {
  border-bottom-color: var(--signal);
  color: var(--ink);
}

.tabs .count {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-5);
}

.mcp-roles {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.banner {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 16px;
  padding: 11px 14px;
  border: 1px solid var(--line-3);
  border-radius: 9px;
  background: var(--panel);
  font-size: 12.5px;
  color: var(--ink-3);
}

/* ------------------------------------------------------------------------- *
 * Error
 * ------------------------------------------------------------------------- */

.notfound {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 80px 0;
}

.notfound .code {
  font-family: var(--mono);
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  color: var(--line-strong);
}

/* ------------------------------------------------------------------------- *
 * Sign-in
 * ------------------------------------------------------------------------- */

.signin {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.signin-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 420px;
  text-align: center;
}

.signin-mark {
  display: flex;
  align-items: center;
  gap: 16px;
  /* Larger than anything else in the interface, because this page has one thing on it and
     a picture behind it — at the app's 24px the mark reads as a label on the nebula rather
     than as the thing the nebula is behind. */
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.signin-mark .star {
  width: 68px;
  height: 68px;
  flex: none;
}

/* Borderless over the nebula. A bordered button here draws a second rectangle on a page
   whose whole point is that there are none, and the glow on hover is the affordance the
   border was carrying. */
.signin .btn-plain {
  height: 44px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.signin .btn-plain:hover {
  color: #fff;
  text-shadow: 0 0 12px rgba(200, 180, 255, 0.6);
}

/* The card itself sits on the nebula with nothing behind it. */
.signin-card {
  position: relative;
  z-index: 1;
}
