: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;
}

.access-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.access-page .layout {
  width: min(460px, 100%);
}

.access-page__panel {
  display: grid;
  gap: 14px;
}

html.access-guard-pending body {
  overflow: hidden;
}

html.access-guard-pending body > * {
  visibility: hidden;
}

.access-guard-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(194, 88, 27, 0.14), transparent 30%),
    rgba(244, 239, 229, 0.96);
  visibility: visible !important;
}

.access-guard-card {
  width: min(460px, 100%);
  background: color-mix(in srgb, var(--panel) 94%, white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 18px 40px rgba(16, 33, 43, 0.14);
}

.access-guard-actions {
  display: grid;
  gap: 12px;
}

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);
}

.card-grid--five {
  grid-template-columns: repeat(5, 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;
}

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

.strategy-card[open] {
  border-color: rgba(194, 88, 27, 0.24);
  box-shadow: 0 22px 46px rgba(194, 88, 27, 0.1);
}

.strategy-card__summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 24px;
}

.strategy-card__summary::-webkit-details-marker {
  display: none;
}

.strategy-card__summary-copy {
  margin-bottom: 0;
  max-width: 760px;
  color: var(--muted);
}

.strategy-card__summary-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 12px;
  min-width: 320px;
}

.strategy-card__summary-metrics div {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid rgba(16, 33, 43, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.45);
}

.strategy-card__summary-metrics span {
  color: var(--muted);
  font-size: 0.85rem;
}

.strategy-card__summary-metrics strong {
  font-size: 1.15rem;
}

.strategy-card__body {
  display: grid;
  gap: 20px;
  padding: 0 24px 24px;
  border-top: 1px solid rgba(16, 33, 43, 0.08);
}

.strategy-form-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  align-items: end;
}

.strategy-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(220px, 100%);
}

.strategy-toggle input[type="checkbox"] {
  width: auto;
}

.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;
  margin-bottom: 4px;
}

.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;
}

.metric--compact {
  font-size: clamp(1.1rem, 3vw, 1.8rem);
}

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

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

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

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  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-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  text-decoration: none;
}

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

.mode-switch {
  display: inline-flex;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.88);
  width: fit-content;
}

.mode-switch__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  padding: 12px 18px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mode-switch__link--active {
  background: var(--ink);
  color: #fff7ec;
}

.mode-banner {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 28px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 44px rgba(16, 33, 43, 0.1);
}

.mode-banner h2 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 5vw, 3.6rem);
  letter-spacing: 0.08em;
}

.mode-banner--production {
  color: #fff4e8;
  border-color: rgba(139, 53, 18, 0.32);
  background:
    radial-gradient(circle at top right, rgba(255, 219, 183, 0.26), transparent 28%),
    linear-gradient(135deg, #8b3512 0%, #c2581b 52%, #e98133 100%);
}

.mode-banner--sandbox {
  color: #f4fffe;
  border-color: rgba(13, 82, 87, 0.24);
  background:
    radial-gradient(circle at top right, rgba(180, 246, 242, 0.18), transparent 30%),
    linear-gradient(135deg, #0f4d57 0%, #1d7379 52%, #2f9b9b 100%);
}

.mode-banner--all {
  color: #fff9f1;
  border-color: rgba(74, 58, 24, 0.24);
  background:
    radial-gradient(circle at top right, rgba(255, 234, 186, 0.2), transparent 30%),
    linear-gradient(135deg, #3b4f59 0%, #6a5a2a 52%, #b88a2f 100%);
}

.mode-banner--production .eyebrow,
.mode-banner--sandbox .eyebrow,
.mode-banner--all .eyebrow,
.mode-banner--production h2,
.mode-banner--sandbox h2,
.mode-banner--all h2,
.mode-banner--production p,
.mode-banner--sandbox p,
.mode-banner--all p {
  color: inherit;
}

.mode-banner__warning {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(16, 33, 43, 0.16);
  font-weight: 700;
}

.runtime-toggle-row {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

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

.sandbox-simulator-form--compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.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;
}

.statistics-config-toggle {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.55);
}

.statistics-config-toggle summary {
  list-style: none;
  cursor: pointer;
}

.statistics-config-toggle summary::after,
.statistics-type-toggle summary::after {
  content: "Mostrar";
  display: inline-block;
  margin-top: 10px;
  color: var(--accent-strong);
  font-size: 0.85rem;
}

.statistics-config-toggle[open] summary::after,
.statistics-type-toggle[open] summary::after {
  content: "Ocultar";
}

.statistics-config-toggle summary::-webkit-details-marker {
  display: none;
}

.statistics-config-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.statistics-config-summary h2 {
  margin-bottom: 6px;
}

.statistics-config-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.statistics-config-preview div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
}

.statistics-config-preview span {
  color: var(--muted);
  font-size: 0.88rem;
}

.statistics-config-preview strong {
  font-size: 1.05rem;
}

.statistics-type-toggle {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.42);
}

