/* example.lrs.amtechhq.com — the demonstration site for lead-routing-system.
 *
 * One dark palette, one prose face, one mono face. The mono face is not
 * decoration: it marks every string that came off a wire, so a reader can tell
 * what this page was told from what this page says.
 */

:root {
  --bg:      #0e1013;
  --panel:   #161a1f;
  --panel-2: #1c2128;
  --line:    #272d36;
  --text:    #d8dde3;
  --dim:     #8b939f;
  --dimmer:  #656d78;
  --accent:  #6ea8fe;
  --ok:      #52c07d;
  --warn:    #d7a03c;
  --bad:     #e06c75;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--sans);
}

a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

code, kbd, pre, .mono { font-family: var(--mono); font-size: 0.86em; }

/* ---------- chrome ---------- */

.masthead {
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.masthead-inner {
  max-width: 68rem; margin: 0 auto; padding: 0.75rem 1.25rem;
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: baseline;
}
.masthead .brand {
  font-family: var(--mono); font-size: 0.9rem; color: var(--text);
  font-weight: 600; letter-spacing: 0.01em;
}
.masthead .brand span { color: var(--dimmer); font-weight: 400; }
.masthead nav { display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; }
.masthead nav a { font-family: var(--mono); font-size: 0.82rem; color: var(--dim); }
.masthead nav a[aria-current="page"] { color: var(--text); border-bottom: 2px solid var(--accent); }

main { max-width: 68rem; margin: 0 auto; padding: 2rem 1.25rem 5rem; }

h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 0.4rem; letter-spacing: -0.01em; }
h1 .key { font-family: var(--mono); font-size: 0.95em; }
h2 { font-size: 1.05rem; margin: 2.5rem 0 0.75rem; letter-spacing: -0.005em; }
h3 { font-size: 0.92rem; margin: 1.5rem 0 0.5rem; color: var(--text); }
p { margin: 0 0 0.9rem; max-width: 62ch; }
ul, ol { max-width: 62ch; padding-left: 1.2rem; }
li { margin: 0.3rem 0; }
.lede { font-size: 1.05rem; color: var(--text); max-width: 60ch; }
.dim { color: var(--dim); }
.small { font-size: 0.86rem; }

hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

/* ---------- panels ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  margin: 0 0 1rem;
}
.panel > :last-child { margin-bottom: 0; }
.panel h2, .panel h3 { margin-top: 0; }

.panel-head {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1rem;
  align-items: baseline; justify-content: space-between;
  margin-bottom: 0.75rem;
}
.panel-head h2, .panel-head h3 { margin: 0; }

.note {
  border-left: 3px solid var(--line);
  padding: 0.1rem 0 0.1rem 0.9rem;
  color: var(--dim);
  margin: 0 0 1rem;
}
.note.warn { border-left-color: var(--warn); }
.note.accent { border-left-color: var(--accent); }
.note > :last-child { margin-bottom: 0; }

/* ---------- status ---------- */

.status {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--mono); font-size: 0.8rem;
  padding: 0.15rem 0.5rem; border-radius: 3px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--dim);
  max-width: 100%;
}
.status::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--dimmer); flex: none;
}
.status.is-up    { color: var(--ok);   border-color: rgba(82,192,125,0.4); }
.status.is-up::before { background: var(--ok); }
.status.is-down  { color: var(--bad);  border-color: rgba(224,108,117,0.4); }
.status.is-down::before { background: var(--bad); }
.status.is-blocked { color: var(--warn); border-color: rgba(215,160,60,0.4); }
.status.is-blocked::before { background: var(--warn); }
.status.is-unreachable { color: var(--bad); border-color: rgba(224,108,117,0.4); }
.status.is-unreachable::before { background: var(--bad); }
.status.is-asking::before { background: var(--accent); }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; margin: 0 0 1rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
th, td { text-align: left; padding: 0.5rem 0.75rem 0.5rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--dim); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
td.mono, th.mono { font-family: var(--mono); font-size: 0.82rem; }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- code ---------- */

pre {
  background: #0a0c0f;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.8rem 0.9rem;
  overflow-x: auto;
  margin: 0 0 1rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #c6ccd4;
}
pre .out { color: var(--dim); }
:not(pre) > code {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 3px; padding: 0.05rem 0.3rem;
  /* An inline identifier can be longer than a phone screen is wide, and an
   * unbreakable one pushes the whole page sideways. */
  overflow-wrap: anywhere;
}

/* ---------- system index ---------- */

