/* ==========================================================================
   Certalyn console

   A paper ground, one ink, one green. The page reads like a printed record
   rather than a dashboard: hairlines instead of floating cards, a serif for
   the statements, a mono for anything the chain produced.
   ========================================================================== */

/* ---------- The typefaces ------------------------------------------------ */

@font-face {
  font-family: "Certalyn Display";
  src: url("vendor/fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Certalyn Sans";
  src: url("vendor/fonts/inter-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Certalyn Sans";
  src: url("vendor/fonts/inter-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Certalyn Mono";
  src: url("vendor/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Certalyn Mono";
  src: url("vendor/fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- The tokens --------------------------------------------------- */

:root {
  /* Paper */
  --paper: #f4f1e8;
  --paper-2: #eae6d8;
  --panel: #fbf9f3;
  --panel-2: #f0ece0;

  /* Ink */
  --ink: #1b1a15;
  --ink-2: #3c3a31;
  --muted: #6d695b;

  /* The one accent */
  --jade: #175e42;
  --jade-strong: #0f3f2c;
  --jade-soft: #e2ece5;
  --jade-line: rgba(23, 94, 66, 0.28);

  /* States */
  --amber: #8a5c0c;
  --amber-soft: #f6ecd8;
  --oxblood: #93362c;
  --oxblood-soft: #f4e5e2;

  /* Rules */
  --line: rgba(27, 26, 21, 0.12);
  --line-soft: rgba(27, 26, 21, 0.07);
  --line-strong: rgba(27, 26, 21, 0.22);

  /* Type */
  --serif: "Certalyn Display", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Certalyn Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Certalyn Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Space, on a 4px grid */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s7: 32px;
  --s8: 40px;
  --s9: 56px;
  --s10: 72px;

  --radius: 4px;
  --radius-lg: 8px;
  --measure: 1240px;
  --sidebar: 248px;
  /* The height of the top bar. Everything that sits under it reads this, so
     the bar can change size without anything drifting under it. */
  --topbar-h: 60px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --lift: 0 1px 2px rgba(27, 26, 21, 0.04), 0 18px 40px -28px rgba(27, 26, 21, 0.45);

  /* The display scale. The size follows the viewport, so the line never
     jumps between breakpoints. */
  --display: clamp(40px, 4.8vw, 68px);
  --display-2: clamp(26px, 2.3vw, 34px);
  --display-3: clamp(21px, 1.7vw, 25px);
  /* The width of a line of prose. A measure under sixty characters is
     readable, and every reading column on the site uses it. */
  --measure-text: 58ch;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: calc(var(--topbar-h) + 36px);
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.58;
  -webkit-text-size-adjust: 100%;
}

/* A transaction hash or an address is one long word. It has to be allowed
   to break, or it pushes the page sideways on a phone. */
main {
  overflow-wrap: break-word;
}

/* The page is a sheet of paper: a faint dot grid over the cream. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, rgba(27, 26, 21, 0.055) 0 1px, transparent 1.6px);
  background-size: 7px 7px;
}

body {
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: var(--jade);
  text-decoration: none;
  border-bottom: 1px solid var(--jade-line);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

a:hover {
  border-bottom-color: var(--jade);
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--jade);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: var(--s3) var(--s4);
  z-index: 90;
}

.skip-link:focus {
  left: var(--s4);
  top: var(--s4);
}

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

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;

  color: var(--muted);
}

.kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.01em;

  color: var(--jade);
}

/* ---------- The top bar --------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: var(--s5);
  padding: 0 var(--s6);
  height: var(--topbar-h);
  background: rgba(244, 241, 232, 0.92);
  backdrop-filter: blur(12px) saturate(1.1);
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

/* The deployment name can be long. It is cut with an ellipsis instead of
   widening the bar, because the bar is the width of the screen. */
#deployment-label {
  max-width: 26ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: normal;
  color: var(--ink);
  border: 0;
}

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

.mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 3px;
  background: var(--jade);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 15px;
}

.topnav {
  display: flex;
  gap: var(--s5);
  margin-left: var(--s4);
}

.topnav a {
  font-size: 14px;
  color: var(--ink-2);
  border: 0;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

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

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

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-width: 0;
}

/* ---------- The shell ----------------------------------------------------- */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  gap: 0;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--s6);
}

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  height: calc(100vh - var(--topbar-h));
  padding: var(--s7) var(--s5) var(--s7) 0;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: var(--s6);
  /* A grid item will not shrink below its content unless it is told to.
     Without this the section links push the whole page sideways on a
     phone, because the navigation is wider than the screen. */
  min-width: 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sidebar-nav a {
  display: flex;
  align-items: baseline;
  gap: var(--s3);
  padding: var(--s2) var(--s3);
  border: 0;
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--ink-2);
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.sidebar-nav a:hover {
  background: var(--panel-2);
  color: var(--ink);
}

.sidebar-nav a[aria-current="page"] {
  background: var(--jade-soft);
  color: var(--jade-strong);
}

.sidebar-nav .index {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.sidebar-note {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: var(--s4);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.sidebar-note .value {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  word-break: break-all;
}

main {
  min-width: 0;
  padding: var(--s7) 0 var(--s9) var(--s8);
}

/* ---------- Sections ------------------------------------------------------ */

.view {
  animation: rise 0.5s var(--ease) both;
}

.view[hidden] {
  display: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.section {
  padding: var(--s8) 0;
  border-top: 1px solid var(--line);
}

.section:first-child {
  border-top: 0;
  padding-top: 0;
}

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--display-2);
  line-height: 1.12;
  letter-spacing: -0.022em;
}

.section-lead {
  max-width: var(--measure-text);
  color: var(--ink-2);
  margin-top: var(--s3);
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s5);
  margin-bottom: var(--s5);
  flex-wrap: wrap;
}

.panel-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 19px;
  letter-spacing: normal;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--s6);
}