.statistics-type-toggle summary {
  list-style: none;
  cursor: pointer;
}

.statistics-type-toggle summary::-webkit-details-marker {
  display: none;
}

.statistics-type-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.statistics-type-summary h3 {
  margin-bottom: 6px;
}

.statistics-type-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.statistics-type-preview div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.45);
}

.statistics-type-preview span {
  color: var(--muted);
  font-size: 0.88rem;
}

.statistics-type-preview strong {
  font-size: 1rem;
}

.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;
}

.sandbox-strategy-table th,
.sandbox-strategy-table td {
  white-space: nowrap;
}

.sandbox-strategy-table td strong {
  font-weight: 700;
}

.sandbox-table-tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.sandbox-table-tools select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.72);
  font: inherit;
}

.sandbox-sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 24px;
}

.sandbox-sortable::after {
  content: "↕";
  position: absolute;
  right: 8px;
  opacity: 0.45;
}

.sandbox-sortable[data-sort-direction="asc"]::after {
  content: "↑";
  opacity: 1;
}

.sandbox-sortable[data-sort-direction="desc"]::after {
  content: "↓";
  opacity: 1;
}

.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);
}

.predictor-comparison-accuracy {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}

.predictor-comparison-accuracy__item {
  padding: 14px 16px;
  border: 1px solid rgba(16, 33, 43, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.38);
}

.predictor-comparison-accuracy__value {
  font-size: clamp(1.3rem, 3vw, 2.15rem);
  line-height: 1;
  margin-bottom: 8px;
}

.predictor-window-edge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.predictor-window-edge__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid rgba(16, 33, 43, 0.12);
  background: rgba(16, 33, 43, 0.06);
  color: var(--ink);
}

.predictor-window-edge__icon--check {
  color: #0d6b45;
  border-color: rgba(13, 107, 69, 0.2);
  background: rgba(13, 107, 69, 0.12);
}

.predictor-window-edge__icon--x {
  color: #a63232;
  border-color: rgba(166, 50, 50, 0.2);
  background: rgba(166, 50, 50, 0.12);
}

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

.recent-bets-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(150px, 0.8fr)) auto;
  gap: 12px;
  width: 100%;
  align-items: end;
}

.recent-bets-filter {
  display: grid;
  gap: 6px;
  margin: 0;
}

.recent-bets-filter span {
  font-size: 0.92rem;
  color: var(--muted);
}

.recent-bets-filter input,
.recent-bets-filter select {
  width: 100%;
}

.recent-bets-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.recent-bets-meta {
  margin: 0;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

.analysis-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1.8fr) repeat(4, minmax(160px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.analysis-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.analysis-summary__card,
.analysis-config-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.52);
}

.analysis-summary__card span,
.analysis-config-card span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
}

.analysis-summary__card strong,
.analysis-config-card strong {
  display: block;
  margin-top: 6px;
}

.analysis-summary__card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.analysis-config-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.split--tight {
  gap: 16px;
}