.systems { list-style: none; padding: 0; margin: 0; max-width: none; }
.systems li {
  display: grid;
  grid-template-columns: 9rem 1fr auto;
  gap: 0.5rem 1rem;
  align-items: baseline;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
}
.systems li:last-child { border-bottom: 0; }
.systems .name { font-family: var(--mono); font-size: 0.9rem; }
.systems .what { color: var(--dim); font-size: 0.9rem; }

/* ---------- the fraud form ---------- */

.cols { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 1rem; align-items: start; }

form.seller { display: grid; gap: 0.75rem; }
form.seller .row { display: grid; gap: 0.25rem; }
form.seller label { font-size: 0.82rem; color: var(--dim); }
form.seller input, form.seller select, form.seller textarea {
  font: inherit; font-size: 0.9rem;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 4px;
  padding: 0.45rem 0.55rem; width: 100%;
}
form.seller input:focus, form.seller select:focus, form.seller textarea:focus {
  outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent);
}
form.seller textarea { min-height: 4.5rem; resize: vertical; }
.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

button, .btn {
  font: inherit; font-size: 0.86rem;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 4px;
  padding: 0.45rem 0.8rem; cursor: pointer;
}
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #08101d; font-weight: 600; }
button.primary:hover { filter: brightness(1.08); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ---------- the live monitor ---------- */

/* The monitor rides beside the form rather than under it: the form is what a
 * reader acts on and the log is what they read while acting, so putting the log
 * out of view is putting the evidence out of view. It is sticky and capped to
 * the viewport so it scrolls ITSELF -- an unbounded log grew the document every
 * time a request landed, which is precisely the moment somebody is trying to
 * read the previous one. */
.cols > .monitor {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 2rem);
}
.wire-head { margin-top: 1.25rem; margin-bottom: 0.5rem; }
.wire-controls { display: flex; align-items: center; gap: 0.65rem; }
.wire-scroll {
  flex: 1 1 auto; min-height: 9rem; overflow-y: auto;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 0 0.1rem;
}
/* A paused pane looks paused. Nothing is dropped while it is held -- the count
 * in the button is the proof -- so the border is a state marker, not a warning. */
.wire-scroll.paused { border-color: var(--warn); }
#wire-pause[aria-pressed="true"] { border-color: var(--warn); color: var(--warn); }

.wire { list-style: none; padding: 0; margin: 0; max-width: none; }
.wire li {
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0; margin: 0;
  font-family: var(--mono); font-size: 0.78rem;
}
.wire li:last-child { border-bottom: 0; }
.wire .line { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; }
.wire .verb { color: var(--accent); min-width: 3.4rem; }
.wire .verb.get { color: var(--warn); }
/* The path gets its own full-width line (order pushes it last in the flex row)
 * so a 32-character session key never wraps through the middle of the word
 * after it. The verb, the status and the offset stay together above it. */
.wire .path { color: var(--text); overflow-wrap: anywhere; flex: 1 1 100%; order: 10; }
.wire .code { color: var(--dim); }
.wire .code.ok { color: var(--ok); }
.wire .code.bad { color: var(--bad); }
.wire .when { color: var(--dimmer); margin-left: auto; }
.wire .body {
  margin: 0.4rem 0 0; white-space: pre-wrap; word-break: break-word;
  color: var(--dim); background: #0a0c0f; border: 1px solid var(--line);
  border-radius: 4px; padding: 0.5rem 0.6rem; max-height: 16rem; overflow: auto;
}
.wire .empty { color: var(--dimmer); }

.kv { list-style: none; padding: 0; margin: 0; max-width: none; }
.kv li { display: grid; grid-template-columns: 11rem 1fr; gap: 0.5rem 1rem; padding: 0.35rem 0; border-bottom: 1px solid var(--line); margin: 0; font-size: 0.85rem; }
.kv li:last-child { border-bottom: 0; }
.kv .k { color: var(--dim); }
.kv .v { font-family: var(--mono); font-size: 0.8rem; word-break: break-all; }

footer {
  border-top: 1px solid var(--line);
  margin-top: 4rem; padding: 1.5rem 1.25rem 3rem;
  color: var(--dimmer); font-size: 0.82rem;
}
footer .inner { max-width: 68rem; margin: 0 auto; }
footer p { max-width: 68ch; }

@media (max-width: 46rem) {
  .cols { grid-template-columns: 1fr; }
  /* One column: a sticky pane capped to the viewport would sit on top of the
   * form it is meant to explain, so it goes back to flowing with the page. */
  .cols > .monitor { position: static; max-height: none; display: block; }
  .wire-scroll { max-height: 60vh; }
  .systems li { grid-template-columns: 1fr; gap: 0.15rem; }
  .kv li { grid-template-columns: 1fr; gap: 0.1rem; }
  .two-up { grid-template-columns: 1fr; }
}
