/* Lambo session window (T8.5).
 *
 * Self-contained on purpose: no CDN, no webfont, no build step. The whole
 * stylesheet is embedded in the binary via include_str!, so the page renders
 * identically on a laptop and on a stripped AWS host with no egress. */

:root {
  --bg:        #0d1013;
  --panel:     #14181d;
  --panel-2:   #1a1f26;
  --line:      #262d36;
  --ink:       #dde3ea;
  --ink-dim:   #8a95a3;
  --ink-faint: #5b6673;
  --accent:    #6ea8fe;
  --warn:      #e0a458;
  --good:      #6ec592;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 14px;
  line-height: 1.5;
}

/* ---- bars ---------------------------------------------------------- */

.bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.foot {
  border-bottom: none;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-dim);
}

.spacer { flex: 1; }

.brand { display: flex; align-items: baseline; gap: 8px; }

.mark {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.sub { color: var(--ink-faint); font-size: 12px; }

.ident { display: flex; align-items: baseline; gap: 6px; min-width: 0; }

.label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.ident .value {
  font-family: var(--mono);
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 40vw;
}

.chips { display: flex; gap: 6px; flex-wrap: wrap; }

.chip {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-dim);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 7px;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-radius: 3px;
  padding: 3px 8px;
  border: 1px solid;
}

.badge.readonly {
  color: var(--good);
  border-color: #2c4d3c;
  background: #15221b;
}

/* ---- banners ------------------------------------------------------- */

.banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 18px;
  font-size: 13px;
  background: #241d12;
  color: #f0d3a8;
  border-bottom: 1px solid #3d3120;
}

.banner .glyph { color: var(--warn); flex: none; }

.banner code {
  font-family: var(--mono);
  background: rgba(0, 0, 0, 0.3);
  padding: 0 4px;
  border-radius: 2px;
}

/* ---- layout -------------------------------------------------------- */

main {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  gap: 16px;
  padding: 16px 18px;
  align-items: start;
}

@media (max-width: 900px) {
  main { grid-template-columns: minmax(0, 1fr); }
}

.side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 14px 16px 16px;
  min-width: 0;
}

.panel h2 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-dim);
}

.count {
  font-family: var(--mono);
  color: var(--ink-faint);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.note { margin: 0 0 12px; color: var(--ink-faint); font-size: 12.5px; }
.note em { color: var(--ink-dim); font-style: normal; }
.glyph { color: var(--warn); }

/* ---- recall -------------------------------------------------------- */

#recall-form { display: flex; gap: 8px; margin-bottom: 10px; }

#recall-query {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
}

#recall-query:focus { outline: none; border-color: var(--accent); }
#recall-query::placeholder { color: var(--ink-faint); }

#recall-go {
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  cursor: pointer;
}

#recall-go:disabled { opacity: 0.5; cursor: default; }

.meta {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-faint);
  min-height: 17px;
  margin-bottom: 6px;
}

.context {
  margin: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px;
  min-height: 260px;
  max-height: 60vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  tab-size: 2;
}

.context.waiting, .context.idle { color: var(--ink-faint); }
.context.failed { color: var(--warn); }

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

.tiles {
  display: grid;
  /* Wide enough for the longest label (TRANSITIONS) at this letter-spacing.
     At 84px it clipped to CANONIC... and TRANSITI..., which made two of the
     six numbers unreadable. */
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.tile {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
}

.tile .k {
  display: block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-faint);
  margin-bottom: 2px;
  /* Wrap rather than ellipsis: a truncated label is worse than a two-line one,
     because the reader cannot tell which number they are looking at. */
  white-space: normal;
}

.tile .v {
  font-family: var(--mono);
  font-size: 17px;
  color: var(--ink);
}

.tile.na .v { color: var(--ink-faint); font-size: 15px; }
.tile.bumped { border-color: var(--accent); }

/* ---- event feed ---------------------------------------------------- */

.events { list-style: none; margin: 0; padding: 0; max-height: 44vh; overflow: auto; }

.events li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
}

.events li:first-child { border-top: none; }

.events .at {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-faint);
  padding-top: 1px;
  white-space: nowrap;
}

.events .what {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
  word-break: break-word;
}

