/* ==========================================================================
   pages.css — the components only some documents need: figures, the symbol
   table, the interactive silo, the check list, the state table.
   ========================================================================== */

/* ---- figures ------------------------------------------------------------- */
.figure {
  border: var(--rule) solid var(--plate2);
  border-radius: var(--r);
  background: var(--ground2);
  overflow: hidden;
  min-width: 0;
}
.figure > .head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  padding: 12px 16px;
  border-bottom: var(--rule) solid var(--plate2);
  background: var(--plate);
}
.figure > .head .t {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--ink3);
}
.figure > .head .t b { color: var(--ink); font-weight: 500; }
.figure .plot { padding: 16px; }
.figure svg { display: block; width: 100%; height: auto; overflow: visible; }
.figure figcaption {
  padding: 0 16px 16px;
  font-size: 14px;
  color: var(--ink3);
  max-width: 70ch;
}
.figure figcaption b { color: var(--ink2); }

/* Chart primitives, so a line is a line everywhere on the site. */
.ax { stroke: var(--plate2); stroke-width: 1; }
.grid-l { stroke: var(--plate2); stroke-width: 1; stroke-dasharray: 2 4; opacity: .8; }
.tk { fill: var(--faint); font-family: var(--font-mono); font-size: 10.5px; }
.tk.mid { text-anchor: middle; }
.tk.end { text-anchor: end; }
.ser { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ser.alt { stroke: var(--vent); }
.ser.arrest { stroke: var(--oxide); }
.ser.ghost { stroke: var(--faint); stroke-width: 1.5; stroke-dasharray: 4 4; }
.pt { fill: var(--accent); }
.pt.alt { fill: var(--vent); }
.band { fill: var(--accent); opacity: .13; }
.band.dead { fill: var(--faint); opacity: .10; }
.lbl { fill: var(--ink3); font-family: var(--font-mono); font-size: 11px; }
.lbl.strong { fill: var(--ink); }

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 0 16px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink3);
}
.legend-row span { display: inline-flex; align-items: center; gap: 7px; }
.legend-row i { font-style: normal; width: 16px; height: 2px; background: currentColor; display: inline-block; }
.legend-row .a { color: var(--accent); }
.legend-row .b { color: var(--vent); }
.legend-row .c { color: var(--faint); }
.legend-row .d { color: var(--oxide); }

/* ---- the interactive silo ------------------------------------------------ */
.lab {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: clamp(18px, 2.5vw, 30px);
  align-items: start;
}
@media (max-width: 880px) { .lab { grid-template-columns: minmax(0, 1fr); } }

.controls { display: grid; gap: 16px; }
.ctl label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink3);
  margin-bottom: 7px;
}
.ctl label b { color: var(--ink); font-family: var(--font-mono); font-weight: 500; font-size: 13px; }
.ctl input[type="range"] {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 2px;
  background: var(--plate2);
  border-radius: 2px;
  outline-offset: 6px;
}
.ctl input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--accent-mark);
  cursor: pointer;
  border: 0;
}
.ctl input[type="range"]::-moz-range-thumb {
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--accent-mark);
  cursor: pointer;
  border: 0;
}
.readout {
  border: var(--rule) solid var(--plate2);
  border-radius: var(--r);
  background: var(--plate);
  padding: 14px 16px;
}

/* ---- checks -------------------------------------------------------------- */
.checks { list-style: none; margin: 0; padding: 0; }
.checks li {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  gap: 12px;
  padding: .62em 0;
  border-bottom: var(--rule) dotted var(--plate2);
  align-items: baseline;
  font-size: 15px;
}
.checks .v {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--accent);
}
.checks .v.bad { color: var(--oxide); }
.checks .d {
  display: block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink3);
  margin-top: .2em;
  overflow-wrap: anywhere;
}

/* ---- symbol table (the design-code fixture) ------------------------------ */
.symbols td:first-child,
.symbols th:first-child { white-space: nowrap; font-family: var(--font-mono); color: var(--ink); }
.symbols td:nth-child(2) { font-family: var(--font-mono); color: var(--ink3); white-space: nowrap; }

