@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");
:root {
  color-scheme: dark;
  --bg: #0b0d19;
  --panel: #131728;
  --fg: #efedf8;
  --muted: #a7acc1;
  --line: #2b3046;
  --violet: #ae9cff;
  --mint: #78d9c0;
  --gold: #f8cb72;
  --rose: #ed92b0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 85% 10%, #27234744, transparent 40%), var(--bg);
}
a {
  color: var(--violet);
  text-decoration: none;
}
button,
input,
select {
  font: inherit;
}
button,
summary {
  cursor: pointer;
}
button {
  border: 1px solid var(--line);
  background: #20243b;
  color: var(--fg);
  border-radius: 9px;
  padding: 10px 14px;
  min-height: 44px;
}
button:hover {
  border-color: var(--violet);
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
button.active {
  border-color: var(--mint);
  background: #78d9c016;
  color: var(--mint);
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}
input,
select {
  background: #0e1222;
  color: var(--fg);
  border: 1px solid var(--line);
  padding: 10px;
  border-radius: 8px;
  min-height: 44px;
  max-width: 100%;
}
label {
  font-size: 0.83rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 140px;
}
label input[type="range"] {
  min-width: 220px;
  accent-color: var(--mint);
  padding: 0;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--mint);
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.06;
  letter-spacing: -0.055em;
  margin: 16px 0 24px;
}
h1 em {
  font-style: normal;
  color: var(--violet);
}
h2 {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 14px;
}
h3 {
  font-size: 1.05rem;
  margin-bottom: 12px;
}
p {
  line-height: 1.65;
  color: var(--muted);
}
.site-header {
  max-width: 1440px;
  margin: auto;
  padding: 25px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--fg);
  letter-spacing: -0.06em;
}
.brand span {
  color: var(--violet);
}
nav {
  display: flex;
  gap: 28px;
  font-size: 0.85rem;
}
nav a {
  color: var(--fg);
}
main {
  max-width: 1440px;
  margin: auto;
  padding: 0 28px;
}
.intro {
  padding: 52px 0 20px;
  max-width: 700px;
}
.intro p {
  max-width: 580px;
}
.badge,
.eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--mint);
}
.badge {
  border: 1px solid #78d9c040;
  border-radius: 20px;
  padding: 7px 11px;
}
.notice {
  border: 1px solid var(--line);
  background: #ae9cff08;
  border-radius: 12px;
  padding: 15px 18px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}
