:root {
  --bg: #f4efe5;
  --ink: #10212b;
  --muted: #5f6f78;
  --panel: #fffaf2;
  --line: rgba(16, 33, 43, 0.12);
  --accent: #c2581b;
  --accent-strong: #8b3512;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(194, 88, 27, 0.12), transparent 32%),
    linear-gradient(180deg, #efe2ce 0%, var(--bg) 100%);
  min-height: 100vh;
}

a {
  color: inherit;
}

.site-header,
.layout {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 0 16px;
  align-items: flex-end;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.nav-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.nav-links a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.nav-links a:hover {
  border-color: currentColor;
}

.layout {
  display: grid;
  gap: 20px;
  padding-bottom: 40px;
}

.hero,
.split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.card-grid--three {
  grid-template-columns: repeat(3, 1fr);
}

.card-grid--four {
  grid-template-columns: repeat(4, 1fr);
}

.card-grid--two {
  grid-template-columns: repeat(2, 1fr);
}

.panel {
  background: color-mix(in srgb, var(--panel) 92%, white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 18px 40px rgba(16, 33, 43, 0.06);
}

.panel--compact {
  padding: 20px;
}

.current-prediction-card {
  position: relative;
  overflow: hidden;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.current-prediction-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 48%);
}

.current-prediction-card .metric,
.current-prediction-card strong,
.current-prediction-card span,
.current-prediction-card p {
  position: relative;
  z-index: 1;
}

.current-prediction-card--up {
  color: #0d4d34;
  border-color: rgba(13, 107, 69, 0.34);
  background:
    radial-gradient(circle at top right, rgba(13, 107, 69, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(225, 247, 236, 0.98) 0%, rgba(244, 255, 249, 0.96) 100%);
  box-shadow: 0 22px 44px rgba(13, 107, 69, 0.12);
}

.current-prediction-card--up .eyebrow,
.current-prediction-card--up .metric,
.current-prediction-card--up strong,
.current-prediction-card--up span {
  color: #0d6b45;
}

.current-prediction-card--down {
  color: #6e2323;
  border-color: rgba(166, 50, 50, 0.34);
  background:
    radial-gradient(circle at top right, rgba(166, 50, 50, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(255, 236, 236, 0.98) 0%, rgba(255, 247, 247, 0.96) 100%);
  box-shadow: 0 22px 44px rgba(166, 50, 50, 0.12);
}

.current-prediction-card--down .eyebrow,
.current-prediction-card--down .metric,
.current-prediction-card--down strong,
.current-prediction-card--down span {
  color: #a63232;
}

.current-prediction-card--neutral {
  color: var(--ink);
}

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  z-index: 1000;
}

.toast {
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(16, 33, 43, 0.12);
  box-shadow: 0 16px 36px rgba(16, 33, 43, 0.14);
  background: rgba(255, 250, 242, 0.96);
  backdrop-filter: blur(8px);
  color: var(--ink);
}

.toast--info {
  border-color: rgba(194, 88, 27, 0.24);
  background: rgba(255, 244, 234, 0.96);
}

.toast--success {
  border-color: rgba(13, 107, 69, 0.24);
  background: rgba(232, 249, 239, 0.96);
  color: #0d6b45;
}

.toast--danger {
  border-color: rgba(166, 50, 50, 0.24);
  background: rgba(254, 237, 237, 0.96);
  color: #a63232;
}

.toast--warning {
  border-color: rgba(176, 106, 0, 0.24);
  background: rgba(255, 244, 223, 0.96);
  color: #8a5600;
}

.metric {
  font-size: clamp(1.4rem, 4vw, 2.5rem);
  font-weight: 700;
}

.plain-list {
  margin: 0;
  padding-left: 18px;
}

.stack-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.72);
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--accent);
  color: white;
  cursor: pointer;
}

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

.button-secondary {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent-strong);
}

.sandbox-simulator-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.sandbox-simulator-actions {
  display: grid;
  gap: 10px;
}

.sandbox-simulator-results {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.sandbox-result-summary {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.sandbox-result-summary p {
  margin: 0;
}

.sandbox-result-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.sandbox-result-section,
.sandbox-additional-results {
  display: grid;
  gap: 14px;
}

.sandbox-result-section h3 {
  margin-bottom: 0;
}

.sandbox-additional-results {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 20px;
}

.sandbox-result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.5);
}

.sandbox-result-card h3 {
  margin-bottom: 12px;
}

