/* tradingrs console: Ticket and Blotter.
   The desk's paper. Form furniture (rules, captions, headings) is printed in one spot
   ink; what is written on the form (figures, names) is black. Tickets are coloured stock
   by kind. Violet is time-clock ink: every as-of stamp. Red stock is what needs the
   operator. No textures, no rotation, no handwriting: flat colour, screen-native controls. */

:root {
  color-scheme: light;

  /* paper */
  --ground: #e9ece8;        /* bond: the desk the forms lie on */
  --sheet: #fbfcfa;         /* a printed form */
  --sheet-2: #f3f5f1;       /* a form's shaded field (headers, stubs) */

  /* inks */
  --ink: #141716;           /* written: figures, names */
  --ink-2: #4a514e;         /* written, secondary */
  --spot: #1f5566;          /* printed: the form's own ink */
  --spot-2: #4f7a87;        /* printed, light: captions on stock */
  --rule: #b9c9cc;          /* printed rule */
  --rule-2: #d8e2e3;        /* printed hairline */
  --stamp: #5a3ea8;         /* time-clock violet */
  --up: #22663a;
  --down: #a3341c;

  /* stock */
  --buy: #dde9f5;   --buy-edge: #7ea3c9;   --buy-ink: #173c63;
  --sell: #f8e0d6;  --sell-edge: #d39a83;  --sell-ink: #6b2a14;
  --ops: #f6edbf;   --ops-edge: #c9b764;   --ops-ink: #4f430f;
  --alert: #f7d6d2; --alert-edge: #c9564a; --alert-ink: #7d1610;
  --clear: #dcecdf; --clear-edge: #86b493; --clear-ink: #1d4f2b;

  --focus: #2563d9;

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --r: 3px;
  --gap: 1rem;
  --page: 88rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ground: #101413;
    --sheet: #181d1c;
    --sheet-2: #1f2524;
    --ink: #e6ebe9;
    --ink-2: #a6b0ad;
    --spot: #8fc2d0;
    --spot-2: #6f9aa6;
    --rule: #34474b;
    --rule-2: #26302f;
    --stamp: #b9a3f2;
    --up: #6cc487;
    --down: #f08a6e;
    --buy: #1a2a3b;   --buy-edge: #3d628a;   --buy-ink: #bcd6f2;
    --sell: #3a231b;  --sell-edge: #8a4f3a;  --sell-ink: #f4c9b7;
    --ops: #332e14;   --ops-edge: #7f7330;   --ops-ink: #efe2a0;
    --alert: #3d1b18; --alert-edge: #b5473c; --alert-ink: #ffc9c2;
    --clear: #17301f; --clear-edge: #3f7a52; --clear-ink: #bfe5c9;
    --focus: #7aa7ff;
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 0.9375rem/1.45 var(--sans);
  font-variant-numeric: tabular-nums;
}

a { color: var(--spot); text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

h1, h2, h3 { color: var(--spot); margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font-size: 1.375rem; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 1rem; font-weight: 650; }
h3 { font-size: 0.875rem; font-weight: 650; }

/* ---------- masthead and index tabs ---------- */

.masthead {
  background: var(--sheet);
  border-bottom: 1px solid var(--rule);
}
.masthead__inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: stretch;
  gap: 1.5rem;
  min-height: 3rem;
}
.wordmark {
  align-self: center;
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--spot);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.wordmark span { color: var(--ink-2); font-weight: 500; }

.nav { display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 550;
  font-size: 0.875rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--spot); border-bottom-color: var(--spot); }

.who__out { margin: 0; }
.who a { color: var(--ink-2); font-weight: 550; text-decoration: none; }
.who a:hover, .who a[aria-current="page"] { color: var(--spot); }
.who {
  align-self: center;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--ink-2);
  white-space: nowrap;
}

/* ---------- page ---------- */

.page {
  max-width: var(--page);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  display: grid;
  gap: 1.75rem;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
}
.page-head__meta { color: var(--ink-2); font-size: 0.875rem; }

