:root {
  color-scheme: light;
  --ink: #161616;
  --muted: #62666d;
  --line: #d9dde3;
  --paper: #fbfbfc;
  --panel: #ffffff;
  --teal: #008f99;
  --green: #11875d;
  --yellow: #c49a00;
  --red: #c84343;
  --graph: #242424;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

.shell {
  min-height: 100vh;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.brand {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: center;
}

.brand-image {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
}

.controls {
  display: grid;
  grid-template-columns: 90px 130px repeat(4, max-content) 84px;
  justify-content: end;
  gap: 7px;
  align-items: center;
}

.field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.field span,
.check span {
  color: var(--muted);
  font-size: 11px;
}

input,
select {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 8px;
  font-size: 13px;
}

#ticker {
  width: 90px;
}

#expiry {
  width: 130px;
}

.check {
  display: flex;
  gap: 5px;
  align-items: center;
  height: 30px;
  white-space: nowrap;
}

.check input {
  width: 13px;
  height: 13px;
  accent-color: var(--teal);
}

button {
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 9px;
  padding: 8px 16px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.status {
  min-height: 16px;
}

.timestamp {
  text-align: right;
}

.dashboard-stack {
  display: grid;
  gap: 12px;
  padding: 12px 16px 16px;
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 12px;
  align-items: start;
}

.chart-panel,
.metrics {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.price-chart {
  min-height: 315px;
}

.flow-chart {
  min-height: 390px;
}

.metrics {
  padding: 14px;
}

.metrics h2 {
  margin: 0 0 10px;
  font-size: 15px;
}

dl {
  display: grid;
  gap: 9px;
  margin: 0;
}

dl div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

dt {
  color: var(--muted);
  font-size: 11px;
}

dd {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  border-top: 1px solid var(--line);
}

.footer-project {
  color: var(--ink);
  font-weight: 800;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
}

.site-footer a {
  position: relative;
  color: inherit;
  text-decoration: none;
}

.site-footer a::after {
  position: absolute;
  right: 0;
  bottom: -2px;
  left: 0;
  height: 1px;
  content: "";
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

.site-footer a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

@media (max-width: 980px) {
  .toolbar,
  .lower-grid {
    grid-template-columns: 1fr;
  }

  .controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .dashboard-stack {
    padding-inline: 12px;
  }
}

@media (max-width: 620px) {
  .toolbar,
  .status-row {
    padding-inline: 12px;
  }

  .brand {
    grid-template-columns: 40px 1fr;
  }

  .brand-image {
    width: 40px;
    height: 40px;
  }

  h1 {
    font-size: 17px;
  }

  .field {
    width: 100%;
  }

  #ticker,
  #expiry {
    width: 100%;
  }

  .check {
    width: 100%;
    align-items: flex-start;
    height: auto;
    min-height: 34px;
    white-space: normal;
  }

  button {
    width: 100%;
  }

  .status-row {
    display: grid;
  }

  .timestamp {
    text-align: left;
  }

  .site-footer {
    display: grid;
    gap: 10px;
    padding-inline: 12px;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .price-chart {
    min-height: 300px;
  }

  .flow-chart {
    min-height: 370px;
  }
}
