/* No framework, no build step -- this file is embedded in the Go binary. */

:root {
  --bg: #fbfaf8;
  --panel: #ffffff;
  --ink: #1b1a18;
  --muted: #6b6862;
  --line: #e3e0da;
  --accent: #3a5a97;
  --danger: #a33a2f;
  --ok: #2f7a4f;
  --warn: #8a6412;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16151a;
    --panel: #1e1d23;
    --ink: #eceaf0;
    --muted: #9a96a3;
    --line: #33313a;
    --accent: #8fabe0;
    --danger: #e08b80;
    --ok: #7fc79b;
    --warn: #d9b25f;
  }
}

* { box-sizing: border-box; }

/* There was no rule here, so every link outside the nav fell back to the
   browser default -- a blue that is unreadable on the dark palette and a
   visited purple that made a table of company names look half broken. */
a { color: var(--accent); text-decoration-color: var(--line); }
a:hover { text-decoration: none; }

body {
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  max-width: 54rem;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 ui-sans-serif, -apple-system, "Segoe UI", system-ui, sans-serif;
}

header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: .75rem;
  margin-bottom: 1.5rem;
}

h1 { font-size: 1.35rem; margin: 0; letter-spacing: -.01em; }
h2 { font-size: .95rem; text-transform: uppercase; letter-spacing: .07em;
     color: var(--muted); margin: 2rem 0 .75rem; }
h3 { font-size: 1rem; margin: 0; font-weight: 600; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem;
}
.panel h2 { margin-top: 0; }

label { display: block; margin-bottom: .85rem; font-weight: 600; font-size: .875rem; }
label span { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }

/* Login page: single centred card, no header. */
body.centered {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.25rem;
}
.login { width: 100%; max-width: 21rem; }
.login h1 { font-size: 1.15rem; margin: 0 0 .35rem; }
.login .notice { margin: 0 0 1rem; font-size: .8rem; color: var(--muted); }
.login button { width: 100%; margin-top: .35rem; padding: .55rem; }
.login .flash { display: block; margin: 0 0 .9rem; }

textarea, select, input[type="text"], input[type="password"] {
  width: 100%;
  margin-top: .3rem;
  padding: .5rem .6rem;
  font: inherit;
  font-size: .9rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  resize: vertical;
}
textarea:focus, select:focus, input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
select { width: auto; margin-top: 0; padding: .25rem .4rem; font-size: .8rem; }

button {
  font: inherit;
  font-size: .875rem;
  font-weight: 600;
  padding: .45rem .9rem;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
/* The anchor is in the selector because a link carrying class="button secondary"
   is promising to look like one, and an element selector alone never matched it
   -- so every a.button.secondary on the site (Scoreboard, Compare messages, Open
   arm, Back to the pool) rendered as bare padded text. */
button.secondary, a.button.secondary {
  background: transparent; color: var(--accent); border: 1px solid var(--line);
}
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--line);
                padding: .25rem .55rem; font-size: .78rem; font-weight: 500; }
button:hover { filter: brightness(1.08); }

form.inline { display: inline; }
header .actions { display: flex; gap: .5rem; flex-shrink: 0; }

.flash {
  padding: .6rem .85rem;
  border-radius: 6px;
  font-size: .875rem;
  border: 1px solid var(--line);
}
.flash.ok { color: var(--ok); }
.flash.err { color: var(--danger); }
.flash.warn { color: var(--warn); }

.empty { color: var(--muted); font-size: .9rem; }

/* The tab strip. Nothing here hides a panel -- that is the script's job, by
   setting `hidden` -- so with no JS the buttons are inert and every section is
   still on the page. Inert, not misleading: without a script they do nothing,
   and the content they would have revealed is already visible below. */