/* Graph paper on the panels that carry records. */
.panel-head {
  margin-bottom: var(--s5);
}

.panel,
.wallet-card,
.decision {
  position: relative;
}

/* ---------- The hero ------------------------------------------------------ */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: var(--s9);
  align-items: start;
  padding-bottom: var(--s8);
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--display);
  line-height: 1.02;
  letter-spacing: -0.032em;
  margin: var(--s4) 0 var(--s5);
  max-width: 17ch;
}

.hero h1 em {
  display: block;
  font-style: normal;
  color: var(--jade);
}

.lead {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 56ch;
}

.cta {
  display: flex;
  gap: var(--s3);
  margin: var(--s6) 0;
  flex-wrap: wrap;
}

.proof {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s3);
  max-width: 56ch;
}

.proof li {
  position: relative;
  padding-left: var(--s6);
  font-size: 14px;
  color: var(--ink-2);
}

.proof li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 14px;
  height: 1px;
  background: var(--jade);
}

/* The cap meter: the one component that carries the product. */
.wallet-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--s6);
  box-shadow: var(--lift);
  background-image: linear-gradient(rgba(160, 140, 90, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(160, 140, 90, 0.09) 1px, transparent 1px);
  background-size: 22px 22px;
}

.wallet-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
}

.wallet-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.01em;

  color: var(--muted);
}

.chip {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.01em;

  padding: 3px var(--s2);
  border-radius: 3px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.chip.green {
  color: var(--jade-strong);
  background: var(--jade-soft);
  border-color: var(--jade-line);
}

.wallet-name {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
  margin-top: var(--s5);
  word-break: break-all;
}

.wallet-amount {
  font-family: var(--serif);
  font-size: clamp(34px, 3.4vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-top: var(--s2);
  font-variant-numeric: tabular-nums;
}

.wallet-budget-note {
  font-size: 13px;
  color: var(--muted);
  margin-top: var(--s2);
}

.budget-bar {
  position: relative;
  height: 10px;
  margin-top: var(--s4);
  background: var(--panel-2);
  border-radius: 999px;
  overflow: hidden;
}

.budget-fill {
  height: 100%;
  width: 100%;
  background: var(--jade);
  border-radius: 999px;
  transition: width 0.6s var(--ease);
}

/* The ticks at a quarter and three quarters of the cap. */
.budget-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(90deg, transparent 49.6%, rgba(251, 249, 243, 0.85) 49.6% 50.4%, transparent 50.4%),
    linear-gradient(90deg, transparent 74.6%, rgba(251, 249, 243, 0.85) 74.6% 75.4%, transparent 75.4%);
}

.wallet-meta {
  margin-top: var(--s5);
  border-top: 1px solid var(--line-soft);
}

.wallet-meta > div {
  display: flex;
  justify-content: space-between;
  gap: var(--s4);
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--line-soft);
}

