/* ───────────────────────────────────────────────────────────────
   Terminal. Same palette as the site, but dense: three columns,
   tabular figures, and nothing decorative competing with numbers.
   ─────────────────────────────────────────────────────────────── */

.terminal-body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--band-2);
  font-size: 15px;
}

/* ───────────────────────── Top bar ───────────────────────── */

.tbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 56px;
  padding: 0 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.tbar .brand { font-size: 18px; }
.tbar-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 4px 9px;
  border: 1px solid var(--rule);
  border-radius: 999px;
}
.tbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.tbar-stat {
  font-size: 13px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tbar-cta { height: 36px; padding: 0 16px; font-size: 14px; }
.tbar-cta.on { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--rule); }

/* ───────────────────────── Grid ───────────────────────── */

.tgrid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 360px;
  gap: 1px;
  background: var(--rule);
}
.rail, .chart-pane, .side { background: var(--paper); min-height: 0; display: flex; flex-direction: column; }

/* ───────────────────────── Market rail ───────────────────────── */

.rail-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.rail-head input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--band-2);
  border: 0;
  border-radius: 999px;
  outline: none;
}
.rail-head input:focus-visible { box-shadow: inset 0 0 0 1.5px var(--ink); }
.rail-count { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.rail-cols {
  flex: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px 62px;
  gap: 8px;
  padding: 6px 14px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--rule);
}
.rail-cols .r { text-align: right; }

.rail-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; }

.mrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px 62px;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 9px 14px;
  border: 0;
  border-bottom: 1px solid var(--band-2);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.mrow:hover { background: var(--band-2); }
.mrow.on { background: var(--band); }
.mrow-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mrow img { width: 26px; height: 26px; border-radius: 7px; object-fit: cover; flex: none; }
.mrow .s { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.mrow .n { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrow .p, .mrow .g { text-align: right; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.mrow .g { font-weight: 500; }

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

/* ───────────────────────── Chart pane ───────────────────────── */

.quote {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}
.quote-logo { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex: none; }
.quote-id h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.quote-id p { font-size: 13px; color: var(--ink-3); }

.quote-stats { display: flex; gap: 26px; margin: 0 0 0 auto; }
.quote-stats > div { text-align: right; }
.quote-stats dt { font-size: 10.5px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }
.quote-stats dd { margin: 3px 0 0; font-size: 17px; font-variant-numeric: tabular-nums; }

.quote-link { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.quote-link:hover { color: var(--ink); }

.chart { flex: 1; min-height: 0; background: var(--paper); }
.chart iframe { display: block; width: 100%; height: 100%; border: 0; }
.chart-empty {
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: var(--ink-3);
}

/* ───────────────────────── Side panels ───────────────────────── */

.side { overflow-y: auto; overscroll-behavior: contain; }
.panel { padding: 16px 18px; border-bottom: 1px solid var(--rule); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.panel-head h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.muted-sm { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; background: var(--band-2); border-radius: 999px; }
.seg-btn {
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}
.seg-btn.on { background: var(--paper); color: var(--ink); }

.field { display: block; margin-top: 14px; }
.field-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }
.field-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.field-row input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: none;
  font-variant-numeric: tabular-nums;
}
.field-row input.over { color: var(--down); }
.field-unit { font-size: 15px; font-weight: 600; color: var(--ink-3); }
.max {
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: var(--band);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.lines { margin: 14px 0 0; display: grid; gap: 9px; }
.lines > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lines dt { font-size: 13px; color: var(--ink-2); }
.lines dd { margin: 0; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }

.slips { display: flex; gap: 5px; }
.slip {
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}
.slip.on { background: var(--dark); border-color: var(--dark); color: #fff; }

.wide { width: 100%; justify-content: center; margin-top: 14px; }
.pill.small { height: 34px; padding: 0 16px; font-size: 14px; }
.pill:disabled { background: var(--rule); color: var(--ink-3); cursor: not-allowed; transform: none; }

.disclaim { margin-top: 10px; font-size: 11.5px; line-height: 1.5; color: var(--ink-3); }
.tx { margin-top: 10px; font-size: 12.5px; }
.tx a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* ───────────────────────── Board ───────────────────────── */

.composer textarea {
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--band-2);
  border: 0;
  border-radius: 12px;
  outline: none;
  resize: vertical;
}
.composer textarea:focus-visible { box-shadow: inset 0 0 0 1.5px var(--ink); }
.composer-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.composer-row .at { font-size: 15px; font-weight: 600; color: var(--ink-3); }
.composer-row input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--band-2);
  border: 0;
  border-radius: 999px;
  outline: none;
}
.composer-row input:focus-visible { box-shadow: inset 0 0 0 1.5px var(--ink); }
.composer-note { margin-top: 7px; font-size: 12px; color: var(--ink-3); min-height: 1em; }
.composer-note.bad { color: var(--down); }

.posts-list { margin-top: 14px; display: grid; gap: 12px; }
.post { border-left: 2px solid var(--rule); padding-left: 12px; }
.post .who { font-size: 13px; font-weight: 600; }
.post .when { font-weight: 400; color: var(--ink-3); }
.post .txt { margin-top: 4px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); overflow-wrap: anywhere; }
.posts-empty { font-size: 13px; color: var(--ink-3); }

/* ───────────────────────── Responsive ───────────────────────── */

@media (max-width: 1180px) {
  .tgrid { grid-template-columns: 250px minmax(0, 1fr) 320px; }
  .quote-stats { gap: 18px; }
  .wide-only { display: none; }
}
@media (max-width: 940px) {
  .terminal-body { height: auto; overflow: auto; }
  .tgrid { grid-template-columns: 1fr; }
  .rail { max-height: 320px; }
  .chart { height: 60vh; }
  .quote-stats { width: 100%; margin-left: 0; justify-content: space-between; }
  .quote-link { display: none; }
}