.tablist {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  margin: 1.25rem 0 1rem;
  border-bottom: 1px solid var(--line);
}
.tablist button {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  padding: .45rem .8rem;
  font-size: .82rem;
  font-weight: 600;
  /* Sits ON the container's rule so the active tab can paint over it. */
  margin-bottom: -1px;
}
.tablist button:hover { color: var(--ink); }
.tablist button.active {
  color: var(--ink);
  background: var(--panel);
  border-color: var(--line);
  /* The seam: the active tab and its panel are one surface, so the line
     between them goes. */
  border-bottom: 1px solid var(--panel);
}
.tablist button:hover { filter: none; }
/* The UA already does this; stated so a future reset cannot quietly turn every
   panel back on at once. */
[data-panel][hidden] { display: none; }

/* The copy-prompt diagram on the help page: three source boxes feeding one
   request. Boxes rather than prose because the question it answers is "where
   does this field come from", and a list of eleven names in a paragraph is not
   an answer to that. No SVG and no library -- it is a grid that reflows to one
   column on a phone, which a drawn diagram would not. */
.flow { margin: 1rem 0 0; }
.flow-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: .75rem;
  align-items: start;
}
.flow-src, .flow-call, .flow-out, .flow-omit {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .7rem .85rem;
  background: var(--bg);
}
/* The destination and the result are the same shape as a source box but tinted,
   so the direction of travel is readable without following the arrows. */