.section { display: grid; gap: 0.625rem; }
.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
}
.section__note { color: var(--ink-2); font-size: 0.8125rem; }

/* ---------- the time-clock stamp ---------- */

.stamp {
  display: inline-block;
  font: 500 0.6875rem/1.5 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--stamp);
  border: 1px solid color-mix(in srgb, var(--stamp) 55%, transparent);
  border-radius: 2px;
  padding: 0 0.3rem;
  white-space: nowrap;
}
.stamp--stale { color: var(--down); border-color: color-mix(in srgb, var(--down) 55%, transparent); }

/* ---------- the printed form: boxes that share their rules ---------- */

.form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));   /* room for a figure on one line */
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  overflow: hidden;
}
.form--wide { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }

.box {
  background: var(--sheet);
  border-left: 1px solid var(--rule);   /* shared printed rules: each box draws its left */
  border-top: 1px solid var(--rule);    /* and top, overlapping its neighbour's edge */
  margin: -1px 0 0 -1px;
  padding: 0.5rem 0.75rem 0.625rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5.5rem;
  grid-template-areas: "cap spark" "val val" "sub sub";
  grid-row: span 3;
  grid-template-rows: subgrid;   /* a row of boxes shares its caption, figure and sub lines */
  align-items: end;
  column-gap: 0.5rem;
  min-height: 5rem;
  color: inherit;
  text-decoration: none;
}
a.box:hover { background: var(--sheet-2); }
.box__cap {
  grid-area: cap;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--spot);
  align-self: start;
}
.box__val {
  grid-area: val;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin-top: 0.375rem;
  white-space: nowrap;
}
.box__sub { grid-area: sub; font-size: 0.8125rem; color: var(--ink-2); white-space: normal; text-wrap: balance; }
.box__spark { grid-area: spark; width: 100%; height: 1.25rem; align-self: start; display: block; }
.box:not(:has(.box__spark)) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "cap" "val" "sub"; }
.box--quiet .box__val { font-size: 1.125rem; }

.up { color: var(--up); }
.down { color: var(--down); }

/* ---------- tickets: coloured stock with a tear-off stub ---------- */

.tickets { display: grid; gap: 0.5rem; }

.ticket {
  --stock: var(--ops); --edge: var(--ops-edge); --tink: var(--ops-ink);
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr) auto;
  background: var(--stock);
  border: 1px solid var(--edge);
  border-radius: var(--r);
  color: var(--tink);
}
.ticket--alert { --stock: var(--alert); --edge: var(--alert-edge); --tink: var(--alert-ink); }
.ticket--buy   { --stock: var(--buy);   --edge: var(--buy-edge);   --tink: var(--buy-ink); }
.ticket--sell  { --stock: var(--sell);  --edge: var(--sell-edge);  --tink: var(--sell-ink); }
.ticket--clear { --stock: var(--clear); --edge: var(--clear-edge); --tink: var(--clear-ink); }