.meta-label {
  font-size: 13px;
  color: var(--muted);
}

.meta-value {
  font-family: var(--mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.wallet-footer {
  margin-top: var(--s4);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--jade);
  display: inline-block;
}

.dot.small {
  width: 6px;
  height: 6px;
}

/* ---------- The entrance ---------------------------------------------------- */

/* One entrance, used with a delay per element. The page settles once when it
   opens and never moves on its own again. */
.enter {
  animation: settle 0.62s var(--ease) both;
  animation-delay: var(--d, 0ms);
}

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Buttons -------------------------------------------------------- */

.button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: 9px var(--s4);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  transition: transform 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease),
    color 0.18s var(--ease);
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button.primary {
  background: var(--jade);
  border-color: var(--jade);
  color: #fbf9f3;
}

.button.primary:hover {
  background: var(--jade-strong);
  border-color: var(--jade-strong);
}

.button.ghost,
.ghost-button {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.button.ghost:hover,
.ghost-button:hover {
  border-color: var(--ink);
  background: var(--panel);
}

.ghost-button:disabled,
.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.copy-button {
  font-family: var(--mono);
  font-size: 12px;
  padding: 5px var(--s3);
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}

.copy-button:hover {
  background: var(--panel);
  border-color: var(--ink);
}

/* ---------- The stats ----------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.stat {
  background: var(--panel);
  padding: var(--s4) var(--s5);
}

.stat-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;

  color: var(--muted);
}

/* The one figure that matters carries the accent. The rest of the grid is
   quiet numbers in a printed table. */
.stat.primary .stat-value {
  color: var(--jade);
}

.stat-value {
  font-family: var(--mono);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: normal;
  margin-top: var(--s2);
}

.stat-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.governed {
  grid-column: 1 / -1;
  background: var(--panel);
  padding: var(--s3) var(--s5);
  font-size: 13px;
  color: var(--muted);
}

/* ---------- The feed (decisions) ------------------------------------------ */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: var(--s7);
  align-items: start;
}

.feed {
  display: flex;
  flex-direction: column;
}

.decision {
  border-top: 1px solid var(--line);
  padding: var(--s4) 0 var(--s4) var(--s4);
  box-shadow: inset 3px 0 0 var(--tone, transparent);
  transition: background 0.18s var(--ease);
}

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

/* The state of a decision is a colour on the margin rule, and the badge
   carries the same colour, so a reader can scan the feed without reading a
   word. The colour is never the only cue: the badge names the state too. */
.decision[data-tone="approved"] {
  --tone: var(--jade);
}

.decision[data-tone="denied"],
.decision[data-tone="failed"] {
  --tone: var(--oxblood);
}

.decision[data-tone="pending"],
.decision[data-tone="flagged"],
.decision[data-tone="settling"] {
  --tone: var(--amber);
}

.decision[data-tone="expired"] {
  --tone: var(--line-strong);
}

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

.decision-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
}

.decision-id {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  border: 0;
}

.decision-id:hover {
  color: var(--jade);
}

.decision-vendor {
  font-size: 12px;
  color: var(--ink-2);
}