.recent-bets-grid {
  width: 100%;
  min-height: 620px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  --ag-font-family: Georgia, "Times New Roman", serif;
  --ag-background-color: rgba(255, 250, 242, 0.92);
  --ag-foreground-color: var(--ink);
  --ag-header-background-color: #f2e4d1;
  --ag-header-foreground-color: var(--accent-strong);
  --ag-odd-row-background-color: rgba(194, 88, 27, 0.04);
  --ag-row-hover-color: rgba(194, 88, 27, 0.08);
  --ag-border-color: rgba(16, 33, 43, 0.1);
  --ag-selected-row-background-color: rgba(194, 88, 27, 0.12);
}

.recent-bets-grid .ag-header-cell-label {
  font-weight: 700;
}

.recent-bets-grid .ag-cell {
  line-height: 1.4;
}

.recent-bets-grid .ag-cell-wrap {
  white-space: normal;
}

.recent-bets-empty {
  margin: 14px 0 0;
  color: var(--muted);
}

.recent-bets-mobile-list {
  display: none;
  gap: 12px;
}

.recent-bets-mobile-list--force-visible {
  display: grid;
}

.recent-bet-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.58);
}

.recent-bet-card p {
  margin-bottom: 8px;
}

.recent-bet-card__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.bettor-config-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.bettor-config-card {
  border-color: rgba(166, 50, 50, 0.18);
}

.bettor-config-card--eligible {
  border-color: rgba(13, 107, 69, 0.34);
  background:
    radial-gradient(circle at top right, rgba(13, 107, 69, 0.14), transparent 32%),
    linear-gradient(180deg, rgba(230, 248, 238, 0.96) 0%, rgba(255, 255, 255, 0.92) 100%);
}

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

.runtime-actions form {
  margin: 0;
}

.status-inline {
  display: inline-block;
  margin-left: 10px;
  font-size: 1rem;
  color: var(--muted);
}

.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--neutral {
  fill: rgba(16, 33, 43, 0.18);
}

.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;
}

.badge--neutral {
  background: rgba(16, 33, 43, 0.08);
  color: var(--ink);
}

.prediction-trend-card--up {
  border-color: rgba(13, 107, 69, 0.22);
  background:
    radial-gradient(circle at top right, rgba(13, 107, 69, 0.08), transparent 32%),
    color-mix(in srgb, var(--panel) 92%, white);
}

.prediction-trend-card--down {
  border-color: rgba(166, 50, 50, 0.22);
  background:
    radial-gradient(circle at top right, rgba(166, 50, 50, 0.08), transparent 32%),
    color-mix(in srgb, var(--panel) 92%, white);
}

.prediction-trend-card--neutral {
  border-color: rgba(16, 33, 43, 0.12);
}

.predictor-admin {
  display: block;
}

.predictor-admin__list,
.predictor-admin__editor {
  min-width: 0;
}

.predictor-list {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.predictor-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.58);
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.predictor-card--selected {
  border-color: rgba(194, 88, 27, 0.42);
  box-shadow: 0 18px 34px rgba(194, 88, 27, 0.12);
  transform: translateY(-1px);
}

.predictor-card__head,
.predictor-card__actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.predictor-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.predictor-card__description {
  color: var(--muted);
}

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

.predictor-card__metrics div,
.predictor-mini-flag {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 250, 242, 0.68);
}

.predictor-card__metrics span,
.predictor-mini-flag {
  color: var(--muted);
  font-size: 0.88rem;
}

.predictor-card__metrics strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
}

.predictor-card__toggles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.predictor-card__performance {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.predictor-card__performance-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.predictor-card__performance-head h4 {
  margin: 0;
}

.predictor-performance-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.predictor-performance-summary div,
.predictor-confidence-bucket {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 250, 242, 0.68);
}

.predictor-performance-summary span,
.predictor-confidence-bucket span {
  color: var(--muted);
  font-size: 0.85rem;
}

.predictor-performance-summary strong,
.predictor-confidence-bucket strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
}

.predictor-performance-summary small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.8rem;
}

.predictor-confidence-buckets {
  display: grid;
  gap: 10px;
}

.predictor-confidence-bucket {
  display: grid;
  grid-template-columns: minmax(92px, 0.9fr) repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
}

.predictor-confidence-bucket__range strong {
  margin-top: 0;
}