.ticket__stub {
  padding: 0.625rem 0.75rem;
  border-right: 1px dashed var(--edge);   /* the perforation */
  display: grid;
  align-content: start;
  gap: 0.25rem;
}
.ticket__kind {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.ticket__no { font: 500 0.75rem/1.3 var(--mono); opacity: 0.8; }
.ticket__stub .stamp { white-space: normal; justify-self: start; }
.ticket__body { padding: 0.625rem 0.875rem; display: grid; gap: 0.25rem; min-width: 0; }
.ticket__what { font-weight: 650; color: var(--tink); }
.ticket__todo { font-size: 0.875rem; color: color-mix(in srgb, var(--tink) 82%, var(--stock)); }
.ticket__act { padding: 0.625rem 0.75rem; display: flex; align-items: center; gap: 0.5rem; }

.ticket--line { grid-template-columns: auto 1fr auto; }
.ticket--line .ticket__stub { border-right: 0; padding-right: 0; }

/* ---------- the blotter: ruled lines, stamp in the margin ---------- */

.blotter-wrap {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  overflow-x: auto;
}
/* a blotter that can run long scrolls inside itself, so its sticky head holds */
.blotter-wrap--tall { max-height: 75vh; overflow: auto; }
.blotter { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.blotter caption { text-align: left; padding: 0.625rem 0.75rem 0.25rem; }
.blotter th {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--spot);
  text-align: left;
  padding: 0.5rem 0.75rem;
  background: var(--sheet-2);
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.blotter td {
  padding: 0.4375rem 0.75rem;
  border-bottom: 1px solid var(--rule-2);
  vertical-align: baseline;
}
.blotter tbody tr:last-child td { border-bottom: 0; }
.blotter tbody tr:hover td { background: color-mix(in srgb, var(--sheet-2) 70%, transparent); }
.blotter .num, .blotter th.num { text-align: right; white-space: nowrap; }
.blotter .when { font: 500 0.75rem/1.4 var(--mono); color: var(--stamp); white-space: nowrap; width: 1%; }
.blotter .name { font-weight: 600; white-space: nowrap; }
.blotter tfoot td {
  font-weight: 650;
  border-top: 3px double var(--rule);
  border-bottom: 0;
  background: var(--sheet-2);
}
.blotter .muted { color: var(--ink-2); }
/* a sortable column: its head is a link; the sorted one carries its arrow */
.blotter th a { color: inherit; text-decoration: none; }
.blotter th a:hover { color: var(--ink); }
.blotter th[aria-sort="descending"] a::after { content: " ↓"; }
.blotter th[aria-sort="ascending"] a::after { content: " ↑"; }

/* ---------- a figure: a titled chart panel ---------- */

.figure {
  margin: 0;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 0.625rem 0.75rem 0.5rem;
  display: grid;
  gap: 0.375rem;
}
.figure__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.figures { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); }

/* ---------- the chart module's svg (web/src/chart.rs) ---------- */

.chart { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--sans); }
.chart.narrow { display: none; }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .grid.major { opacity: 0.7; }
.chart .grid.minor { opacity: 0.3; stroke-dasharray: 3 3; }
.chart .label { fill: var(--ink-2); font-size: 11px; }
.chart .label.x { text-anchor: middle; }
.chart .label.y { text-anchor: end; }
.chart .axis { stroke: var(--rule); }
.chart .axis.zero { stroke: var(--spot-2); }
.chart .line { fill: none; stroke: var(--spot); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.series-1 { stroke: var(--ink-2); stroke-dasharray: 4 3; stroke-width: 1.25; }
.chart .line.series-2 { stroke: var(--ink-2); stroke-dasharray: 1 3; stroke-width: 1.25; }  /* printed ink, dotted: violet is time only */
.chart .area { fill: color-mix(in srgb, var(--spot) 12%, transparent); }
.chart .bar.positive { fill: var(--up); }
.chart .bar.negative { fill: var(--down); }
.chart .legend { fill: var(--ink-2); font-size: 11px; text-anchor: end; paint-order: stroke; stroke: var(--sheet); stroke-width: 4px; stroke-linejoin: round; }
.chart .legend.series-0 { fill: var(--spot); }
.chart .empty { fill: var(--ink-2); font-size: 12px; text-anchor: middle; }
.chart.sparkline { width: 100%; height: 100%; }
.chart.sparkline .line { stroke: var(--spot-2); stroke-width: 1.25; }
.chart.qr { width: 11rem; height: 11rem; }
.chart.qr .qr-light { fill: #fff; }
.chart.qr .qr-dark { fill: #000; }

/* ---------- controls ---------- */

.btn {
  font: 600 0.875rem/1 var(--sans);
  padding: 0.5625rem 0.875rem;
  border-radius: var(--r);
  border: 1px solid var(--spot);
  background: var(--spot);
  color: var(--sheet);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  white-space: nowrap;
}
.btn:hover { background: color-mix(in srgb, var(--spot) 85%, var(--ink)); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--spot); }
.btn--ghost:hover { background: var(--sheet-2); }
.btn--stop { background: var(--alert-edge); border-color: var(--alert-edge); color: #fff; }
.btn--stop:hover { background: var(--alert-ink); }
.btn--small { padding: 0.375rem 0.625rem; font-size: 0.8125rem; }

.field { display: grid; gap: 0.25rem; }
.field__cap {
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--spot);
}
.input, select.input, textarea.input {
  font: 400 0.9375rem/1.3 var(--sans);
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 0.5rem 0.625rem;
  min-width: 0;
}
.input:focus { border-color: var(--spot); outline: 2px solid color-mix(in srgb, var(--focus) 40%, transparent); outline-offset: 0; }
.input[aria-invalid="true"] { border-color: var(--down); }
.field__err { font-size: 0.8125rem; color: var(--down); }

.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.seg a, .seg button {
  font: 550 0.8125rem/1 var(--sans);
  padding: 0.4375rem 0.625rem;
  color: var(--ink-2);
  background: var(--sheet);
  border: 0;
  border-right: 1px solid var(--rule);
  text-decoration: none;
  cursor: pointer;
}
.seg > :last-child { border-right: 0; }
.seg [aria-current="true"], .seg [aria-pressed="true"] { background: var(--spot); color: var(--sheet); }

.btn--danger { color: var(--down); border-color: color-mix(in srgb, var(--down) 50%, transparent); }
.btn--danger:hover { background: var(--alert); color: var(--alert-ink); }
.input--cell { padding: 0.3125rem 0.5rem; font-size: 0.875rem; width: 14rem; max-width: 100%; }
.input--link { width: 100%; font: 500 0.8125rem/1.3 var(--mono); }
.inline { display: inline-flex; flex-wrap: wrap; gap: 0.375rem; align-items: center; margin: 0; }
.tag {
  display: inline-block;
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--spot);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0 0.3rem;
  margin-left: 0.25rem;
  vertical-align: 0.1em;
}
.blotter .browser { max-width: 32rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr { margin: 0.25rem 0 0; display: grid; gap: 0.25rem; justify-items: start; }

/* ---------- a slip: a page that is one ticket (sign in, add a passkey, a message) ---------- */

.slip { max-width: 40rem; width: 100%; margin: 3rem auto 0; }
.slip h1 { font-size: 1.25rem; margin-bottom: 0.125rem; }
.slip__form { display: grid; gap: 0.75rem; margin-top: 0.75rem; justify-items: start; }
.slip__form .field { width: 100%; }
.ticket--plain { --stock: var(--sheet); --edge: var(--rule); --tink: var(--ink); }
.ticket--plain .ticket__kind { color: var(--spot); }
.ticket--plain .ticket__todo { color: var(--ink-2); }

/* ---------- notices (what was just done, or refused) ---------- */

.notice.done { background: var(--clear); border-color: var(--clear-edge); color: var(--clear-ink); }
.notice.refused { background: var(--alert); border-color: var(--alert-edge); color: var(--alert-ink); }
.notice[hidden] { display: none; }
.page > .notice { margin: 0; }

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

.split { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.stack { display: grid; gap: var(--gap); }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; }
.muted { color: var(--ink-2); }
.small { font-size: 0.8125rem; }
.mono { font-family: var(--mono); font-size: 0.875em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.notice { padding: 0.625rem 0.875rem; border-radius: var(--r); border: 1px solid var(--rule); background: var(--sheet); }

/* the commit moment: a ticket filed takes the time-clock impression */
@keyframes impress {
  from { transform: scale(1.35); opacity: 0; filter: blur(2px); }
  60%  { transform: scale(0.96); opacity: 1; filter: blur(0); }
  to   { transform: scale(1); }
}
.stamp--impress { animation: impress 320ms cubic-bezier(0.16, 1, 0.3, 1) both; }
@media (prefers-reduced-motion: reduce) { .stamp--impress { animation: none; } }

/* ---------- phone ---------- */

@media (max-width: 52rem) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .figures { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 40rem) {
  body { font-size: 0.9375rem; }
  .masthead__inner { padding: 0 0.75rem; gap: 0.75rem; flex-wrap: wrap; }
  .wordmark { padding-top: 0.625rem; }
  .who { padding-top: 0.625rem; margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; margin: 0 -0.75rem; padding: 0 0.5rem; min-height: 2.5rem; }
  .page { padding: 1rem 0.75rem 3rem; gap: 1.25rem; }
  .form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .box { min-height: 4.5rem; padding: 0.5rem 0.625rem; }
  .box__val { font-size: 1.25rem; }
  .box { grid-template-columns: minmax(0, 1fr) 3.5rem; }
  .ticket { grid-template-columns: 1fr; }
  .ticket__stub { border-right: 0; border-bottom: 1px dashed var(--edge); grid-auto-flow: column; justify-content: space-between; align-items: center; }
  .ticket__act { padding-top: 0; }
  .blotter .hide-sm { display: none; }
  .blotter-wrap--tall { max-height: none; }
  .chart.wide { display: none; }
  .chart.narrow { display: block; }
}

/* ---------- portfolio (/portfolio, /portfolio/{ticker}, its part of Today) ---------- */

/* Two figures a row on a desk, one on a phone; a lone figure keeps a column's width. */
.portfolio .figures { grid-template-columns: repeat(auto-fill, minmax(min(100%, 30rem), 1fr)); }

/* ---------- market (/market, /market/snapshots, /market/{ticker}, /market/symbols) ---------- */

.market-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 0.5rem 0.75rem; margin: 0; }
.market-bar .field { min-width: 0; }
.market-bar__date .input { width: 10.5rem; }
.market-bar__num .input { width: 8rem; }
.market-bar__q .input { width: 9rem; text-transform: uppercase; }
.market-bar > .small { align-self: center; }
.market-bar__links { margin-left: auto; display: flex; gap: 0.75rem; align-items: center; }
.market-trends { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.market-movers { display: grid; gap: var(--gap); grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.market-groups { flex-wrap: wrap; justify-self: start; }
.market-register .blotter td, .market-register .blotter th { padding-left: 0.5rem; padding-right: 0.5rem; }
.market-register .blotter th:first-child, .market-register .blotter td:first-child { position: sticky; left: 0; z-index: 1; background: var(--sheet); }
.market-register .blotter th:first-child { z-index: 2; background: var(--sheet-2); }
.market-register .type { white-space: nowrap; }
.market-fields { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.5rem 0.75rem; }
.market-bulk { width: 100%; font: 500 0.875rem/1.4 var(--mono); text-transform: uppercase; }

@media (max-width: 52rem) {
  .market-trends, .market-movers { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 40rem) {
  .market-bar__links { margin-left: 0; flex-basis: 100%; }
  .market-bar .field { flex: 1 1 8rem; }
  .market-bar__date .input, .market-bar__num .input, .market-bar__q .input { width: 100%; }
}

/* ---------- pipeline (web/templates/pipeline/) ---------- */

.pipeline-tabs { justify-self: start; max-width: 100%; overflow-x: auto; }
.status {
  display: inline-block;
  font: 600 0.6875rem/1.5 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0 0.3rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--ink-2);
}
.status--fail, .status--page { color: var(--alert-ink); background: var(--alert); border-color: var(--alert-edge); }
.status--warn, .status--notice { color: var(--ops-ink); background: var(--ops); border-color: var(--ops-edge); }
.status--ok { color: var(--clear-ink); border-color: var(--clear-edge); }
.cli {
  margin: 0;
  padding: 0.625rem 0.75rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  font: 400 0.8125rem/1.5 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.checks summary { cursor: pointer; color: var(--spot); font-size: 0.8125rem; padding: 0.375rem 0; }
.configure .fields { display: grid; gap: 0.5rem 0.75rem; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
.input--short { width: 6rem; }
@media (max-width: 40rem) {
  .configure .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- options (/options, /options/{ticker}, /options/pairs, the ticket) ---------- */

.options-controls { align-items: end; }
.input--num { width: 7.5rem; }
.input--ticker { width: 7rem; text-transform: uppercase; }

.chain { font-size: 0.8125rem; }
.chain td, .chain th { padding: 0.3125rem 0.5rem; }
.chain .chain__side { text-align: center; border-bottom: 1px solid var(--rule-2); }
.chain .chain__strike { background: var(--sheet-2); color: var(--ink); font-weight: 650; text-align: center; border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); }
.chain thead .chain__strike { color: var(--spot); vertical-align: bottom; }
.chain tbody .chain__strike { font: 650 0.8125rem/1.3 var(--sans); letter-spacing: 0; text-transform: none; position: static; }
.chain .itm { background: color-mix(in srgb, var(--spot) 9%, transparent); }
.chain .chain__atm td, .chain .chain__atm th { border-top: 2px solid var(--spot); border-bottom: 2px solid var(--spot); }
.chain td a { color: var(--ink); text-decoration-color: var(--rule); }
.chain td a:hover { color: var(--spot); text-decoration-color: currentColor; }
.chain .picked { outline: 2px solid var(--spot); outline-offset: -2px; font-weight: 650; }

.seg--radio { justify-self: start; }
.seg--radio label { display: inline-flex; cursor: pointer; border-right: 1px solid var(--rule); }
.seg--radio label:last-child { border-right: 0; }
.seg--radio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg--radio span { font: 550 0.8125rem/1 var(--sans); padding: 0.4375rem 0.75rem; color: var(--ink-2); background: var(--sheet); text-transform: capitalize; }
.seg--radio input:checked + span { background: var(--spot); color: var(--sheet); }
.seg--radio input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: -2px; }
.seg--radio .is-disabled { cursor: not-allowed; opacity: 0.45; }

.order-ticket .ticket__body { gap: 0.625rem; }
.order-ticket fieldset { border: 0; margin: 0; padding: 0; }
.order-ticket__order { display: grid; gap: 0.5rem; padding-top: 0.5rem; border-top: 1px dashed var(--edge); }
.order-ticket__legs { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.375rem; }
.order-ticket__legs li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.75rem; }
.order-ticket__legs .input--cell { width: auto; }
.order-ticket__price { align-items: start; }
.order-ticket__tif { justify-self: start; }

.send-ticket__order { display: grid; gap: 0.375rem; }
.send-ticket__order + .send-ticket__order { padding-top: 0.625rem; border-top: 1px dashed var(--edge); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 0.25rem 1rem; margin: 0.25rem 0 0; }
.facts dt { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.8; }
.facts dd { margin: 0; font-weight: 650; }
.sent summary { cursor: pointer; }
.sent__json { margin: 0.375rem 0 0; padding: 0.5rem 0.625rem; background: var(--sheet); color: var(--ink); border: 1px solid var(--rule); border-radius: var(--r); font: 500 0.75rem/1.45 var(--mono); overflow-x: auto; }

.heat { font-size: 0.75rem; }
.heat td, .heat th { padding: 0.3125rem 0.4375rem; }
.heat tbody th { background: var(--sheet-2); color: var(--spot); font-weight: 600; }
.heat .heat-flat { color: var(--ink-2); }
.heat .heat-up-1 { background: color-mix(in srgb, var(--up) 10%, transparent); }
.heat .heat-up-2 { background: color-mix(in srgb, var(--up) 20%, transparent); }
.heat .heat-up-3 { background: color-mix(in srgb, var(--up) 32%, transparent); }
.heat .heat-up-4 { background: color-mix(in srgb, var(--up) 46%, transparent); }
.heat .heat-down-1 { background: color-mix(in srgb, var(--down) 10%, transparent); }
.heat .heat-down-2 { background: color-mix(in srgb, var(--down) 20%, transparent); }
.heat .heat-down-3 { background: color-mix(in srgb, var(--down) 32%, transparent); }
.heat .heat-down-4 { background: color-mix(in srgb, var(--down) 46%, transparent); }

.options-summary { display: grid; gap: 0.625rem; }

@media (max-width: 40rem) {
  .options-controls .field { flex: 1 1 8rem; }
  .input--num, .input--ticker { width: 100%; }
  .chain td, .chain th { padding: 0.3125rem 0.375rem; }
  .order-ticket__price .field { flex: 1 1 7rem; }
}