.decision-amount {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.decision-meta {
  display: flex;
  gap: var(--s4);
  flex-wrap: wrap;
  margin-top: var(--s2);
  font-size: 12px;
  color: var(--muted);
}

.decision-meta .memo {
  color: var(--ink-2);
}

.decision-link {
  font-size: 13px;
}

.decision-actions {
  display: flex;
  gap: var(--s2);
  margin-top: var(--s3);
}

.pill {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.01em;

  padding: 2px var(--s2);
  border-radius: 3px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--panel-2);
}

.pill.approved {
  color: var(--jade-strong);
  background: var(--jade-soft);
  border-color: var(--jade-line);
}

.pill.denied,
.pill.failed {
  color: var(--oxblood);
  background: var(--oxblood-soft);
  border-color: rgba(147, 54, 44, 0.25);
}

.pill.flagged,
.pill.pending,
.pill.settling {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: rgba(138, 92, 12, 0.25);
}

/* A request that was closed without a decision and a receipt that says so.
   It is neither a refusal nor a payment, so it gets its own quiet tone. */
.pill.expired {
  color: var(--muted);
  background: var(--panel);
  border-color: var(--line-soft);
  border-style: dashed;
}

.receipt {
  margin-top: var(--s3);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.receipt > summary {
  cursor: pointer;
  padding: var(--s2) var(--s3);
  font-size: 13px;
  color: var(--muted);
  list-style: none;
  transition: color 0.18s var(--ease);
}

.receipt > summary:hover {
  color: var(--ink);
}

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

.receipt > summary::before {
  content: "+ ";
  font-family: var(--mono);
}

.receipt[open] > summary::before {
  content: "− ";
}

.receipt-body {
  padding: var(--s3);
  border-top: 1px solid var(--line-soft);
}

.row {
  display: flex;
  justify-content: space-between;
  gap: var(--s4);
  padding: var(--s1) 0;
}

.row-label {
  font-size: 12px;
  color: var(--muted);
}

.row-value {
  font-size: 13px;
  text-align: right;
  word-break: break-word;
}

.row-note {
  font-size: 12px;
  color: var(--muted);
  padding-bottom: var(--s2);
}

.evidence {
  margin: var(--s2) 0 0;
  padding-left: var(--s5);
  font-size: 12px;
  color: var(--ink-2);
}

/* ---------- The policy table ---------------------------------------------- */

.policy-table {
  display: grid;
  gap: 0;
}

.policy-table .row {
  border-bottom: 1px solid var(--line-soft);
  padding: var(--s3) 0;
}

.policy-kill {
  margin-top: var(--s5);
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-2);
}

/* ---------- Charts -------------------------------------------------------- */

.bars {
  display: grid;
  gap: var(--s2);
}

.bar-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
}

.bar-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.bar-track {
  height: 6px;
  background: var(--panel-2);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--jade);
  border-radius: 999px;
}

.bar-value {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

/* ---------- Filters ------------------------------------------------------- */

.filter-row {
  display: flex;
  gap: var(--s2);
  align-items: center;
  flex-wrap: wrap;
  padding-bottom: var(--s4);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--s2);
}

.chip-button {
  font-family: var(--mono);
  font-size: 12px;
  padding: 4px var(--s3);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}

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

.chip-button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.filter-input,
.field-input {
  font: inherit;
  font-size: 14px;
  padding: 7px var(--s3);
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink);
  min-width: 180px;
}

.filter-input:focus,
.field-input:focus {
  outline: 2px solid var(--jade);
  outline-offset: 1px;
}

/* ---------- Fields -------------------------------------------------------- */

.deployment-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s4);
}

.field {
  display: grid;
  gap: var(--s1);
}

.field-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;

  color: var(--muted);
}

.field-hint {
  font-size: 12px;
  color: var(--muted);
}

/* ---------- The steps ----------------------------------------------------- */

.steps {
  list-style: none;
  margin: var(--s7) 0 0;
  padding: 0;
  counter-reset: step;
  border-top: 1px solid var(--line);
}

.step {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: var(--s5);
  padding: var(--s6) 0;
  border-bottom: 1px solid var(--line);
}

.step-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--jade);
  padding-top: 3px;
}

.step-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: normal;
}

