:root {
  --bg: #0f1419;
  --card: #1a2029;
  --line: #2a3340;
  --text: #e6edf3;
  --muted: #8b98a5;
  --today: #4ea1ff;
  --tomorrow: #ff9f4e;
  --neg: #ff5c6c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 24px;
}

header h1 { margin: 0 0 4px; font-size: 22px; }
.step-ctrl { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.step-ctrl select {
  background: var(--card); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; font: inherit; cursor: pointer;
}
.sub { margin: 0; color: var(--muted); font-size: 13px; }
.sub code { background: var(--line); padding: 1px 6px; border-radius: 4px; }

main { max-width: 1100px; margin: 24px auto; display: grid; gap: 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}

.status { color: var(--muted); font-size: 13px; margin-bottom: 8px; min-height: 18px; }
.status.error { color: var(--neg); }

.chart-wrap { position: relative; }
.chart { width: 100%; height: 300px; display: block; }
.chart-title { font-size: 14px; font-weight: 600; margin: 16px 0 8px; color: var(--text); }
.chart-title:first-of-type { margin-top: 8px; }

.tooltip {
  position: absolute;
  pointer-events: none;
  background: #000c;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  white-space: nowrap;
  transform: translate(-50%, -110%);
  backdrop-filter: blur(4px);
}
.tooltip .price { font-size: 15px; font-weight: 600; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  background: var(--card); color: var(--muted); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 8px; font-weight: 600; cursor: pointer;
}
.tab.active { background: var(--today); color: #06121f; border-color: transparent; }

.muted { color: var(--muted); font-size: 12px; }

.opts { display: flex; flex-direction: column; gap: 2px; }
.opt-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr; column-gap: 14px; row-gap: 2px; align-items: center;
  padding: 9px 10px; border-radius: 6px;
}
.opt-row.head { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.opt-row.head span:last-child { text-align: right; }
.opt-row:not(.head):nth-child(even) { background: #ffffff08; }
.opt-times { grid-column: 1 / -1; color: var(--muted); font-variant-numeric: tabular-nums; }
.opt-avg { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.opt-vs { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; min-width: 64px; }
.opt-best { color: #7ee787; }
.opt-top { background: #7ee78714; border-bottom: 1px dashed var(--line); margin-bottom: 4px; padding-bottom: 12px; }
.opt-sep { border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 12px; }

.blocks { display: flex; flex-direction: column; gap: 2px; }
.block-row {
  display: grid; grid-template-columns: minmax(120px, max-content) 96px 1fr; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 6px;
}
.block-row:nth-child(odd) { background: #ffffff08; }
.block-time { font-variant-numeric: tabular-nums; color: var(--muted); }
.block-price { font-weight: 600; font-variant-numeric: tabular-nums; }
.block-now { color: #7ee787; font-size: 11px; margin-left: 8px; }
.pill {
  justify-self: start; border: 1px solid; border-radius: 999px; padding: 2px 10px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap;
}

footer { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.nav { display: flex; align-items: center; gap: 8px; }
.range-label { min-width: 200px; text-align: center; font-size: 14px; font-weight: 600; }
#today-btn { background: var(--line); color: var(--text); }
@media (max-width: 600px) {
  .nav { gap: 6px; }
  .nav button { padding: 8px 12px; }
  .range-label { min-width: 0; flex: 1; font-size: 13px; }
}
button {
  background: var(--today); color: #06121f; border: 0; padding: 8px 16px;
  border-radius: 8px; font-weight: 600; cursor: pointer;
}
button:hover { filter: brightness(1.1); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
.hint { color: var(--muted); font-size: 12px; }
