:root {
  color-scheme: dark;
  --bg: #0e1417;
  --panel: #151e22;
  --surface: #1c282d;
  --line: #354347;
  --text: #edf4f2;
  --muted: #abbab9;
  --mint: #81dec5;
  --up: #65cdb1;
  --down: #f19c93;
  --gold: #e6c080;
  font:
    16px/1.45 system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
button,
input {
  font: inherit;
}
button,
a,
input {
  touch-action: manipulation;
}
a {
  color: var(--mint);
}
button {
  cursor: pointer;
  background: var(--surface);
  border: 1px solid #677b80;
  color: var(--text);
  border-radius: 5px;
  padding: 0.5rem 0.8rem;
}
button:hover,
a:hover {
  filter: brightness(1.15);
}
button:disabled {
  cursor: default;
  opacity: 0.65;
}
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
header {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  border-bottom: 1px solid var(--line);
  padding: 0 clamp(1rem, 3vw, 3rem);
  min-height: 64px;
  background: #131b1e;
}
header form {
  margin-left: auto;
}
nav {
  display: flex;
  gap: 1.35rem;
  align-self: stretch;
}
nav a {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
nav a[aria-current] {
  border-bottom-color: var(--mint);
  color: var(--text);
}
.brandlink {
  text-decoration: none;
}
.brand {
  display: inline-flex;
  align-items: center;
  font-weight: 730;
  font-size: 1.22rem;
  letter-spacing: -0.04em;
  color: var(--text);
}
.brand > span:last-child {
  color: var(--mint);
}
.monogram {
  display: grid;
  place-items: center;
  background: var(--mint);
  color: #132323;
  border-radius: 5px;
  width: 30px;
  height: 30px;
  margin-right: 0.6rem;
  font:
    800 1.25rem/1 ui-monospace,
    monospace;
}
.quiet {
  color: var(--muted);
  border: 0;
  background: transparent;
}
.primary {
  background: var(--mint);
  color: #0b2820;
  border-color: var(--mint);
  font-weight: 650;
}
.muted,
small,
.sectionhead > span,
.chartfoot,
.readout,
.listhead,
.workspacebar > span,
p {
  color: var(--muted);
}
#terminal,
.settings {
  width: min(1600px, 100%);
  margin: auto;
  padding: 1.3rem clamp(0.8rem, 3vw, 3rem) 3rem;
}
.workspacebar,
.sectionhead,
.instrument,
.toolbar,
.chartfoot,
.listhead,
.market,
.health li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
}
.workspacebar {
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.workspacebar h1,
.settings h1 {
  font-size: clamp(1.5rem, 2vw, 2rem);
  margin: 0;
  letter-spacing: -0.04em;
}
.workspacebar > span,
.sectionhead > span,
.listhead,
.chartfoot,
.muted,
.toggles,
.readout {
  font-size: 0.85rem;
}
.layout {
  display: grid;
  grid-template-columns: minmax(200px, 245px) minmax(0, 1fr);
  gap: 1rem;
}
.watch,
.plot,
.panel,
fieldset,
.operating {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
}
.sectionhead,
.listhead,
.chartfoot,
.instrument,
.toolbar,
.derivatives {
  padding: 0.85rem 1rem;
}
.sectionhead {
  border-bottom: 1px solid var(--line);
}
h2,
legend {
  font-size: 1.06rem;
  font-weight: 620;
  letter-spacing: -0.015em;
  margin: 0;
}
.listhead {
  padding-bottom: 0.35rem;
}
.market {
  border: 0;
  border-radius: 0;
  width: 100%;
  text-align: left;
  background: transparent;
  border-left: 3px solid transparent;
  padding: 0.8rem 1rem;
}
.market[aria-pressed='true'] {
  background: #22332f;
  border-left-color: var(--mint);
}
.market > span:last-child,
.price {
  text-align: right;
}
.market small,
.price small {
  display: block;
  font-size: 0.8rem;
}
.market .quote,
.price strong,
.readout,
.change,
code,
time,
.metric {
  font-family: ui-monospace, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
.up,
.success {
  color: var(--mint);
}
.down,
.error {
  color: var(--down);
}
.instrument {
  padding-top: 1.1rem;
  padding-bottom: 0.75rem;
}
.instrument h2,
.price strong {
  font-size: clamp(1.5rem, 2.6vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.05em;
}
.pair {
  color: var(--muted);
  font-weight: 400;
}
.toolbar {
  border-block: 1px solid var(--line);
  flex-wrap: wrap;
  padding-block: 0.55rem;
}
.seg,
.toggles,
.checks,
.chartfoot > div {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.seg button,
.chartfoot button {
  min-width: 40px;
  min-height: 34px;
  background: transparent;
  font-size: 0.85rem;
  padding: 0.25rem 0.55rem;
}
.seg button[aria-pressed='true'] {
  color: #0c2420;
  background: var(--mint);
  border-color: var(--mint);
}
.toggles label,
.check {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
}
.toggles input,
.checks input {
  accent-color: var(--mint);
}
.readout {
  min-height: 34px;
  padding: 0.45rem 1rem;
}
.chartwrap {
  position: relative;
}
#chart {
  width: 100%;
  height: clamp(290px, 43vh, 490px);
}
.emptychart {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 1rem;
  color: var(--muted);
  background: var(--panel);
  pointer-events: none;
}
.emptychart[hidden] {
  display: none;
}
.chartfoot {
  border-top: 1px solid var(--line);
  padding-block: 0.45rem;
}
.chartfoot a {
  color: var(--muted);
}
.derivatives {
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
}
.derivatives:empty {
  display: none;
}
.lower,
.settingsgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
.items {
  padding: 0.25rem 1rem;
  max-height: 355px;
  overflow: auto;
}
.items article {
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
}
.items article:last-child {
  border: 0;
}
.items article a {
  color: var(--text);
  text-decoration: none;
}
.items article a:hover {
  text-decoration: underline;
}
.items article small {
  display: block;
  margin-top: 0.25rem;
}
.items p {
  font-size: 0.95rem;
}
.account {
  max-width: 690px;
  margin: 4vh auto;
  padding: 1.5rem;
}
.account .brand {
  margin-bottom: 0.8rem;
}
.account h1 {
  margin-bottom: 0.25rem;
}
.account fieldset,
.settings fieldset {
  margin: 0 0 1rem;
  padding: 1rem;
}
.settings fieldset {
  margin: 0;
}
.account form > label,
.account fieldset > label,
.settings fieldset > label {
  display: grid;
  gap: 0.3rem;
  margin: 0.55rem 0;
  font-size: 0.9rem;
}
input:not([type='checkbox']) {
  background: #10181b;
  color: var(--text);
  border: 1px solid #63777b;
  padding: 0.6rem 0.65rem;
  border-radius: 4px;
  width: 100%;
}
.settings {
  max-width: 1040px;
}
.settingsgrid {
  margin-bottom: 1rem;
}
.checks {
  margin: 0.5rem 0;
}
.check {
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.operating {
  margin-top: 1.25rem;
  padding: 1rem;
}
.command {
  display: block;
  overflow-wrap: anywhere;
  color: var(--mint);
  margin-bottom: 1.2rem;
}
.health {
  list-style: none;
  padding: 0;
}
.health li {
  border-bottom: 1px solid var(--line);
  padding: 0.45rem 0;
  font-size: 0.9rem;
}
.health li span {
  color: var(--muted);
}
@media (max-width: 740px) {
  header {
    gap: 0.8rem;
    flex-wrap: wrap;
    min-height: 56px;
  }
  nav {
    gap: 0.7rem;
  }
  .layout,
  .lower,
  .settingsgrid {
    grid-template-columns: 1fr;
  }
  .watch .listhead {
    display: none;
  }
  #markets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }
  .market {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    padding: 0.5rem;
  }
  .market > span:last-child {
    text-align: left;
  }
  .market > span:first-child small {
    display: none;
  }
  .market .change {
    display: none;
  }
  .workspacebar > span {
    font-size: 0.8rem;
  }
  .toolbar,
  .instrument,
  .sectionhead,
  .derivatives {
    padding-inline: 0.75rem;
  }
  .chartfoot {
    align-items: center;
  }
  .chartfoot > span {
    max-width: 58%;
  }
  .seg button,
  .chartfoot button {
    min-height: 42px;
  }
  .items {
    max-height: 300px;
  }
}
@media (max-width: 390px) {
  header {
    padding: 0.4rem 0.6rem;
    gap: 0.45rem;
  }
  header .monogram {
    display: none;
  }
  header button {
    padding: 0.3rem;
  }
  .workspacebar {
    gap: 0.2rem;
  }
  .toolbar {
    align-items: flex-start;
  }
  .toggles {
    max-width: 100%;
  }
  .chartfoot {
    flex-wrap: wrap;
  }
  .chartfoot > span {
    max-width: 100%;
  }
}
