/* What this page adds to the two shared style sheets (styles.css, page.css): the form of the checker, the line of
   a stage, the bar and the cells of "Where NEAR stands", the steps of the pipeline. */

:root {
  --s2: #2b7a4b;
  --s1: #7a5a12;
  --s0: #e94322;
  --su: #8f9189;
}

/* ---- the checker ---- */
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.try-card input[type='text'] {
  width: 100%; padding: 11px 14px; border: 0; border-radius: 0; background-color: rgb(255 255 255 / 0.06);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.16); color: #fff; font: 13px/1.5 var(--mono);
}
/* the network switch, in the style of the field and the example buttons */
.seg { display: flex; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.16); }
.seg button {
  padding: 0 14px; border: 0; border-radius: 0; background: transparent; color: rgb(255 255 255 / 0.62);
  font: 12.5px/1 var(--mono); letter-spacing: 0.02em; cursor: pointer;
}
.seg button + button { box-shadow: inset 1px 0 0 rgb(255 255 255 / 0.16); }
.seg button:hover { color: #fff; }
.seg button[aria-checked='true'] { background: var(--orange); color: #fff; box-shadow: none; }
.seg button:focus-visible { outline: 1px solid #fff; outline-offset: -3px; }
.try-card input[type='text']::selection { background: var(--orange); }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 18px; }
.presets button {
  padding: 5px 10px; border: 0; border-radius: 0; background: transparent; color: rgb(255 255 255 / 0.72);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.22); font: 11.5px/1.5 var(--mono);
}
.presets button:hover { color: #fff; box-shadow: inset 0 0 0 1px var(--orange); }
.try-card #exit-status { margin: 16px 0 0; font: 12.5px/1.6 var(--mono); color: rgb(255 255 255 / 0.62); }
.try-card #exit-result { margin-top: 18px; padding-top: 18px; border-top: 1px solid rgb(255 255 255 / 0.28); }
.try-card ul { margin: 12px 0 14px; padding: 0; list-style: none; }
.try-card li { position: relative; padding: 0 0 6px 16px; font-size: 14.5px; line-height: 1.5; color: rgb(255 255 255 / 0.82); }
.try-card li::before { content: ''; position: absolute; left: 0; top: 0.6em; width: 5px; height: 5px; background: var(--orange); }
.try-card #condition { padding: 10px 12px; background: rgb(255 255 255 / 0.05); font-size: 13.5px; color: rgb(255 255 255 / 0.78); }
.try-card pre { max-height: 360px; overflow: auto; font-size: 11.5px; }
.try-card #check-note code { background: rgb(255 255 255 / 0.06); box-shadow: none; color: rgb(255 255 255 / 0.8); }

.try-card .result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 6px; }
.try-card .result-actions .button { margin: 0; }
/* where a line of evidence comes from */
.tag {
  display: inline-block; margin-left: 4px; padding: 1px 6px; vertical-align: 1px; font: 500 10.5px/1.5 var(--mono);
  letter-spacing: 0.04em; color: rgb(255 255 255 / 0.85); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.28); cursor: help;
}
.tag.t-proof { color: #8fd19e; box-shadow: inset 0 0 0 1px rgb(143 209 158 / 0.6); }
.tag.t-name, .tag.t-view { color: #e8c66a; box-shadow: inset 0 0 0 1px rgb(232 198 106 / 0.55); }

/* ---- on mainnet, for agents ---- */
table.txs td:last-child { white-space: nowrap; }
table.txs .lvl { margin-right: 8px; vertical-align: -6px; }
.uses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin-top: 18px; border-top: 1px solid var(--ink); }
.use { min-width: 0; padding: 16px 18px 18px; background: var(--paper); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.use:nth-child(odd) { border-left: 1px solid var(--line); }
.use b { display: block; margin-bottom: 6px; font: 500 17px/1.25 var(--sans); letter-spacing: -0.02em; color: var(--ink-deep); }
.use p { margin: 0 0 10px; max-width: none; font-size: 14px; line-height: 1.5; color: var(--text); }
.use pre { margin: 0; overflow-x: auto; white-space: pre; font-size: 11.5px; }

/* the facts row: a six-digit number stays on one line */
.fact b { white-space: nowrap; }
.fact b.long { display: flex; align-items: flex-end; height: clamp(46px, 4.6vw, 76px); font-size: clamp(34px, 3.4vw, 56px); }

/* ---- the video ---- */
.video-card video { display: block; width: 100%; height: auto; margin-top: 18px; background: var(--ink-deep); }

/* ---- the line of a stage ---- */
.stage-line { display: flex; align-items: center; gap: 12px; margin: 0; font: 500 24px/1.2 var(--sans); letter-spacing: -0.03em; }
.lvl {
  display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 26px; height: 26px; padding: 0 6px;
  background: var(--su); color: #fff; font: 500 13px/1 var(--mono); letter-spacing: 0;
}
.stage-line .lvl { min-width: 34px; height: 34px; font-size: 16px; }
.s2 .lvl, .lvl.l2 { background: var(--s2); }
.s1 .lvl, .lvl.l1 { background: var(--s1); }
.s0 .lvl, .lvl.l0 { background: var(--s0); }
.try-card .s2 { color: #8fd19e; }
.try-card .s1 { color: #e8c66a; }
.try-card .s0 { color: #ff8466; }
.try-card .sU { color: #fff; }
.patch-card .stage-line { margin: 26px 0 10px; }
.patch-card .s2 { color: var(--s2); }
.patch-card .s0 { color: var(--orange-ink); }

/* ---- the table of stages ---- */
table.ladder td:first-child { white-space: nowrap; font-weight: 500; color: var(--ink-deep); }
table.ladder .lvl { margin-right: 8px; vertical-align: -6px; }

/* ---- where NEAR stands ---- */
.bar { display: flex; height: 54px; margin: 6px 0 12px; }
.bar div { display: flex; align-items: center; min-width: 0; padding: 0 16px; overflow: hidden; white-space: nowrap; color: #fff; font: 500 16px/1 var(--sans); letter-spacing: -0.01em; }
.bar .l2 { background: var(--s2); }
.bar .l1 { background: var(--s1); }
.bar .l0 { background: var(--s0); justify-content: center; padding: 0 8px; font-size: 13px; }
.bar .lu { background: var(--su); }
.cells { display: grid; grid-template-columns: repeat(28, minmax(0, 1fr)); gap: 5px; margin: 6px 0 12px; }
.cells i { display: block; height: 30px; background: var(--su); }
.cells .l2 { background: var(--s2); }
.cells .l1 { background: var(--s1); }
.cells .l0 { background: var(--s0); }

/* ---- the pipeline ---- */
.lane-name { margin: 26px 0 8px; font: 400 12px/1.5 var(--mono); letter-spacing: 0.04em; color: var(--muted); }
.lane-name b { margin-right: 8px; font-weight: 500; letter-spacing: 0.1em; color: var(--ink-deep); }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.steps li { padding: 14px 18px 18px; background: var(--paper); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.steps li:first-child { border-left: 1px solid var(--line); }
.steps span { font: 500 11px/1 var(--mono); color: var(--orange); }
.steps b { display: block; margin: 8px 0 6px; font: 500 17px/1.2 var(--sans); letter-spacing: -0.02em; color: var(--ink-deep); }
.steps p { margin: 0; max-width: none; font-size: 14px; line-height: 1.5; color: var(--text); }
.steps .end { background: var(--ink-deep); border-color: var(--ink-deep); }
.steps .end b { color: #fff; }
.steps .end p { color: rgb(255 255 255 / 0.72); }

/* ---- the token form, on paper ---- */
.light-form label { display: block; margin: 18px 0 8px; font: 500 11px/1.5 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.light-form input[type='text'] { width: 100%; padding: 11px 14px; border: 0; border-radius: 0; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-deep); font: 13px/1.5 var(--mono); }
.light-form .presets button { color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.light-form .presets button:hover { color: var(--ink-deep); box-shadow: inset 0 0 0 1px var(--orange); }
#token-report { max-height: 420px; overflow: auto; }

.limits-card ul { margin: 0; padding: 0; list-style: none; }
.limits-card li { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 16px; line-height: 1.6; color: var(--text); }
.limits-card li b { color: var(--ink-deep); }

@media (max-width: 900px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cells { grid-template-columns: repeat(14, minmax(0, 1fr)); }
  .bar div { font-size: 13px; padding: 0 10px; }
}
@media (max-width: 760px) {
  .uses { grid-template-columns: 1fr; }
  .use:nth-child(odd), .use { border-left: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .seg { height: 42px; }
  .seg button { flex: 1; }
}
