/*
 * The operational view, in the CBA console palette.
 *
 * Deliberately quieter than the payment console. That screen is an instrument with a diagram, an
 * envelope meter and an actor map, because it is showing a choreography with many parties. This one
 * shows a single agent working through seven decisions in order, so the shape is a ladder and the
 * only ornament is the state of each rung.
 */
:root {
  --bg: #04120f;
  --panel: #08201b;
  --panel-2: #0a2a22;
  --line: rgba(127, 184, 168, .22);
  --line-strong: rgba(127, 184, 168, .42);
  --ink: #e8f5f1;
  --ink-dim: #9fc4b9;
  --ink-quiet: #7ba396;
  --ok: #57d6a4;
  --wait: #e8c46a;
  --no: #ef7a72;
  --raidiam: #8fd0ff;
  --radius: 12px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 940px; margin: 0 auto; padding: 0 22px; }

.top { border-bottom: 1px solid var(--line); background: rgba(4, 18, 15, .9); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(8px); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 62px; }
.brand { display: flex; align-items: baseline; gap: 10px; font-weight: 620; letter-spacing: -.01em; }
.brand .mark { width: 12px; height: 12px; border-radius: 3px; background: linear-gradient(135deg, var(--ok), var(--raidiam)); display: inline-block; }
.brand .sub { font-weight: 400; font-size: 12.5px; color: var(--ink-quiet); }

.stamp { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-dim); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; }
.stamp .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.stamp.replay .dot { background: var(--wait); }

.lede { padding: 40px 0 26px; }
.lede h1 { font-size: 27px; line-height: 1.25; margin: 0 0 14px; letter-spacing: -.02em; }
.lede p { margin: 0 0 12px; color: var(--ink-dim); max-width: 68ch; }
.quiet { color: var(--ink-quiet); font-size: 13.5px; }

.cap { font-size: 11.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-quiet); margin-bottom: 9px; }

.identity { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 16px 18px; margin-bottom: 26px; }
.idrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 22px; }
.who { font-weight: 620; }
.mono { font-family: var(--mono); }
.tiny { font-size: 11.5px; color: var(--ink-quiet); word-break: break-all; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-family: var(--mono); font-size: 11.5px; border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; color: var(--ink-dim); }

.jobs { margin-bottom: 26px; }
.joblist { display: grid; gap: 10px; }
.job { text-align: left; width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: inherit; font: inherit; cursor: pointer; transition: border-color .14s, background .14s; }
.job:hover:not(:disabled) { border-color: var(--line-strong); background: var(--panel-2); }
.job:disabled { opacity: .5; cursor: not-allowed; }
.job .jt { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; }
.job .jd { color: var(--ink-quiet); font-size: 13.5px; margin-top: 5px; max-width: 74ch; }
.job .need { font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--wait); border: 1px solid rgba(232, 196, 106, .35); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }

.runwrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 16px 18px 18px; margin-bottom: 26px; }
.runhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.verdict { font-size: 12.5px; color: var(--ink-quiet); }
.verdict.ok { color: var(--ok); }
.verdict.no { color: var(--no); }
.verdict.busy { color: var(--wait); }

.ladder { list-style: none; margin: 6px 0 0; padding: 0; }
.ladder .empty { color: var(--ink-quiet); font-size: 13.5px; padding: 10px 0; }

.rung { border-top: 1px solid var(--line); padding: 13px 0 13px 30px; position: relative; }
.rung:first-child { border-top: 0; }
.rung::before { content: ""; position: absolute; left: 7px; top: 19px; width: 9px; height: 9px; border-radius: 50%; background: var(--ink-quiet); }
.rung.ok::before { background: var(--ok); }
.rung.no::before { background: var(--no); }
/* The connecting line, so seven decisions read as one sequence rather than seven cards. */
.rung::after { content: ""; position: absolute; left: 11px; top: 28px; bottom: -13px; width: 1px; background: var(--line); }
.rung:last-child::after { display: none; }

.rt { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rname { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-quiet); }
.rtitle { font-weight: 600; margin-top: 2px; }
.rdetail { color: var(--ink-dim); font-size: 13.5px; margin-top: 3px; max-width: 76ch; }

.tag { font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; border-radius: 999px; padding: 3px 8px; white-space: nowrap; border: 1px solid var(--line); color: var(--ink-quiet); }
.tag.raidiam { color: var(--raidiam); border-color: rgba(143, 208, 255, .4); }
.tag.reference { color: var(--ink-dim); }
.tag.standard { color: var(--ok); border-color: rgba(87, 214, 164, .35); }

details.ev { margin-top: 9px; }
details.ev > summary { cursor: pointer; font-size: 12.5px; color: var(--ink-quiet); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.ev > summary::-webkit-details-marker { display: none; }
details.ev > summary::before { content: "▸"; font-size: 10px; transition: transform .12s; }
details.ev[open] > summary::before { transform: rotate(90deg); }
details.ev > summary:hover { color: var(--ink-dim); }
details.ev pre { margin: 9px 0 0; padding: 12px 13px; background: #030d0b; border: 1px solid var(--line); border-radius: 8px; font-family: var(--mono); font-size: 11.5px; line-height: 1.55; color: var(--ink-dim); overflow-x: auto; max-height: 340px; }

.result { margin-top: 14px; padding: 13px 15px; border: 1px solid rgba(87, 214, 164, .3); border-radius: 10px; background: rgba(87, 214, 164, .05); }
.result .cap { color: var(--ok); }
.result pre { margin: 0; font-family: var(--mono); font-size: 12px; color: var(--ink-dim); overflow-x: auto; max-height: 300px; }

.boundary { border-top: 1px solid var(--line); padding: 22px 0 50px; }
.legend { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 9px; }
.legend li { display: flex; align-items: baseline; gap: 10px; font-size: 13.5px; color: var(--ink-dim); flex-wrap: wrap; }

@media (max-width: 720px) {
  .idrow { grid-template-columns: 1fr; gap: 16px; }
  .lede h1 { font-size: 23px; }
  .rt { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* who approves, and where they do it */
.approver { display: grid; gap: 6px; margin-bottom: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.approver label { font-weight: 700; font-size: 14px; }
.approver select { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: inherit; max-width: 100%; }
.approve { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 6px; }
.approve-link { display: inline-block; justify-self: start; font-weight: 700; padding: 9px 14px; border-radius: 8px; border: 1px solid currentColor; text-decoration: none; }
.rung.handoff { border-left: 3px solid var(--line); }