.events .move {
  grid-column: 2;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-dim);
}

.events .to-canonical { color: var(--good); }
.events .demotion { color: var(--warn); }
.events .radius { color: var(--ink-faint); }

.events li.fresh { animation: land 1.6s ease-out; }

@keyframes land {
  from { background: rgba(110, 168, 254, 0.14); }
  to   { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .events li.fresh { animation: none; }
}

.empty { margin: 0; color: var(--ink-faint); font-size: 12.5px; }
.empty.hidden { display: none; }

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

.status { font-family: var(--mono); }
.status.live::before  { content: "● "; color: var(--good); }
.status.stale::before { content: "● "; color: var(--warn); }
.muted { color: var(--ink-faint); font-family: var(--mono); }


/* ---- intro -------------------------------------------------------------
   A judge arrives here knowing nothing about Lambo. Without this the page is
   a session window addressed to someone who already understands it. */

.panel.intro { grid-column: 1 / -1; }

.intro h1 {
  font-size: 21px;
  line-height: 1.25;
  margin: 0 0 8px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.intro .lede {
  margin: 0 0 16px;
  max-width: 68ch;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-dim, var(--ink));
}

.intro .cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.intro .cols h3 {
  margin: 0 0 5px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-faint);
}

.intro .cols p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-dim, var(--ink));
}

/* ---- suggested queries -------------------------------------------------
   An empty text box asks the reader to guess what this understands. These are
   the three questions the exhibit is actually about. */

.suggest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
}

.suggest-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-faint);
  margin-right: 2px;
}

.chip-q {
  font: inherit;
  font-size: 12.5px;
  color: var(--ink-dim, var(--ink));
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
  cursor: pointer;
}

.chip-q:hover { border-color: var(--accent, #6aa9ff); color: var(--ink); }
.chip-q:focus-visible { outline: 2px solid var(--accent, #6aa9ff); outline-offset: 2px; }

/* ---- header facts ------------------------------------------------------
   The bar used to read `store: cockroach  embedder: bge_m3 / 1024d  hybrid
   recall`, which is the internal vocabulary. Same values, labelled. */

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: baseline;
  margin-left: 22px;
}

.fact { display: flex; flex-direction: column; gap: 1px; }

.fact-k {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.fact-v {
  font-size: 12.5px;
  color: var(--ink);
  font-family: var(--mono);
}

/* ---- live strip --------------------------------------------------------
   Connection state belongs above the fold, not in the footer. */

.livestrip {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 9px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 13.5px;
}

.livestrip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-faint);
  align-self: center;
}

.livestrip.live .dot { background: #35c46a; box-shadow: 0 0 0 3px rgba(53, 196, 106, 0.16); }
.livestrip.stale .dot { background: #d8a13a; }
.livestrip.dead .dot { background: #d85a5a; }

.livestrip strong { color: var(--ink); font-weight: 600; }
.livestrip .live-detail { color: var(--ink-faint); }

/* ---- trust ladder ------------------------------------------------------ */

.rungs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.rung {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 4px;
  padding: 9px 11px;
  background: var(--panel-2);
}

.rung[data-status="Venerable"] { border-left-color: #7d8ff0; }
.rung[data-status="Canonical"] { border-left-color: #35c46a; }

.rung-head { display: flex; align-items: baseline; gap: 8px; }

.rung-n {
  font-family: var(--mono);
  font-size: 19px;
  color: var(--ink);
  min-width: 1.4em;
}

.rung-name {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink);
}

.rung-why {
  margin: 3px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-faint);
}

.rung-list { list-style: none; margin: 7px 0 0; padding: 0; display: grid; gap: 3px; }

.rung-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
}

.rl-blast { color: var(--ink-faint); white-space: nowrap; }
.rl-none { color: var(--ink-faint); font-style: italic; font-family: inherit; }

/* ---- stat tile hints --------------------------------------------------- */

.tile .h {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--ink-faint);
}

.note.micro { font-size: 11.5px; }

/* The audit trail is the page's evidence, and in a single column it left a
   dead half-width gap beside the sidebar. It spans the grid instead. */
.panel.feed { grid-column: 1 / -1; }
