/* ---------------------------------------------------------------------------
   Two screens built for a room, not a desk chair: offer.html (the bank) and
   desk.html (KreditChain's monitoring view).

   These are read from across a table, sometimes projected. So: larger type
   than the rest of the site, generous rows, and state carried by more than
   colour — a projector eats saturation, and a third of a room cannot tell
   your green from your amber anyway.

   Everything here builds on the tokens in styles.css. No new palette.
--------------------------------------------------------------------------- */

/* --- offer.html ---------------------------------------------------------- */

.offer-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 980px) { .offer-split { grid-template-columns: minmax(0, 1fr); } }

.inventory, .ticket-pane > * {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.inventory { overflow: hidden; }

.inv-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.inv-head h2 { font-family: var(--display); font-size: 15px; margin: 0; }
.inv-sub { font-size: 12px; color: var(--faint); }

.inv-list { display: flex; flex-direction: column; }

.inv-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  gap: 12px; align-items: center;
  width: 100%; padding: 12px 16px; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--line);
  cursor: pointer; font: inherit; color: inherit;
}
.inv-row:last-child { border-bottom: 0; }
.inv-row:hover { background: var(--bg-sunk); }
.inv-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Selection is a left bar plus a tint: on a projector the tint alone vanishes. */
.inv-row.is-selected { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }

.inv-ref { font-size: 12px; color: var(--muted); }
.inv-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.inv-title { font-weight: 650; font-size: 14px; }
.inv-meta {
  font-size: 12px; color: var(--faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.inv-right { display: flex; align-items: center; gap: 10px; }
.inv-size { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

.inv-done {
  padding: 24px 16px; display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; color: var(--muted);
}

/* --- the ticket ---------------------------------------------------------- */

.ticket, .ticket-empty, .ticket-done { padding: 20px; }
.ticket-empty, .ticket-done { color: var(--muted); font-size: 14px; }
.ticket-empty h2, .ticket-done h2 { font-family: var(--display); font-size: 16px; margin: 0 0 6px; color: var(--ink); }
.ticket-next { margin-top: 12px; color: var(--faint); font-size: 13px; }

.ticket-head { border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 14px; }
.ticket-head h2 { font-family: var(--display); font-size: 20px; margin: 4px 0 10px; }
.ticket-pills { display: flex; gap: 6px; flex-wrap: wrap; }

.ticket-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px 18px; margin: 0 0 18px;
}
.ticket-facts div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ticket-facts dt { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.ticket-facts dd { margin: 0; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

.ticket-form { border-top: 1px solid var(--line); padding-top: 16px; }
.tf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 12px; }
@media (max-width: 560px) { .tf-row { grid-template-columns: 1fr; } }
.tf-row input {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 16px;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  background: var(--bg-panel); color: var(--ink);
}
.tf-row input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.field-hint { font-size: 11px; color: var(--faint); min-height: 14px; }

.ticket-note { font-size: 13px; color: var(--muted); line-height: 1.55; margin: 4px 0 14px; }
.ticket-err {
  font-size: 13px; color: var(--red); background: var(--red-soft);
  border: 1px solid var(--red); border-radius: var(--radius-s);
  padding: 10px 12px; margin: 0 0 12px;
}
.ticket-small { font-size: 12px; color: var(--faint); margin: 10px 0 0; line-height: 1.5; }
.btn-lg { width: 100%; padding: 13px 18px; font-size: 15px; }

/* --- desk.html ----------------------------------------------------------- */

.desk-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 18px; align-items: start;
}
@media (max-width: 1040px) { .desk-grid { grid-template-columns: minmax(0, 1fr); } }

.panel {
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  margin-bottom: 18px;
}
.panel-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-family: var(--display); font-size: 14px; margin: 0; }
.panel-sub { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.panel-body { padding: 14px 16px; }
.panel-empty { padding: 22px 16px; font-size: 13px; color: var(--faint); }

/* Strip of headline numbers. */
.stat-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 18px;
}
.stat { background: var(--bg-panel); padding: 14px 16px; }
.stat-label { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.stat-value {
  font-family: var(--display); font-size: 22px; font-weight: 700;
  font-variant-numeric: tabular-nums; margin-top: 4px; line-height: 1.15;
}
.stat-note { font-size: 11px; color: var(--faint); margin-top: 2px; }

/* The tape. Monospaced so digits line up as rows stream in. */
.tape { display: flex; flex-direction: column; max-height: 460px; overflow-y: auto; }
.tape-row {
  display: grid; grid-template-columns: 62px 96px minmax(0, 1fr) auto auto;
  gap: 10px; align-items: center;
  padding: 9px 16px; border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.tape-row:last-child { border-bottom: 0; }
.tape-time, .tape-ref { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tape-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tape-units { font-variant-numeric: tabular-nums; color: var(--muted); }
.tape-bps {
  font-variant-numeric: tabular-nums; font-weight: 700;
  font-family: var(--mono); font-size: 14px;
}

/* A bid that is currently winning. Bar + weight + a word, never colour alone. */
.tape-row.is-lead { background: var(--teal-soft); box-shadow: inset 3px 0 0 var(--teal-ink); }
.tape-row.is-lead .tape-bps { color: var(--teal-ink); }
.tape-row.is-filled { background: var(--bg-sunk); }
.tape-tag {
  font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
  font-weight: 700; color: var(--teal-ink);
}
.tape-row.is-filled .tape-tag { color: var(--muted); }

/* A row that has just arrived. One pulse, then it settles — a tape that keeps
   animating is a tape nobody can read. */
@keyframes tape-in {
  from { background: var(--accent-soft); }
  to   { background: transparent; }
}
.tape-row.is-new { animation: tape-in 1.4s ease-out 1; }
@media (prefers-reduced-motion: reduce) { .tape-row.is-new { animation: none; } }

/* Position register. */
.reg-row {
  display: grid; grid-template-columns: 104px minmax(0, 1fr) auto auto;
  gap: 10px; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 13px;
}
.reg-row:last-child { border-bottom: 0; }
.reg-ref { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.reg-num { font-variant-numeric: tabular-nums; font-weight: 600; }

/* Chain and anchor. */
.chain-line { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.chain-hash {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  overflow-wrap: anywhere;
}
.verdict {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 4px 10px; border-radius: 999px; border: 1px solid;
}
.verdict-ok   { color: var(--teal-ink); background: var(--teal-soft); border-color: var(--teal-ink); }
.verdict-bad  { color: var(--red);      background: var(--red-soft);  border-color: var(--red); }
.verdict-wait { color: var(--muted);    background: var(--bg-sunk);   border-color: var(--line-strong); }

.cmd {
  display: block; font-family: var(--mono); font-size: 12px;
  background: var(--bg-sunk); border: 1px solid var(--line);
  border-radius: var(--radius-s); padding: 9px 11px; margin-top: 8px;
  overflow-wrap: anywhere; color: var(--ink-2);
}

.desk-note { font-size: 12px; color: var(--faint); line-height: 1.55; margin: 8px 0 0; }