.predictor-mini-flag--on {
  color: #0d6b45;
  border-color: rgba(13, 107, 69, 0.24);
}

.predictor-card__actions {
  align-items: center;
  flex-wrap: wrap;
}

.predictor-card__performance-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.predictor-card__detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.predictor-card__config {
  margin-bottom: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.predictor-card__config summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
}

.predictor-card__config summary::-webkit-details-marker {
  display: none;
}

.predictor-card__config[open] summary {
  margin-bottom: 14px;
}

.predictor-quick-toggle {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.predictor-editor-note {
  color: var(--muted);
}

.predictor-validation-panel {
  display: grid;
  gap: 14px;
}

.predictor-validation-panel__head h3 {
  margin-bottom: 0;
}

.predictor-validation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.predictor-validation-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.5);
}

.predictor-validation-list {
  display: grid;
  gap: 10px;
}

.predictor-validation-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 250, 242, 0.58);
}

.predictor-validation-item strong {
  font-size: 0.95rem;
}

.predictor-validation-item span {
  color: var(--muted);
  font-size: 0.88rem;
}

.predictor-validation-item--ok {
  border-color: rgba(13, 107, 69, 0.2);
}

.predictor-validation-item--error {
  border-color: rgba(166, 50, 50, 0.28);
  background: rgba(255, 240, 240, 0.68);
}

.predictor-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.predictor-form-grid--checks {
  align-items: stretch;
}

.predictor-section {
  display: grid;
  gap: 14px;
}

.predictor-toggle-grid,
.predictor-number-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.predictor-check-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
}

.predictor-check-card input {
  width: auto;
  margin-top: 2px;
}

.predictor-check-card span {
  display: grid;
  gap: 4px;
}

.predictor-check-card small {
  color: var(--muted);
}

.predictor-range-hint {
  color: var(--muted);
  font-size: 0.84rem;
}

.predictor-range-hint--error {
  color: #a63232;
}

.predictor-input--error {
  border-color: rgba(166, 50, 50, 0.6);
  background: rgba(255, 240, 240, 0.78);
}

.predictor-form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.app-modal {
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: none;
  background: transparent;
}

.app-modal::backdrop {
  background: rgba(16, 33, 43, 0.5);
  backdrop-filter: blur(6px);
}

.app-modal__surface {
  margin: 0;
  border: 1px solid rgba(16, 33, 43, 0.12);
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(194, 88, 27, 0.08), transparent 28%),
    rgba(255, 252, 247, 0.98);
  box-shadow: 0 30px 60px rgba(16, 33, 43, 0.22);
}

.app-modal__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 22px 0;
}

.predictor-editor-modal__surface {
  width: min(1180px, calc(100vw - 32px));
}

.predictor-editor-modal__body {
  display: grid;
  gap: 18px;
  padding: 18px 22px 22px;
  overflow: auto;
  max-height: calc(100vh - 140px);
}

.predictor-modal__surface {
  width: min(1040px, calc(100vw - 32px));
}

.predictor-modal__body {
  display: grid;
  gap: 18px;
  padding: 18px 22px 22px;
  overflow: auto;
  max-height: calc(100vh - 140px);
}

.predictor-modal__summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.predictor-modal__summary article {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 250, 242, 0.72);
}

.predictor-modal__summary span,
.predictor-modal__table-row span {
  color: var(--muted);
  font-size: 0.86rem;
}

.predictor-modal__summary strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
}

.predictor-modal__section {
  display: grid;
  gap: 12px;
}

.predictor-modal__table {
  display: grid;
  gap: 8px;
}

.predictor-modal__table-row {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.72);
}

.predictor-modal__table--compact .predictor-modal__table-row {
  grid-template-columns: minmax(96px, 1.2fr) repeat(3, minmax(0, 1fr));
}

.predictor-modal__table-row--head {
  background: rgba(250, 240, 229, 0.88);
}

.predictor-modal__table-row--head span {
  color: var(--ink);
  font-weight: 700;
}

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

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

.optimization-filters {
  display: grid;
  grid-template-columns: minmax(320px, 1.8fr) minmax(240px, auto) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.optimization-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
}