.flow-call, .flow-out { background: var(--panel); border-color: var(--accent); }
.flow h4 {
  margin: 0 0 .3rem;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
/* A second heading inside one source box -- Signal under Arm -- needs the gap
   the first one does not. */
.flow h4 + p + ul + h4 { margin-top: .9rem; }
.flow-note { margin: 0 0 .5rem; font-size: .78rem; color: var(--muted); }
.flow-arrow { margin: .5rem 0; text-align: center; color: var(--muted); font-size: 1.1rem; }

/* One variable per line, so the box can be read as an inventory. The name is
   the thing being looked up; the gloss is why it is there. */
.var-list { list-style: none; margin: 0; padding: 0; font-size: .82rem; }
.var-list li { margin: 0 0 .3rem; }
.var-list li:last-child { margin-bottom: 0; }
.var-list code { font-size: .78rem; }
.var-list .meta { display: block; font-size: .72rem; }

/* What is left out, set apart from the flow: it is a claim about the diagram
   above rather than another stage of it. Dashed, because an absence drawn in a
   solid box reads as one more thing that gets sent. */
.flow-omit { margin-top: 1.25rem; border-style: dashed; }

/* A section whose heading carries an action of its own. Baseline rather than
   centre: the h2 is uppercase and small, and centring a full-height button
   against it drags the label off the line every other heading sits on. */
.section-head { display: flex; align-items: baseline; gap: .8rem; }
.section-head h2 { flex: 1; min-width: 0; }

/* An ICP groups its hypotheses. The nesting is the 1:n relation made visible,
   so the group gets the outer border and the cards sit inside it. */
.icp {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
}
.icp-head { display: flex; align-items: baseline; gap: .7rem; }
.icp-head h3 { flex: 1; min-width: 0; }
/* The ICP's name as its own disclosure, drawn like the retired box's native
   <summary> marker so the two fold the same way on the same page. */
button.disclosure {
  background: none; border: 0; padding: 0; color: inherit;
  font: inherit; text-align: left; cursor: pointer;
}
button.disclosure:hover { filter: none; }
button.disclosure::before {
  content: "\25B6"; display: inline-block; margin-right: .45rem;
  font-size: .7em; vertical-align: .12em; transition: transform .12s;
}
button.disclosure[aria-expanded="true"]::before { transform: rotate(90deg); }
.icp-head .meta { color: var(--muted); font-size: .78rem; white-space: nowrap; }
/* Every button on the card, as one right-aligned group. margin-left:auto rather
   than relying on the h3's flex:1 alone, so the group still sits right when a
   long name wraps and the heading no longer fills the row. */
.icp-actions { display: flex; align-items: center; gap: .4rem; margin-left: auto; }
/* The identifying line, moved out of the head and under the chips: it is
   reference, not a heading, and in the head it competed with the name for the
   width the buttons needed. */
.icp-meta { margin: .4rem 0 0; color: var(--muted); font-size: .78rem; }
.icp-edit { margin-top: .6rem; }

/* The running arms on an ICP card, one row each with the pipeline's verdict.
   One line per arm, and it stays one line: the name takes the width and is what
   gets cut, never the light or the lemlist button. The light's reason is on the
   row's tooltip. */
.arm-health { margin: .5rem 0 0; border: 1px solid var(--line); border-radius: 6px; }
.arm-health-row { display: flex; align-items: center; gap: .5rem; padding: .35rem .6rem;
  min-width: 0; font-size: .85rem; }
.arm-health-row + .arm-health-row { border-top: 1px solid var(--line); }
.arm-health-name { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.arm-health-row .meta { white-space: nowrap; }
.led { flex: none; width: .7rem; height: .7rem; border-radius: 50%; }
.led-green  { background: var(--ok);     box-shadow: 0 0 .35rem var(--ok); }
.led-yellow { background: var(--warn);   box-shadow: 0 0 .35rem var(--warn); }
.led-red    { background: var(--danger); box-shadow: 0 0 .35rem var(--danger); }
a.button.lemlist-link { flex: none; display: inline-flex; align-items: center; gap: .35rem;
  padding: .2rem .55rem; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.lemlist-link svg { width: .95rem; height: .95rem; }
@media (max-width: 640px) {
  .arm-health-row { flex-wrap: wrap; }
  .arm-health-name { flex-basis: 100%; white-space: normal; }
}
.icp .notes { margin: .5rem 0 0; font-size: .84rem; color: var(--muted); }

/* A retired ICP is still a card, and must not read as a live one: dashed, so
   "out of use" is visible before the meta line is read. It only ever appears
   inside the folded box at the end of the page. */
.icp.retired { border-style: dashed; }
.icp.retired h3 { color: var(--muted); }

/* Facet chips. Empty when an ICP has no profile filled in, and then it must not
   leave a gap -- hence :empty rather than a conditional in the template. */
.profile { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .6rem; }
.profile:empty { display: none; }
.chip {
  font-size: .72rem;
  padding: .1rem .45rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--bg);
}
/* The two facets that describe fit rather than firmographics get the accent,
   so a scan of the page separates "who they are" from "what they need". */
.chip-delivery_complexity, .chip-desired_scope { color: var(--accent); }

.icp-list { margin-top: .6rem; font-size: .84rem; }
.icp-list ul { margin: 0; padding-left: 1.1rem; }
.icp-list li { margin: 0; }

/* The account > contact drill-down on the arm page. Indentation and a rule down
   the left are the only things carrying the hierarchy, which is enough at this
   depth and avoids a tree widget nobody asked for. */
details.icp-list > summary,
details.tree-node > summary { cursor: pointer; padding: .2rem 0; }
details.tree-node {
  margin: .3rem 0 .3rem .8rem;
  padding-left: .75rem;
  border-left: 2px solid var(--line);
}
details.tree-node > summary .meta { margin-left: .4rem; }
details.tree-node table.scoreboard { margin: .25rem 0 .5rem; }
details.tree-node .empty { margin: .25rem 0 .5rem; }

/* Two number inputs side by side for the employee range. */
.pair { display: flex; gap: .8rem; }
.pair label { flex: 1; }
input[type="number"] {
  width: 100%;
  margin-top: .3rem;
  padding: .5rem .6rem;
  font: inherit;
  font-size: .9rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.panel select { width: 100%; margin-top: .3rem; padding: .5rem .6rem; font-size: .9rem; }
.icp .empty { margin: .85rem 0 0; }

/* The one filled button on the card: adding an arm is the step the card is
   waiting on, and the outline buttons around it only manage what is there.
   Text in --panel rather than #fff, so it stays readable on the light accent the
   dark palette uses. */
.add-arm { margin: .9rem 0 0; }
a.button.add-arm-button {
  background: var(--accent); color: var(--panel); border: 1px solid var(--accent);
  font-weight: 600;
}
a.button.add-arm-button:hover { filter: brightness(1.08); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.15rem;
  margin-top: .85rem;
}
.card h4 { font-size: .95rem; margin: 0; font-weight: 600; }

.card-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .7rem; }
.card-head h3 { flex: 1; min-width: 0; }

.status {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .12rem .45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.status-validated { color: var(--ok); }
.status-rejected { color: var(--danger); }

/* Language badge: same pill as the status, deliberately quieter. */
.lang {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .12rem .45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}

/* Radio group in the form. fieldset resets are needed because the browser
   default border and padding do not match the textarea fields above it. */
.radios { border: 0; padding: 0; margin: 0 0 .85rem; }
.radios legend { padding: 0; font-weight: 600; font-size: .875rem; }
.radios legend span { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
label.radio {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin: .4rem 1rem 0 0;
  font-weight: 400;
  font-size: .9rem;
}
label.radio input { margin: 0; accent-color: var(--accent); }

/* One row of the resolve pick list: a company name to click, and under it the
   metadata that tells four companies at one domain apart. A grid rather than the
   inline label.radio above, because that second line is the half the choice is
   actually made on -- country and headcount are what separate a parent from a
   national subsidiary and both from the mobile home park sharing the domain. */
label.pick {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .05rem .55rem;
  align-items: center;
  margin: .4rem 0 0;
  padding: .45rem .6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 400;
  font-size: .9rem;
  cursor: pointer;
}
label.pick:hover { border-color: var(--accent); }
label.pick input { grid-row: span 2; margin: 0; accent-color: var(--accent); }
label.pick .pick-name { font-weight: 600; }
label.pick .pick-meta { color: var(--muted); font-size: .8rem; }

/* A repair too big for an action cell, opened off a link.
   TWO WAYS IN, and the second one is why the markup is a <dialog> and not a
   div: with JS the opener calls showModal() and the browser gives us the top
   layer, a backdrop and Esc for free; without it the plain #fragment link still
   lands, and :target renders the same dialog as a block in the flow. Neither
   path needs the other to work. */
dialog.modal {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  padding: 1.1rem 1.25rem 1.25rem;
  width: min(40rem, calc(100vw - 2rem));
  max-height: calc(100vh - 4rem);
  overflow: auto;
}
dialog.modal::backdrop { background: rgba(0, 0, 0, .45); }
dialog.modal h3 { margin: 0 0 .2rem; }
dialog.modal > p.meta { margin: 0 0 .9rem; }
/* :not(.pick), or this would beat label.pick on specificity and flatten the pick
   list's two-line grid back into a stack of blocks -- and :not(.radio) for the
   same reason, or the add-arm modal's language choices stack up bold. */
dialog.modal label:not(.pick):not(.radio) { display: block; margin-top: .6rem; font-size: .875rem; font-weight: 600; }
dialog.modal label:not(.pick):not(.radio) .meta { font-weight: 400; }
.modal-note {
  margin: .9rem 0 0;
  padding: .55rem .7rem;
  border-left: 3px solid var(--warn);
  background: var(--bg);
  color: var(--muted);
  font-size: .825rem;
}
.modal-x { float: right; margin: -.4rem -.4rem 0 .5rem; }
.modal-x button { font-size: 1.3rem; line-height: 1; }
/* The no-JS half: shown only when the fragment selects it, and only there does
   the close link have anything to close. */
.modal-dismiss { display: none; }
dialog.modal:target { display: block; margin: 1rem auto; }
dialog.modal:target .modal-dismiss { display: inline; margin-left: .75rem; font-size: .875rem; }
/* Both can be true at once: the server redirects to #resolve-<hit> AND the
   script opens it. Then the top layer is doing the work and a link to "#" closes
   nothing, so it goes away. Same specificity as the rule above, so it has to
   come after it. */
dialog.modal[open] .modal-dismiss { display: none; }

/* A modal holding a comparison rather than a form. Three prose columns read
   side by side is the whole point, and 40rem turns each of them into a
   one-word-per-line ribbon. */
dialog.modal.modal-wide { width: min(68rem, calc(100vw - 2rem)); }
/* The identifying column stays as narrow as its contents; the three sentences
   split what is left evenly, so no arm's copy gets more room than another's --
   an uneven split reads as emphasis the comparison does not mean. */
table.copy-compare { table-layout: fixed; }
table.copy-compare th:first-child, table.copy-compare td:first-child { width: 9rem; }
table.copy-compare td { line-height: 1.45; }
/* Whole sentences, so long words break rather than push the table wider than
   the dialog and hide the last column. */
table.copy-compare td { overflow-wrap: anywhere; }

/* A single checkbox with its explanation underneath -- the signal enable/disable
   toggle, where the explanation is the important half: disabling re-routes
   accounts, and a bare box would not say so. */
label.check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .35rem .5rem;
  align-items: start;
  font-weight: 400;
  font-size: .9rem;
}
label.check input { margin: .15rem 0 0; accent-color: var(--accent); }
label.check span { grid-column: 2; }

/* The reorder buttons sit three to a cell and must not wrap mid-row. */
td.nowrap { white-space: nowrap; }
button.link.danger { color: var(--danger); }

dl { display: grid; grid-template-columns: 6.5rem 1fr; gap: .3rem .9rem; margin: 0; font-size: .875rem; }
dt { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; padding-top: .1rem; }
dd { margin: 0; }

/* Message variants: collapsed by default, because three emails per card would
   bury the hypotheses themselves on a page listing all of them. */
.variants { margin-top: .85rem; }
.variants summary {
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.variant {
  margin-top: .7rem;
  padding: .7rem .85rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.variant-head { display: flex; align-items: baseline; gap: .5rem; }
.variant-no {
  font-variant-numeric: tabular-nums;
  font-size: .7rem;
  font-weight: 700;
  color: var(--muted);
}
.variant-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.variant-subject { margin: .35rem 0 .5rem; font-weight: 600; font-size: .9rem; }
/* pre, so the line breaks the model wrote survive; wrapped, so a long line does
   not force the card to scroll sideways. */
.variant-body {
  margin: 0;
  font: inherit;
  font-size: .86rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.variant-note { margin: .85rem 0 0; font-size: .8rem; color: var(--muted); }
.variant-note.err { color: var(--danger); }

/* The push to lemlist. Wraps, because the id and a failure reason can both be
   present at once -- a campaign that was created without its email step. */
.campaign {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .7rem;
  padding-top: .6rem;
  border-top: 1px dashed var(--line);
}
.campaign button { font-size: .78rem; padding: .3rem .6rem; }
.campaign-id {
  font-size: .78rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
  user-select: all; /* one click selects the whole id, for pasting into lemlist */
}
.campaign-note { font-size: .78rem; color: var(--muted); }
.campaign-note.err { color: var(--danger); }

.card footer {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-top: .9rem;
  padding-top: .7rem;
  border-top: 1px solid var(--line);
}
.card footer .meta { flex: 1; color: var(--muted); font-size: .78rem; }

@media (max-width: 34rem) {
  dl { grid-template-columns: 1fr; gap: .1rem; }
  dt { margin-top: .5rem; }
  .card footer { flex-wrap: wrap; }
}

/* --- the bandit screens ---------------------------------------------------
   Added with the hypothesis-as-arm model. The page got wider than the original
   54rem reading column because the scoreboard has twelve columns and wrapping
   it would make it unreadable. */

body { max-width: 68rem; }

.topnav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: -.75rem 0 1.25rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--line);
  font-size: .85rem;
}
.topnav a { color: var(--muted); text-decoration: none; }
.topnav a:hover { color: var(--ink); }
button.link {
  background: none; border: none; padding: 0; color: var(--muted);
  font: inherit; cursor: pointer;
}
button.link:hover { color: var(--ink); }

a.button {
  display: inline-block;
  text-decoration: none;
  padding: .4rem .75rem;
  border-radius: 7px;
  font-size: .82rem;
}

/* The line at the top of a pool: whether the bandit is deciding anything. */
.headline {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .8rem 1rem;
  font-size: .9rem;
}

table.scoreboard {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
table.scoreboard th {
  text-align: left;
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  padding: .55rem .6rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.scoreboard td { padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.scoreboard tr:last-child td { border-bottom: none; }
table.scoreboard .meta { display: block; font-size: .72rem; }
/* A cell that IS the small print keeps the size but stays a cell. display:block
   on a td drops it out of the table layout, and its border-bottom then paints
   around the content instead of the row -- a rule line halfway up the row, in
   one column only. */
table.scoreboard td.meta { display: table-cell; }
/* A date separator inside a table ordered by date. Quiet on purpose: it is a
   boundary between groups of rows, not a row of its own, so it gets a tint and
   a smaller face rather than anything that competes with the data. The top
   border is what actually does the separating -- the tint alone reads as a
   highlighted row. */
table.scoreboard tr.row-day td {
  padding: .3rem .6rem;
  background: var(--bg);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}
/* The first separator sits directly under the header rule; a second line there
   is a double rule. */
table.scoreboard tbody tr.row-day:first-child td { border-top: 0; }

/* One decision, one line. Wrapped, the pair reads as two separate offers and
   the column's width stops being predictable from row to row. */
table.scoreboard td.row-actions { white-space: nowrap; }
table.scoreboard td.row-actions form.inline + form.inline { margin-left: .5rem; }
/* A cell carrying a link AND a decision -- the parked rows on the run page and
   in the Discovered table: one control per line. Three on one line pushes the
   evidence column, the widest and most useful one there, off the screen.
   Order-independent, because the two screens stack the same pair the other way
   round: Resolve over Reject on the run page, Reject over Resolve here. */
table.scoreboard td.row-actions.stacked > * { display: block; }
table.scoreboard td.row-actions.stacked > * + * { margin-top: .3rem; }
/* Table scale, not form scale: a control sized for a panel looks oversized on a
   .82rem row. Scoped to the table so the standalone inline forms keep theirs. */
table.scoreboard .inline-form input[type=text] { font-size: .8rem; padding: .35rem .5rem; }
table.scoreboard .inline-form button { font-size: .8rem; padding: .35rem .7rem; }

/* A paused or retired arm stays on the board with its numbers and its reason --
   the screen cannot explain why an arm stopped if the arm is not on it. */
.row-paused td, .row-retired td { opacity: .6; }
.row-reason td { padding-top: 0; }
.row-winner td { font-weight: 600; }

/* The signal edit view lives INSIDE the table: one hidden row per signal,
   shown when the edit link makes it the URL fragment. :target instead of JS,
   which the app does not have -- and since only one element can be the target,
   opening a row closes the previous one, and the close link (#signals) closes
   them all. The accent border is what says "this row belongs to the one
   above". */
table.scoreboard tr.signal-edit { display: none; }
table.scoreboard tr.signal-edit:target { display: table-row; }
table.scoreboard tr.signal-edit > td { padding: .35rem .3rem .9rem; white-space: normal; }
.signal-edit-box {
  border: 2px solid var(--accent);
  border-radius: 10px;
  background: var(--panel);
  padding: 1rem;
}
.signal-edit-box > h4 { margin: 0 0 .75rem; }
.signal-edit-box > .close { float: right; font-size: .8rem; }

.reply-text { max-width: 34rem; white-space: pre-wrap; }

.cell {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 10px;
  padding: .9rem 1rem;
  margin-bottom: .7rem;
}
/* A cell holding one arm is a campaign; a cell holding three is where the
   bandit is actually deciding. The border is the difference at a glance. */
.cell.racing { border-left-color: var(--accent); }
.cell-arms { list-style: none; margin: .5rem 0 0; padding: 0; font-size: .85rem; }
.cell-arms li { padding: .2rem 0; }

.week { margin-bottom: .55rem; font-size: .8rem; }
.week-label { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; margin-right: .5rem; }
.bar { display: flex; height: 1.1rem; border-radius: 4px; overflow: hidden; margin-top: .2rem; }
.seg {
  font-size: .65rem;
  line-height: 1.1rem;
  text-align: center;
  color: var(--bg);
  background: var(--accent);
  border-right: 1px solid var(--panel);
  overflow: hidden;
  white-space: nowrap;
}
.seg:nth-child(even) { background: var(--muted); }
.seg:nth-child(3n) { background: var(--ok); }

.step {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .8rem .9rem;
  margin-bottom: .8rem;
}
.step-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.step-no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--accent); color: var(--bg); font-size: .75rem; font-weight: 600;
}
.step-type { font-weight: 600; }
.step-subject { color: var(--muted); }
/* The conditions on a step -- the acceptance gate, stop-on-reply. Indented off
   a rule so they read as something imposed on the step from outside rather than
   as one more field of it. */
.step-note {
  margin: 0 0 .5rem;
  padding-left: .6rem;
  border-left: 2px solid var(--line);
  color: var(--muted);
  font-size: .8rem;
}
.step-note.warn { color: var(--warn); border-left-color: var(--warn); }

/* The openable copy prompt on a step: the exact messages a generation call
   sends. A disclosure like the lights, because it is long and usually not the
   question being asked. */
details.prompt { margin-top: .6rem; font-size: .82rem; }
details.prompt > summary { cursor: pointer; color: var(--muted); padding: .2rem 0; }
details.prompt > summary .meta { margin-left: .4rem; font-size: .78rem; }
.prompt-msg { margin: .5rem 0 0; }
/* pre, so the prompt is shown exactly as sent; wrapped, so the JSON payload's
   one long line does not force the page to scroll sideways. */
.prompt-msg pre {
  margin: .25rem 0 0;
  padding: .55rem .7rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: .78rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
/* The editable form of the same box: a textarea styled like the pre, so the
   box reads the same whether or not it can be run. */
.prompt-msg textarea {
  margin: .25rem 0 0;
  padding: .55rem .7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .78rem;
}
.prompt-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .5rem; }
ol.steps { margin: .6rem 0 0; padding-left: 1.2rem; font-size: .82rem; }
ol.steps li { padding: .15rem 0; }
ol.steps .meta { margin-left: .4rem; }

label.tight { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; margin: 0; }
label.tight input { width: 4rem; margin: 0; }

.inline-form { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.inline-form input[type=text] { flex: 1; min-width: 12rem; margin: 0; }
/* Inside a panel a select is a full-width form field, which would break the row
   apart and put the button on a line of its own. On this row it is one control
   among several. */
.inline-form select { width: auto; margin-top: 0; }


ul.events, ul.suppression { list-style: none; margin: 0; padding: 0; font-size: .82rem; }
ul.events li, ul.suppression li { padding: .3rem 0; border-bottom: 1px solid var(--line); }
ul.events li:last-child, ul.suppression li:last-child { border-bottom: none; }
ul.events .meta { margin-left: .4rem; }

.chip.warn { border-color: var(--danger); color: var(--danger); }
.chip.ok { border-color: var(--ok); color: var(--ok); }

/* The status boxes on the arm page: the readiness lights and the lifecycle
   state, each a small box that names the thing, with the reasons on hover. A
   row, not a stack -- nothing opens in place any more, so nothing competes for
   the width. */
.pills { display: flex; flex-wrap: wrap; gap: .4rem; margin: .2rem 0 1rem; }
.pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .65rem;
  font-size: .8rem; font-weight: 600; line-height: 1.3;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: default;
}
.pill .dot {
  width: .55rem; height: .55rem; border-radius: 50%;
  background: currentColor; flex: none;
}
.pill-count {
  font-size: .7rem; font-weight: 600;
  padding: 0 .35rem; border-radius: 999px;
  border: 1px solid currentColor;
}
.pill-ok   { color: var(--ok); }
.pill-warn { color: var(--warn); }
.pill-off  { color: var(--danger); border-color: var(--danger); }

/* The hover detail behind a box (or any .hint). Hover for a mouse, focus for a
   keyboard and for a tap -- which is why every .hint carries tabindex. */
.hint { position: relative; }
.hint:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.hint > .pop {
  display: none;
  position: absolute; z-index: 20;
  top: calc(100% + .4rem); left: 0;
  width: max-content; max-width: min(26rem, 85vw);
  padding: .55rem .75rem;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
  /* Reset what the box itself sets -- a .status host is uppercase and tracked. */
  font-size: .8rem; font-weight: 400; line-height: 1.45;
  text-transform: none; letter-spacing: normal; white-space: normal;
}
.hint > .pop.right { left: auto; right: 0; }
/* Bridges the gap above the popover, so moving the pointer down into it does
   not cross empty space and close it. */
.hint > .pop::before {
  content: ""; position: absolute; left: 0; right: 0; top: -.45rem; height: .45rem;
}
.hint:hover > .pop, .hint:focus > .pop, .hint:focus-within > .pop { display: block; }
.pop ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.pop li { padding: .1rem 0; }
.pop ul:first-child { margin-top: 0; }

/* The help screen. Roomier line height than ol.steps: this one is read once,
   carefully, rather than scanned. */
ol.help, ul.help { margin: .6rem 0 0; padding-left: 1.2rem; font-size: .88rem; line-height: 1.5; }
ol.help li, ul.help li { padding: .3rem 0; }
ol.help .meta, ul.help .meta { display: block; margin-top: .15rem; }

/* --- explanations ---------------------------------------------------------
   Every screen carries more prose than data: why a number means what it means,
   what a button will actually spend, which of two similar columns is the one
   worth watching. All of it is worth reading once and almost none of it twice,
   so it is hidden behind a single switch in the nav rather than left in the
   way of the numbers it is about. `.meta` is what is left visible: the small
   grey line that is still data. */
.help-text { display: none; }
html.help-on .help-text { display: block; }

p.help-text, div.help-text {
  margin: .3rem 0 .9rem;
  font-size: .85rem;
  line-height: 1.5;
  color: var(--muted);
}
/* Prose belongs under the heading it explains, and the heading already carries
   a bottom margin -- without this the two stack into a gap. */
h2 + .help-text, h3 + .help-text { margin-top: -.35rem; }
/* Inside a table cell or a list the switch must not turn a span into a block. */
html.help-on td .help-text, html.help-on .inline .help-text { display: inline; }

/* p.meta had no rule of its own, so a grey aside rendered at full body size and
   read as loudly as the table under it. */
p.meta { margin: .3rem 0 .9rem; font-size: .85rem; color: var(--muted); }
.meta.err { color: var(--danger); }

.help-toggle { margin-left: auto; display: inline-flex; align-items: center; gap: .35rem; }
.help-toggle::before {
  content: "?";
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.05rem; height: 1.05rem; flex: none;
  border: 1px solid currentColor; border-radius: 50%;
  font-size: .68rem; font-weight: 700; line-height: 1;
}
html.help-on .help-toggle { color: var(--accent); }

/* A panel that opens. Used for the setup forms -- an import box is worth one
   line of a screen you are reading, and a whole panel of the one screen where
   you are actually importing. */
details.panel > summary {
  cursor: pointer;
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink);
}
details.panel[open] > summary {
  margin-bottom: .9rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--line);
}
details.panel > summary .meta { font-weight: 400; }

.status-active { color: var(--ok); }
.status-paused, .status-retired { color: var(--danger); }

@media (max-width: 60rem) {
  /* Twelve columns do not fit a phone; scrolling the table beats reflowing it
     into something that cannot be compared row to row. */
  table.scoreboard { display: block; overflow-x: auto; white-space: nowrap; }
}

/* Two panels on one tab of the arm page are two surfaces, not one. */
[data-panel] > .panel + .panel { margin-top: 1rem; }

/* /market: the evidence behind a problem, opened in place. */
table.market details > summary { cursor: pointer; }
table.market ul.evidence { margin: .4rem 0 0; padding-left: 1rem; white-space: normal; min-width: 16rem; max-width: 28rem; }
table.market ul.evidence li { margin-bottom: .25rem; }