/* ---- state table --------------------------------------------------------- */
.state-row { border-bottom: var(--rule) solid var(--plate2); padding: clamp(16px, 2vw, 22px) 0; }
.state-row:last-child { border-bottom: 0; }
.state-row .top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin-bottom: .55em;
}
.state-row h3 { margin: 0; font-size: 20px; }
.state-row .where { font-family: var(--font-mono); font-size: 12.5px; color: var(--faint); }
.badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .22em .55em;
  border-radius: var(--r-sm);
  border: var(--rule) solid currentColor;
}
.badge.live { color: var(--vent); }
.badge.tested { color: var(--husk); }
.badge.none { color: var(--oxide); }
.state-row .how {
  margin-top: .7em;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink3);
  padding-left: 14px;
  border-left: 2px solid var(--plate2);
  max-width: 72ch;
}

/* ---- lexicon ------------------------------------------------------------- */
.lex { border-top: var(--rule) solid var(--plate2); }
.lex .entry { border-bottom: var(--rule) solid var(--plate2); padding: clamp(18px, 2.2vw, 26px) 0; }
.lex .entry .top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 16px; }
.lex .entry h3 { margin: 0; font-size: 22px; }
.lex .entry .was { font-family: var(--font-mono); font-size: 12.5px; color: var(--faint); }
.lex .entry .short { color: var(--accent); font-size: 16px; margin: .5em 0 .6em; max-width: none; }
.lex .entry p { font-size: 15.5px; color: var(--ink2); }

/* ---- the grind ramp ------------------------------------------------------ */
.ramp { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 1px; background: var(--plate2); border: var(--rule) solid var(--plate2); border-radius: var(--r); overflow: hidden; }
.ramp > div { padding: 0; min-width: 0; }
.ramp .sw { height: 62px; display: block; }
.ramp .meta { padding: 9px 11px; background: var(--ground2); font-family: var(--font-mono); font-size: 11px; color: var(--ink3); line-height: 1.55; }
.ramp .meta b { display: block; color: var(--ink); font-weight: 500; }

/* ---- token table --------------------------------------------------------- */
.tok .sym { font-family: var(--font-mono); color: var(--ink); }
.tok .addr { font-family: var(--font-mono); font-size: 12px; color: var(--faint); overflow-wrap: anywhere; }

/* ---- live panel ---------------------------------------------------------- */
.live .status {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink3);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: center;
}
.live .status .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--vent);
  display: inline-block;
}
.live .status .dot.idle { background: var(--faint); }
.live .status .dot.bad { background: var(--oxide); }

/* ---- prose lists --------------------------------------------------------- */
/* Plain list items. NOT grid, NOT flex — see the note in base.css. */
.prose-list { list-style: none; margin: 1.2em 0; padding: 0; }
.prose-list li {
  padding: .6em 0 .6em 26px;
  border-bottom: var(--rule) dotted var(--plate2);
  position: relative;
  font-size: 15.5px;
  color: var(--ink2);
}
.prose-list li::before {
  content: '';
  position: absolute; left: 4px; top: 1.05em;
  width: 10px; height: var(--rule);
  background: var(--accent);
}
.prose-list li b { color: var(--ink); }

/* ---- code blocks --------------------------------------------------------- */
pre {
  background: var(--deep);
  border: var(--rule) solid var(--plate2);
  border-radius: var(--r);
  padding: 14px 16px;
  overflow-x: auto;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.62;
  color: var(--ink2);
}
pre code { background: transparent; padding: 0; color: inherit; }

/* ---- 404 ----------------------------------------------------------------- */
.gone { min-height: 56vh; display: grid; place-content: center; text-align: center; }
.gone p { margin-inline: auto; }

/* ---- the app ------------------------------------------------------------- */
.field { display: flex; gap: 8px; margin-top: 14px; align-items: stretch; }
.field input {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--deep);
  border: var(--rule) solid var(--plate2);
  border-radius: var(--r);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 9px 12px;
}
.field input::placeholder { color: var(--faint); }
.field .btn { flex: 0 0 auto; }

.mono, .mono a { font-family: var(--font-mono); font-size: 12.5px; overflow-wrap: anywhere; }

.log { max-height: 320px; overflow-y: auto; }
.logrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink3);
  padding: .45em 0;
  border-bottom: var(--rule) dotted var(--plate2);
  overflow-wrap: anywhere;
}
.logrow:last-child { border-bottom: 0; }
.logrow.bad { color: var(--oxide); }

button[disabled] { opacity: .45; cursor: not-allowed; }