.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  padding: 22px 0;
}
.muted {
  color: var(--muted);
  font-size: 0.8rem;
}
.dataset-options {
  flex: 1;
  min-width: 240px;
}
.dataset-options[open] {
  flex-basis: 100%;
  background: var(--panel);
  padding: 14px;
  border-radius: 10px;
}
.dataset-options .controls {
  margin-top: 16px;
}
.question-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 27px 0 5px;
}
.question-heading p {
  max-width: 760px;
  font-size: 0.92rem;
}
#run-status {
  color: var(--mint);
  font-size: 0.8rem;
  min-width: 90px;
}
.controls {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}
.card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 15px;
  padding: 23px;
  margin-bottom: 18px;
  min-width: 0;
}
.card p:last-child {
  margin-bottom: 0;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.grid > .card {
  margin-bottom: 0;
}
.stats {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  padding: 18px 0;
}
.stat strong {
  display: block;
  color: var(--mint);
  font-size: 2rem;
  letter-spacing: -0.04em;
  font-weight: 600;
}
.stat span {
  font-size: 0.8rem;
  color: var(--muted);
}
.legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 15px 0;
}
.legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 7px;
}
.plot {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.plot text {
  fill: var(--muted);
  font-size: 12px;
}
.plot .axis-label {
  font-size: 11px;
}
.plot .dot {
  cursor: pointer;
}
.plot .dot:focus {
  outline: none;
  stroke: white;
  stroke-width: 3;
}
.plot-hit {
  cursor: pointer;
}
.plot .cursor {
  stroke: var(--gold);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}
.date-control {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 15px;
  margin-top: 18px;
}
.date-control output {
  color: var(--mint);
  font-size: 0.9rem;
  min-width: 110px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.82rem;
}
th,
td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}
th {
  color: var(--muted);
  font-weight: 500;
}
.table-wrap {
  overflow: auto;
}
td:last-child {
  text-align: right;
}
.heat-wrap {
  overflow: auto;
}
.heatmap {
  width: max-content;
  min-width: 100%;
  display: grid;
  gap: 5px;
}
.heatmap .heat-label {
  color: var(--muted);
  font-size: 0.72rem;
  min-width: 76px;
  max-width: 95px;
  align-self: center;
  padding: 5px;
  overflow-wrap: anywhere;
}
.heatmap button {
  min-width: 76px;
  min-height: 44px;
  height: 44px;
  border-radius: 6px;
}
.heatmap button.selected {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.pair-list {
  display: grid;
  gap: 8px;
}
.pair-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 2fr auto;
  align-items: center;
  gap: 16px;
  text-align: left;
  background: transparent;
}
.pair-row .bar-track {
  height: 9px;
  border-radius: 6px;
  background: #20253c;
  overflow: hidden;
}
.bar-track span {
  display: block;
  height: 100%;
  background: var(--mint);
  border-radius: 6px;
}
.pair-row small {
  color: var(--muted);
}
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.tile {
  text-align: left;
  background: #0e1222;
  padding: 16px;
}
.tile .plot {
  height: 70px;
}
.tile small {
  color: var(--muted);
}
.selected-date {
  color: var(--mint);
  font-weight: 600;
}
.forecast-gauge {
  height: 12px;
  background: #262c41;
  border-radius: 20px;
  margin: 15px 0;
}
.forecast-gauge span {
  display: block;
  background: var(--mint);
  height: 100%;
  border-radius: 20px;
}
.signal {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 16px 0;
  color: var(--muted);
}
.signal.match {
  border-color: var(--gold);
  color: var(--gold);
}
.signal.pulse {
  animation: match-pulse 1.2s ease-in-out infinite;
}
.window-highlight {
  transition: transform 0.35s ease;
  transform-box: view-box;
}
.scan-labels {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.8rem;
}
.profile-item {
  margin: 12px 0;
}
.error {
  border: 1px solid var(--rose);
  background: #ed92b00d;
  color: var(--rose);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
}
details {
  border-top: 1px solid var(--line);
  padding: 18px 0;
  margin-top: 16px;
}
summary {
  color: var(--violet);
  font-size: 0.9rem;
  min-height: 28px;
}
details p {
  margin-top: 15px;
  font-size: 0.86rem;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.72rem;
  line-height: 1.6;
  max-height: 550px;
  overflow: auto;
  color: var(--muted);
}
#question-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(390px, 92vw);
  max-width: none;
  max-height: 100vh;
  height: 100vh;
  margin: 0;
  border: 0;
  border-right: 1px solid var(--line);
  background: #121627;
  color: var(--fg);
  padding: 22px;
  overflow: auto;
  box-shadow: 15px 0 60px #0008;
}
dialog::backdrop {
  background: #050713bd;
}
dialog[open] {
  animation: drawer-in 0.23s ease-out;
}
dialog header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
dialog header h2 {
  font-size: 1.3rem;
  margin: 0;
}
#map-day-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: 88dvh;
  margin: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #121627;
  color: var(--fg);
  overflow: hidden;
}
#map-day-dialog[open] { display: flex; flex-direction: column; animation: none; }
#map-day-dialog header { flex-shrink: 0; margin-bottom: 12px; gap: 12px; }
#map-day-body { overflow: auto; min-height: 0; overscroll-behavior: contain; }
#question-list,
#advanced-list {
  display: grid;
  gap: 8px;
}
#question-list button,
#advanced-list button {
  text-align: left;
  padding: 14px;
  background: transparent;
}
#question-list button small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
  margin-top: 7px;
}
#advanced-list {
  margin-top: 15px;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
  padding: 40px 0;
  color: var(--muted);
  font-size: 0.75rem;
}
.skip {
  position: absolute;
  top: -80px;
  left: 15px;
  padding: 15px;
  background: var(--panel);
  z-index: 10;
}
.skip:focus {
  top: 10px;
}
@keyframes match-pulse {
  50% {
    border-color: #f8cb7260;
    background: #f8cb720b;
  }
}
@keyframes drawer-in {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}
@media (max-width: 700px) {
  main {
    padding: 0 16px;
  }
  .site-header {
    padding: 20px 16px;
  }
  nav {
    gap: 14px;
    font-size: 0.75rem;
  }
  .intro {
    padding-top: 35px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 17px;
  }
  .question-heading {
    display: block;
  }
  #run-status {
    display: block;
    margin-bottom: 15px;
  }
  .controls label {
    flex: 1;
    min-width: 140px;
  }
  .pair-row {
    grid-template-columns: 1fr 1fr;
  }
  .pair-row small {
    grid-column: 1 / -1;
  }
  .date-control {
    grid-template-columns: auto 1fr;
  }
  .date-control output {
    grid-column: 1 / -1;
  }
  .stat strong {
    font-size: 1.6rem;
  }
  .heatmap .heat-label {
    font-size: 0.68rem;
  }
  .question-heading h2 {
    font-size: 1.45rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 700px) {
  .plot text {
    font-size: 16px;
  }
  .plot .axis-label {
    font-size: 14px;
  }
}