.optimization-checkbox input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.optimization-filter-note {
  margin: 0 0 18px;
}

.optimization-alert {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(176, 106, 0, 0.2);
  border-radius: 16px;
  background: rgba(255, 244, 223, 0.82);
  color: #8a5600;
}

.optimization-config-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.optimization-config-card strong {
  line-height: 1.45;
}

.optimization-metric-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(194, 88, 27, 0.1), transparent 28%),
    rgba(255, 255, 255, 0.62);
}

.optimization-metric-card .metric {
  margin-bottom: 10px;
}

.optimization-report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.optimization-report-card {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.56);
}

.optimization-report-card span {
  color: var(--muted);
  font-size: 0.88rem;
}

.optimization-report-card strong {
  font-size: 1.08rem;
}

.optimization-insights-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.optimization-bars {
  display: grid;
  gap: 12px;
}

.optimization-bar-row {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(16, 33, 43, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.44);
}

.optimization-bar-row__head,
.optimization-bar-row__foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.optimization-bar-row__head span,
.optimization-bar-row__foot span {
  color: var(--muted);
  font-size: 0.88rem;
}

.optimization-bar-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(16, 33, 43, 0.08);
}

.optimization-bar-fill {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
}

.optimization-bar-fill--positive {
  background: linear-gradient(90deg, #0d6b45 0%, #2da06a 100%);
}

.optimization-bar-fill--negative {
  background: linear-gradient(90deg, #a63232 0%, #dc6a6a 100%);
}

.optimization-line-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.optimization-line-point {
  stroke-width: 2;
}

.optimization-line-point--success {
  fill: rgba(13, 107, 69, 0.24);
  stroke: #0d6b45;
}

.optimization-line-point--failure {
  fill: rgba(166, 50, 50, 0.2);
  stroke: #a63232;
}

.optimization-timeline-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.optimization-timeline-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.46);
}

.optimization-timeline-item div {
  display: grid;
  gap: 4px;
}

.optimization-timeline-item span {
  color: var(--muted);
  font-size: 0.88rem;
}

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

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

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

  .optimization-config-grid,
  .optimization-report-grid,
  .optimization-insights-grid {
    grid-template-columns: 1fr;
  }

  .optimization-filters {
    grid-template-columns: 1fr;
  }

  .optimization-timeline-item {
    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;
  }

  .strategy-card__summary {
    flex-direction: column;
    align-items: stretch;
  }

  .strategy-card__summary-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
  }

  .strategy-form-grid {
    grid-template-columns: 1fr;
  }

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

  .recent-bets-tools {
    grid-template-columns: 1fr;
  }

  .analysis-filters,
  .analysis-summary,
  .analysis-config-grid {
    grid-template-columns: 1fr;
  }

  .recent-bets-actions {
    justify-items: start;
  }

  .recent-bets-meta {
    text-align: left;
  }

  .recent-bets-grid {
    min-height: 480px;
  }

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

  .statistics-config-summary,
  .statistics-config-preview,
  .statistics-type-summary,
  .statistics-type-preview,
  .bettor-config-grid,
  .predictor-modal__summary,
  .predictor-validation-grid,
  .predictor-form-grid,
  .predictor-card__metrics,
  .predictor-performance-summary,
  .predictor-card__toggles,
  .predictor-toggle-grid,
  .predictor-number-grid,
  .predictor-confidence-bucket {
    grid-template-columns: 1fr;
  }

  .sandbox-simulator-form--compact {
    grid-template-columns: 1fr;
  }

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

  .runtime-toggle-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-modal {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .app-modal__header,
  .predictor-editor-modal__body,
  .predictor-modal__body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .predictor-modal__table-row,
  .predictor-modal__table--compact .predictor-modal__table-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .mode-switch {
    width: 100%;
    display: grid;
  }

  .mode-switch__link {
    width: 100%;
    min-width: 0;
  }

  .mode-banner {
    padding: 22px 18px;
  }

  .recent-bets-grid {
    display: none;
  }

  .recent-bets-mobile-list {
    display: grid;
  }
}