.step-body p {
  color: var(--ink-2);
  max-width: 62ch;
  margin-top: var(--s2);
}

.step-code,
.code-block {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  background: var(--ink);
  color: #e9e5d8;
  padding: var(--s4);
  border-radius: var(--radius);
  overflow-x: auto;
  margin: var(--s4) 0 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- The judge evidence -------------------------------------------- */

.judge-body {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--s6);
}

.evidence-notes {
  margin: var(--s3) 0 0;
  padding-left: var(--s5);
  font-size: 14px;
  color: var(--ink-2);
}

/* ---------- The protocol list --------------------------------------------- */

.protocol-item {
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--line-soft);
}

.protocol-item:last-child {
  border-bottom: 0;
}

.protocol-intent {
  font-size: 13px;
  font-weight: 500;
}

.protocol-error {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--oxblood);
  margin-top: 2px;
  word-break: break-word;
}

/* ---------- The modal ----------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(27, 26, 21, 0.42);
  display: grid;
  place-items: center;
  padding: var(--s5);
  animation: fade 0.2s var(--ease) both;
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--lift);
  padding: var(--s6);
  width: min(520px, 100%);
  max-height: 84vh;
  overflow-y: auto;
  animation: rise 0.28s var(--ease) both;
}

.modal-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: normal;
}

.modal-body {
  margin-top: var(--s4);
}

.modal-status {
  margin-top: var(--s4);
  font-size: 13px;
  color: var(--muted);
  min-height: 20px;
}

.modal-body .button {
  margin-top: var(--s4);
}

.confirm-body {
  display: grid;
  gap: var(--s3);
}

.confirm-fact {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: var(--s3);
  font-size: 14px;
}

.confirm-label {
  color: var(--muted);
}

.confirm-value {
  font-family: var(--mono);
  font-size: 13px;
  word-break: break-word;
}

.confirm-reason {
  width: 100%;
  font: inherit;
  font-size: 14px;
  padding: var(--s2) var(--s3);
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--ink);
}

.confirm-buttons {
  display: flex;
  gap: var(--s2);
  justify-content: flex-end;
  margin-top: var(--s4);
}

/* ---------- The wallet picker --------------------------------------------- */

.wallet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--s3);
}

.wallet-option {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), transform 0.18s var(--ease);
}

.wallet-option:hover:not(:disabled) {
  border-color: var(--jade);
  transform: translateY(-1px);
}

.wallet-option:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.wallet-icon {
  width: 28px;
  height: 28px;
  border-radius: 4px;
}

.wallet-text {
  display: grid;
  gap: 1px;
}

.wallet-name {
  font-size: 14px;
  font-weight: 500;
}

.wallet-description,
.wallet-note {
  font-size: 12px;
  color: var(--muted);
}

.wallet-grid-unavailable {
  opacity: 0.75;
}

.wallet-subtitle {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.01em;

  color: var(--muted);
  margin: var(--s5) 0 var(--s2);
}

/* ---------- The share row ------------------------------------------------- */

.share-row {
  display: flex;
  gap: var(--s2);
  margin-top: var(--s5);
}

.share-link {
  flex: 1;
  font-family: var(--mono);
  font-size: 12px;
  padding: 7px var(--s3);
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--ink-2);
}

/* ---------- Empty, skeleton, error ----------------------------------------- */

.empty-state {
  color: var(--muted);
  font-size: 14px;
  padding: var(--s5) 0;
}

.skeletons {
  display: grid;
  gap: var(--s2);
}

.skeleton {
  height: 48px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--panel-2) 25%, var(--paper-2) 37%, var(--panel-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}

@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}

.error-bar {
  position: sticky;
  top: var(--topbar-h);
  z-index: 55;
  padding: var(--s3) var(--s6);
  background: var(--oxblood-soft);
  border-bottom: 1px solid rgba(147, 54, 44, 0.3);
  color: var(--oxblood);
  font-size: 14px;
}