.sandbox-result-metric {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.sandbox-result-metric span,
.sandbox-result-grid dt {
  color: var(--muted);
  font-size: 0.88rem;
}

.sandbox-result-metric strong {
  font-size: 2rem;
}

.sandbox-result-value--positive {
  color: #0d6b45;
}

.sandbox-result-value--negative,
.sandbox-error {
  color: #a63232;
}

.sandbox-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.sandbox-result-grid div {
  display: grid;
  gap: 3px;
}

.sandbox-result-grid dd {
  margin: 0;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 18px;
}

.chart-tools {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.chart-note {
  max-width: 360px;
  color: var(--muted);
}

.summary-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  margin-bottom: 18px;
}

.summary-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.summary-config {
  width: min(220px, 100%);
}

.summary-config span {
  font-size: 0.92rem;
  color: var(--muted);
}

.summary-submetric {
  margin-bottom: 0;
  color: var(--muted);
}

.summary-meta {
  margin: 0;
  color: var(--muted);
  text-align: right;
}

.chart-shell {
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(194, 88, 27, 0.06) 0%, rgba(255, 255, 255, 0.55) 100%);
  padding: 16px;
  overflow-x: auto;
}

.price-chart {
  width: 100%;
  height: auto;
  display: block;
}

.prediction-timeline-svg {
  min-width: 1180px;
}

.chart-axis {
  stroke: rgba(16, 33, 43, 0.18);
  stroke-width: 1.5;
}

.chart-axis-labels {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.candle-wick {
  stroke-width: 2.5;
}

.candle-body {
  stroke-width: 1.5;
}

.candle-marker {
  font-size: 12px;
  font-weight: 700;
}

.candle-marker--check {
  fill: #0d6b45;
}

.candle-marker--x {
  fill: #a63232;
}

.candle-marker--pending {
  fill: #b06a00;
}

.candle-up {
  stroke: #0d6b45;
  fill: rgba(13, 107, 69, 0.38);
}

.candle-down {
  stroke: #a63232;
  fill: rgba(166, 50, 50, 0.34);
}

.candle-accuracy--success {
  stroke: #0d6b45;
  stroke-width: 2.5;
}

.candle-accuracy--failure {
  stroke: #a63232;
  stroke-width: 2.5;
}

.candle-accuracy--pending {
  stroke: #b06a00;
  stroke-width: 2.5;
  stroke-dasharray: 3 2;
}

.prediction-stats {
  margin-bottom: 18px;
}

.timeline-guide,
.timeline-axis,
.timeline-stem {
  stroke: rgba(16, 33, 43, 0.18);
  stroke-width: 1.5;
}

.timeline-guide {
  stroke-dasharray: 4 4;
}

.timeline-label,
.timeline-point-label {
  fill: var(--muted);
  font-size: 12px;
}

.timeline-point {
  stroke-width: 2.5;
}

.timeline-result-marker {
  fill: #fff;
  font-size: 18px;
  font-weight: 900;
  pointer-events: none;
}

.timeline-result-marker--check {
  fill: #0d6b45;
}

.timeline-result-marker--x {
  fill: #a63232;
}

.timeline-point--up {
  fill: rgba(13, 107, 69, 0.28);
}

.timeline-point--down {
  fill: rgba(166, 50, 50, 0.24);
}

.timeline-point--success {
  stroke: #0d6b45;
}

.timeline-point--failure {
  stroke: #a63232;
}

.timeline-point--pending {
  stroke: #b06a00;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

.badge--up,
.badge--success {
  background: rgba(13, 107, 69, 0.12);
  color: #0d6b45;
}

.badge--down,
.badge--failure {
  background: rgba(166, 50, 50, 0.12);
  color: #a63232;
}

.badge--pending {
  background: rgba(176, 106, 0, 0.12);
  color: #b06a00;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

@media (max-width: 900px) {
  .hero,
  .split,
  .card-grid,
  .card-grid--three,
  .card-grid--four,
  .card-grid--two {
    grid-template-columns: 1fr;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .chart-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .chart-tools {
    justify-items: start;
  }

  .summary-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-actions {
    justify-items: start;
  }

  .summary-meta {
    text-align: left;
  }

  .sandbox-simulator-form,
  .sandbox-result-cards {
    grid-template-columns: 1fr;
  }

  .toast-stack {
    right: 16px;
    left: 16px;
    width: auto;
    bottom: 16px;
  }
}
