:root {
  --bg: #07090d;
  --panel: rgba(16, 20, 30, 0.82);
  --panel-strong: rgba(24, 30, 44, 0.92);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f2f6ff;
  --muted: #94a0b8;
  --gold: #ffcc66;
  --cyan: #78e7ff;
  --green: #35e58e;
  --red: #ff5370;
  --shadow: rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at 20% 0%, rgba(120, 231, 255, 0.2), transparent 28rem),
    radial-gradient(circle at 88% 8%, rgba(255, 204, 102, 0.16), transparent 22rem),
    radial-gradient(circle at 50% 105%, rgba(53, 229, 142, 0.14), transparent 28rem),
    linear-gradient(145deg, #07090d 0%, #101522 48%, #07090d 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.shell {
  width: min(1320px, calc(100% - 24px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 440px);
  gap: 22px;
  align-items: end;
  margin-bottom: 22px;
}

.eyebrow,
.label {
  margin: 0 0 10px;
  color: var(--cyan);
  font-family: "Courier New", monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: -0.06em;
}

h1 {
  max-width: 760px;
  font-size: clamp(1.9rem, 5vw, 4.4rem);
  line-height: 0.9;
}

.header-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--cyan);
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
}

.header-link:hover {
  color: var(--gold);
}

h2 {
  font-size: clamp(1.45rem, 3.6vw, 3rem);
  line-height: 0.95;
}

.intro {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.timeline {
  display: grid;
  gap: 14px;
}

.day-card,
.empty {
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.075), transparent 34%),
    var(--panel);
  box-shadow: 0 24px 90px var(--shadow);
  backdrop-filter: blur(18px);
}

.day-card {
  overflow: hidden;
  animation: rise 540ms ease both;
}

.day-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.rates {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-content: start;
}

.rates span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--gold);
  background: rgba(255, 204, 102, 0.08);
  font-family: "Courier New", monospace;
  font-size: 0.68rem;
}

.total-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
}

.metric {
  min-width: 0;
  padding: 16px 18px;
  background: var(--panel-strong);
}

.metric p,
.metric span,
.mini-metrics small,
.mini-metrics em {
  margin: 0;
  color: var(--muted);
  font-family: "Courier New", monospace;
}

.metric p,
.mini-metrics small {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin: 8px 0 6px;
  overflow-wrap: anywhere;
  font-size: clamp(1.1rem, 2.5vw, 2.05rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.metric span,
.mini-metrics em {
  font-size: 0.68rem;
  font-style: normal;
}

.exchange-list {
  display: grid;
}

.exchange-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  align-items: center;
  padding: 11px 18px;
  border-top: 1px solid var(--line);
}

.exchange-name {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.exchange-name span {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(120, 231, 255, 0.35);
  border-radius: 10px;
  color: var(--cyan);
  background: rgba(120, 231, 255, 0.09);
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.exchange-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mini-metrics div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.035);
}

.mini-metrics b {
  display: block;
  margin: 4px 0 3px;
  overflow-wrap: anywhere;
  font-size: 0.78rem;
}

.up,
.up strong,
.up b,
.up span,
.up em {
  color: var(--green);
}

.down,
.down strong,
.down b,
.down span,
.down em {
  color: var(--red);
}

.table-shell {
  width: min(1480px, calc(100% - 24px));
}

.sheet-hero {
  display: flex;
  justify-content: flex-start;
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
}

.sheet-hero h1 {
  font-size: clamp(1.8rem, 4vw, 3.8rem);
}

.exchange-picker {
  position: relative;
  display: inline-block;
  min-width: min(360px, 100%);
}

.exchange-picker::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 0;
  height: 0;
  border-right: 7px solid transparent;
  border-left: 7px solid transparent;
  border-top: 9px solid var(--cyan);
  content: "";
  pointer-events: none;
  transform: translateY(-35%);
}

.exchange-picker span,
.sheet-toolbar span {
  color: var(--muted);
  font-family: "Courier New", monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.exchange-picker select {
  width: 100%;
  border: 0;
  padding: 0 0 0 24px;
  color: var(--text);
  appearance: none;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  font: 800 clamp(1.9rem, 5vw, 4.4rem) / 0.9 "Avenir Next", "Trebuchet MS", sans-serif;
  letter-spacing: -0.06em;
}

.exchange-picker select:focus {
  outline: none;
}

.sheet-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 24px 90px var(--shadow);
  backdrop-filter: blur(18px);
}

.sheet-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(120, 231, 255, 0.1), rgba(255, 204, 102, 0.08));
}

.sheet-toolbar strong {
  font-size: 1rem;
}

.sheet-wrap {
  overflow: auto;
  max-height: calc(100vh - 190px);
}

.data-sheet {
  width: 100%;
  min-width: 1280px;
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.data-sheet th,
.data-sheet td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 9px 11px;
  text-align: right;
  white-space: nowrap;
}

.data-sheet th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--cyan);
  background: #101522;
  font-family: "Courier New", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-sheet td {
  background: rgba(255, 255, 255, 0.026);
  font-size: 0.78rem;
}

.data-sheet tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.045);
}

.data-sheet tbody tr:hover td {
  background: rgba(120, 231, 255, 0.08);
}

.data-sheet .date-cell,
.data-sheet th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  text-align: left;
}

.data-sheet .date-cell {
  color: var(--gold);
  background: #101522;
  font-weight: 800;
}

.data-sheet th:first-child {
  z-index: 3;
}

.empty {
  padding: 48px;
  text-align: center;
}

.empty h2 {
  margin-bottom: 12px;
}

.empty p {
  margin: 0;
  color: var(--muted);
}

.error-box {
  text-align: left;
}

.error-box code {
  display: block;
  margin-top: 18px;
  overflow-x: auto;
  white-space: pre-wrap;
}

code {
  border-radius: 7px;
  padding: 2px 6px;
  color: var(--cyan);
  background: rgba(120, 231, 255, 0.1);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 880px) {
  .hero,
  .day-header,
  .exchange-row,
  .sheet-hero {
    grid-template-columns: 1fr;
  }

  .hero,
  .sheet-hero {
    align-items: start;
  }

  .sheet-hero {
    display: grid;
  }

  .day-header {
    display: grid;
  }

  .rates {
    justify-content: flex-start;
  }

  .total-grid,
  .mini-metrics {
    grid-template-columns: 1fr;
  }

  .exchange-row {
    gap: 14px;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding: 34px 0 48px;
  }

  .day-card,
  .empty {
    border-radius: 22px;
  }

  .day-header,
  .metric,
  .exchange-row {
    padding: 20px;
  }
}