.error-summary {
  border: 1px solid rgba(147, 54, 44, 0.3);
  background: var(--oxblood-soft);
  color: var(--oxblood);
  border-radius: var(--radius);
  padding: var(--s3) var(--s4);
  font-size: 13px;
  margin-bottom: var(--s3);
}

/* ---------- The deployment panel ------------------------------------------ */

.deployment-panel {
  position: sticky;
  top: 60px;
  z-index: 50;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: var(--s6);
}

.deployment-inner {
  max-width: var(--measure);
  margin: 0 auto;
}

/* ---------- The footer ---------------------------------------------------- */

footer {
  border-top: 1px solid var(--line);
  margin-top: var(--s9);
  background: var(--paper-2);
}

.footer-top,
.footer-links,
.footer-note {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--s6);
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--s8);
  padding-top: var(--s8);
  padding-bottom: var(--s6);
}

.footer-brand {
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: normal;
}

.footer-top p {
  color: var(--ink-2);
  font-size: 14px;
  max-width: 52ch;
  margin-top: var(--s3);
}

.footer-links {
  display: flex;
  gap: var(--s5);
  flex-wrap: wrap;
  padding-bottom: var(--s6);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.footer-note {
  display: flex;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
  padding-top: var(--s4);
  padding-bottom: var(--s8);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ---------- The setup ------------------------------------------------------ */

/* The setup is a long read. The rail names the phases and stays with the
   reader while the commands scroll past. */
.setup-layout {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: var(--s8);
  align-items: start;
  margin-top: var(--s6);
}

.setup-rail {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding-right: var(--s4);
  border-right: 1px solid var(--line);
}

.rail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rail-link {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: color 0.18s var(--ease);
}

.rail-link:hover {
  color: var(--jade);
}

.rail-note {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

.phase-head {
  margin-top: var(--s8);
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
  scroll-margin-top: 84px;
}

.phase-head:first-child {
  margin-top: var(--s7);
}

.phase-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--display-3);
  letter-spacing: normal;
}

.phase-note {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

/* ---------- The narrow screen --------------------------------------------- */

@media (min-width: 900px) {
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1040px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    padding: 0 var(--s5);
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: var(--s4) 0;
    flex-direction: row;
    align-items: center;
    gap: var(--s4);
    overflow-x: hidden;
  }

  /* On a narrow screen the sections sit in one row and the row scrolls. The
     navigation is the scroller, so the links never widen the page. */
  .sidebar-nav {
    flex-direction: row;
    gap: var(--s1);
    flex: 1 1 auto;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .sidebar-nav::-webkit-scrollbar {
    display: none;
  }

  /* The row scrolls, so the edge fades to say so. */
  .sidebar-nav {
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 28px), transparent 100%);
    mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 28px), transparent 100%);
  }

  .sidebar-nav a {
    white-space: nowrap;
  }

  .sidebar-note {
    display: none;
  }

  main {
    padding: var(--s6) 0 var(--s8);
  }

  .hero,
  .split,
  .footer-top {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s6);
  }

  .topnav {
    display: none;
  }

  .setup-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s5);
  }

  .setup-rail {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--s2) var(--s5);
    padding-right: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: var(--s4);
  }

  .rail-item {
    flex-direction: row;
    align-items: baseline;
    gap: var(--s2);
  }
}

@media (max-width: 720px) {
  :root {
    --topbar-h: 56px;
  }

  .topbar {
    height: var(--topbar-h);
    padding: 0 var(--s4);
    gap: var(--s3);
  }

  .topbar-right {
    gap: var(--s2);
  }

  #deployment-label {
    max-width: 13ch;
  }

  /* The bar is the width of the screen. The word on the wallet button and,
   * on the narrowest screens, the word on the brand give way first. */
  .wide-only {
    display: none;
  }

  .hero h1 {
    font-size: clamp(30px, 8.4vw, 40px);
  }

  .section {
    padding: var(--s7) 0;
  }
}

@media (max-width: 480px) {
  /* On the narrowest screens the deployment name gives way. The mark beside
     it still opens the deployment panel, and the name is in the panel. */
  #deployment-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
