:root {
  color-scheme: dark;
  --bg: #0e1214;
  --panel: #171d20;
  --panel2: #1c2427;
  --line: #30393b;
  --text: #eaf0ef;
  --muted: #a0b0b0;
  --accent: #a9ef76;
  --green: #73d9a8;
  --red: #ff9a94;
  --blue: #8eb4de;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    15px/1.45 "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button,
select {
  cursor: pointer;
}
button {
  background: #242d30;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.46em 0.76em;
}
button:hover,
select:hover {
  border-color: #819392;
}
button:focus-visible,
input:focus-visible,
a:focus-visible,
canvas:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
input,
select {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111719;
  padding: 0.55em 0.7em;
  min-width: 0;
}
button.primary,
.primary {
  background: var(--accent);
  border: 0;
  color: #142116;
  font-weight: 650;
}
button[disabled] {
  opacity: 0.5;
  cursor: default;
}
a {
  color: var(--green);
  text-underline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(28px, 2.4vw, 47px);
  line-height: 1.13;
  font-weight: 590;
  letter-spacing: -0.05em;
}
h2 {
  font-size: 19px;
  letter-spacing: -0.025em;
  font-weight: 600;
}
h3 {
  font-size: 15px;
  font-weight: 600;
}
.muted,
small {
  color: var(--muted);
}
small {
  font-size: 12px;
}
.num,
.money,
.ticker strong,
.value {
  font-variant-numeric: tabular-nums;
}
.up {
  color: var(--green);
}
.down {
  color: var(--red);
}
[hidden] {
  display: none !important;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.brand b {
  background: var(--accent);
  color: #182116;
  padding: 3px 6px;
  border-radius: 4px;
  letter-spacing: -0.09em;
  font-size: 18px;
  font-weight: 850;
}
header {
  height: 63px;
  display: flex;
  align-items: center;
  gap: 19px;
  padding: 0 27px;
  background: #13191c;
  border-bottom: 1px solid var(--line);
}
.divider {
  height: 19px;
  border-left: 1px solid var(--line);
}
.terminal,
.headright {
  color: var(--muted);
  font-size: 13px;
}
.headright {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
}
.shell {
  display: grid;
  grid-template-columns: 175px minmax(0, 1fr);
  min-height: calc(100vh - 63px);
}
aside {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 27px 12px 17px;
  background: #121719;
}
nav {
  display: grid;
  gap: 5px;
}
nav button {
  display: flex;
  gap: 12px;
  align-items: center;
  background: transparent;
  border: 0;
  text-align: left;
  color: #b6c1c2;
  padding: 11px 12px;
  font-size: 14px;
}
nav button.active {
  background: #263429;
  color: #c1f7a2;
}
nav i {
  font: 18px/1 monospace;
  width: 22px;
  text-align: center;
}
.profile {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 15px 6px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.profile b {
  border-radius: 50%;
  background: #324246;
  padding: 7px 12px;
}
.profile small {
  display: block;
}
main {
  min-width: 0;
  padding: 25px clamp(14px, 1.9vw, 38px);
}
.pagehead,
.between,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.eyebrow,
.label {
  font-size: 10px;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.eyebrow {
  color: var(--accent);
  margin-bottom: 5px;
}
.mode {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.mode span:before {
  content: "";
  display: inline-block;
  background: var(--accent);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
}
.tickers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0 14px;
}
.ticker {
  position: relative;
  text-align: left;
  padding: 13px 15px;
  overflow: hidden;
  background: var(--panel);
}
.ticker.chosen {
  border-color: #6d9466;
}
.ticker .label {
  display: block;
}
.ticker strong {
  font-size: 18px;
  display: block;
  margin: 4px 0 0;
}
.ticker .pct {
  font-size: 12px;
}
.spark {
  position: absolute;
  width: 37%;
  height: 35px;
  right: 9px;
  bottom: 15px;
}
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(285px, 1fr);
  gap: 14px;
  align-items: start;
}
.stack {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 19px;
  min-width: 0;
}
.panel > h2,
.panel > .between {
  margin-bottom: 13px;
}
.price {
  font-size: clamp(27px, 2.6vw, 47px);
  font-weight: 550;
  letter-spacing: -0.055em;
}
.price small {
  font-size: 14px;
  letter-spacing: 0;
  margin-left: 5px;
}
.charthead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.seg {
  display: flex;
  gap: 3px;
}
.seg button {
  border: 0;
  background: transparent;
  font-size: 12px;
  padding: 4px 7px;
}
.seg .on {
  background: #364535;
  color: #d2f3c7;
}
.plot {
  height: 260px;
  position: relative;
  margin: 12px 0 6px;
}
.plot canvas {
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}
.readout {
  min-height: 19px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  padding-top: 13px;
  gap: 10px;
}
.metrics strong,
.stat strong {
  display: block;
  font-size: 18px;
  font-weight: 550;
}
.pair {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.pair:last-child {
  border: 0;
}
.pair span:first-child {
  color: var(--muted);
}
.listitem {
  display: block;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.listitem strong {
  display: block;
  font-weight: 550;
}
.listitem small {
  display: block;
  margin-top: 3px;
}
.listitem a {
  color: var(--text);
  text-decoration: none;
}
.listitem a:hover {
  text-decoration: underline;
}
.chip {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 11px;
  background: #2c3b31;
  color: var(--green);
}
.note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 12px;
}
.rowbtn {
  font-size: 12px;
  white-space: nowrap;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
}
td,
th {
  padding: 9px 6px;
  border-bottom: 1px solid var(--line);
}
td:first-child,
th:first-child {
  padding-left: 0;
}
.scroll {
  overflow-x: auto;
}
.widegrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.stackform {
  display: grid;
  gap: 10px;
}
.stackform label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.lineform {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.lineform input {
  flex: 1;
}
.reply {
  padding: 12px 14px;
  background: #232d2c;
  border-left: 2px solid var(--accent);
  margin: 10px 0;
}
.reply small {
  display: block;
}
.heroasset {
  display: flex;
  align-items: center;
  gap: 10px;
}
.assetmark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #364039;
  color: #dcf4dc;
  font-weight: 700;
  font-size: 13px;
}
.rule {
  margin: 14px 0;
  border: none;
  border-top: 1px solid var(--line);
}
.large {
  font-size: 31px;
  letter-spacing: -0.045em;
}
.actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}
.viewport-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.viewport-controls select {
  font-size: 12px;
}
footer {
  margin-top: 22px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
}
#login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 38% 30%, #24332b, transparent 58%), var(--bg);
}
.loginbox {
  display: grid;
  width: min(380px, 92vw);
  gap: 12px;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.loginbox h1 {
  font-size: 30px;
  margin: 18px 0;
}
.loginbox label {
  color: var(--muted);
  font-size: 13px;
}
#toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: #39463b;
  border: 1px solid #728c6d;
  border-radius: 8px;
  padding: 12px 18px;
  z-index: 5;
}
@media (min-width: 1900px) {
  .shell {
    grid-template-columns: 205px minmax(0, 1fr);
  }
  .grid.overview {
    grid-template-columns: minmax(0, 1.65fr) minmax(310px, 0.95fr) minmax(
        300px,
        0.8fr
      );
  }
  .plot {
    height: 340px;
  }
  .panel {
    padding: 24px;
  }
  .tickers {
    gap: 16px;
  }
  .ticker {
    padding: 18px;
  }
  .stack {
    gap: 16px;
  }
}
@media (max-width: 1899px) {
  .overview > .third {
    grid-column: 1/-1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 1000px) {
  .shell {
    grid-template-columns: 135px minmax(0, 1fr);
  }
  aside {
    padding: 20px 6px;
  }
  .grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(220px, 1fr);
  }
  .panel {
    padding: 13px;
  }
  .mode span {
    display: none;
  }
  .widegrid {
    grid-template-columns: 1fr 1fr;
  }
  .spark {
    width: 30%;
  }
}
@media (max-width: 720px) {
  header {
    height: 52px;
    padding: 0 14px;
  }
  .terminal,
  .divider,
  .snapshot {
    display: none;
  }
  .shell {
    display: block;
  }
  aside {
    display: block;
    position: sticky;
    top: 0;
    z-index: 4;
    padding: 4px 7px;
    border: 0;
    background: #13191c;
    border-bottom: 1px solid var(--line);
  }
  nav {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 2px;
  }
  nav button {
    flex: none;
    padding: 7px 9px;
    font-size: 12px;
  }
  nav i,
  .profile {
    display: none;
  }
  main {
    padding: 18px 10px;
  }
  .tickers {
    display: flex;
    overflow-x: auto;
    margin: 15px 0 10px;
    gap: 7px;
    scrollbar-width: thin;
  }
  .ticker {
    flex: 0 0 135px;
    padding: 8px;
  }
  .ticker .spark {
    width: 35%;
    height: 26px;
    bottom: 10px;
  }
  .ticker strong {
    font-size: 16px;
  }
  .grid,
  .widegrid,
  .overview > .third {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .grid,
  .stack {
    gap: 10px;
  }
  .plot {
    height: 215px;
  }
  .seg button {
    padding: 4px;
  }
  .mode button {
    font-size: 11px;
  }
  .price {
    font-size: 31px;
  }
  .metrics {
    gap: 4px;
  }
  .metrics strong {
    font-size: 16px;
  }
  footer {
    flex-wrap: wrap;
  }
  .charthead {
    flex-wrap: wrap;
  }
}
#bands {
  width: 100%;
  height: 110px;
  display: block;
  margin-bottom: 12px;
}

#feedback-form textarea {
  width: 100%; padding: .8rem; resize: vertical; font: inherit; font-size: 1rem;
  color: inherit; background: #101517; border: 1px solid var(--line); border-radius: .4rem;
}
.feedback-text { white-space: pre-wrap; overflow-wrap: anywhere; }
#feedback-receipt:empty { display: none; }
@media (max-width: 600px) {
  .headright { gap: .4rem; }
}

#reminder, #credentials {
  background: #182126;
  color: #eef4f4;
  border: 1px solid var(--line);
  padding: 0;
  max-width: calc(100vw - 24px);
}
#reminder::backdrop, #credentials::backdrop { background: rgb(0 0 0 / 75%); }
#credentials .loginbox { width: min(360px, 100%); }
#credentials input { display: block; width: 100%; }
#tour {
  position: fixed;
  z-index: 20;
  bottom: max(12px, env(safe-area-inset-bottom));
  right: 12px;
  left: auto;
  width: min(390px, calc(100% - 24px));
  max-height: 46vh;
  overflow: auto;
  padding: 16px;
  border: 1px solid #78cdb7;
  border-radius: 8px;
  background: #182126;
  box-shadow: 0 6px 25px #0008;
}
#tour h2 { margin: 4px 0; }
#tour p { margin: 5px 0 12px; }
.tour-target { outline: 2px solid #78cdb7; outline-offset: -2px; }
@media (max-width: 480px) {
  header { height: auto; min-height: 52px; flex-wrap: wrap; gap: 4px; padding: 6px 8px; }
  header .headright { gap: 3px; flex-wrap: wrap; }
  .headright button { font-size: 12px; padding: 6px; }
}
