:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #64748b;
  --line: #d8e1ec;
  --panel: #ffffff;
  --page: #f5f7fb;
  --navy: #102a43;
  --teal: #0f766e;
  --green: #15803d;
  --amber: #c47c0f;
  --red: #be2d2d;
  --blue: #2563eb;
  --shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.beta-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 180px minmax(280px, 1fr) minmax(220px, 360px);
  gap: 18px;
  align-items: center;
  padding: 14px clamp(16px, 3vw, 36px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.beta-logo {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.beta-logo img {
  display: block;
  width: 150px;
  max-width: 100%;
  height: auto;
}

.beta-search {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.beta-search label,
.beta-kicker,
.beta-section-heading span,
.beta-score-head span,
.beta-gauge-axis,
.beta-table-panel small,
.beta-method-card span {
  color: var(--muted);
  font-size: 12px;
}

.beta-search input {
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.beta-search button,
.beta-section-heading button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
}

.beta-search button:disabled,
.beta-section-heading button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.beta-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.beta-status[data-tone="ok"] {
  color: var(--teal);
}

.beta-status[data-tone="warn"] {
  color: var(--amber);
}

.beta-status[data-tone="error"] {
  color: var(--red);
}

.beta-status[data-tone="loading"] {
  color: var(--blue);
}

.beta-shell {
  display: grid;
  gap: 18px;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 22px clamp(14px, 3vw, 36px) 40px;
}

.beta-selection-band,
.beta-period-band,
.beta-chart-band,
.beta-method-band {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.beta-selection-band {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: 18px;
  align-items: start;
  padding: 20px;
}

.beta-kicker {
  margin: 0 0 8px;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 6px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 17px;
  line-height: 1.25;
}

#betaSelectedMeta {
  margin: 0;
  color: var(--muted);
}

.beta-search-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.beta-search-result {
  display: grid;
  gap: 3px;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  color: var(--ink);
  text-align: left;
}

.beta-search-result:hover,
.beta-table-link:hover {
  border-color: #9fb3ca;
  background: #eef6f7;
}

.beta-search-result strong,
.beta-table-link {
  color: var(--navy);
}

.beta-search-result span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.beta-search-result small {
  color: var(--muted);
}

.beta-score-grid {
  display: grid;
  grid-template-columns: 280px minmax(280px, 0.8fr) minmax(360px, 1.2fr);
  gap: 18px;
}

.beta-score-panel,
.beta-components-panel,
.beta-prediction-panel,
.beta-table-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.beta-score-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.beta-score-head,
.beta-section-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.beta-score-head strong {
  border-radius: 999px;
  padding: 6px 10px;
  background: #edf2f7;
  color: var(--muted);
  font-size: 13px;
}

.beta-score-head strong[data-tone="buy"] {
  background: #dff7ea;
  color: var(--green);
}

.beta-score-head strong[data-tone="sell"] {
  background: #fee2e2;
  color: var(--red);
}

.beta-gauge {
  display: grid;
  place-items: center;
  width: 190px;
  aspect-ratio: 1;
  justify-self: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 58%, transparent 59%),
    conic-gradient(var(--green) 0 var(--score), #e2e8f0 var(--score) 100%);
}

.beta-gauge span {
  color: var(--navy);
  font-size: 48px;
  font-weight: 850;
}

.beta-gauge-axis {
  display: flex;
  justify-content: space-between;
}

.beta-components-panel,
.beta-prediction-panel,
.beta-period-band,
.beta-chart-band,
.beta-method-band,
.beta-table-panel {
  padding: 18px;
}

.beta-components {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.beta-component {
  display: grid;
  gap: 6px;
}

.beta-component > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.beta-component strong {
  color: var(--navy);
}

.beta-component-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf4;
}

.beta-component-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--amber), var(--green));
}

.beta-prediction-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.beta-prediction-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.beta-prediction-card span,
.beta-prediction-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.beta-prediction-card strong {
  display: block;
  margin: 7px 0 4px;
  color: var(--navy);
  font-size: 20px;
}

.beta-period-heading {
  align-items: flex-start;
}

.beta-period-heading > div:first-child {
  display: grid;
  gap: 4px;
}

.beta-range-buttons {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.beta-range-buttons button {
  min-width: 45px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 850;
}

.beta-range-buttons button.active {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}

.beta-period-benchmarks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.beta-period-benchmark {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.beta-period-benchmark span,
.beta-period-benchmark small,
.beta-assumption-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.beta-period-benchmark strong {
  font-size: 22px;
}

.beta-assumption-note {
  margin: 11px 0 0;
  font-weight: 700;
}

.beta-chart-wrap {
  position: relative;
  margin-top: 14px;
  min-height: 360px;
}

.beta-chart-wrap canvas {
  display: block;
  width: 100%;
  min-height: 360px;
}

.beta-chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(248, 250, 252, 0.82);
}

.beta-chart-empty[hidden] {
  display: none;
}

.beta-oscillator-wrap {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.beta-oscillator-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.beta-oscillator-heading strong {
  color: var(--navy);
  font-size: 14px;
}

.beta-oscillator-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.beta-oscillator-wrap canvas {
  display: block;
  width: 100%;
  min-height: 170px;
}

.beta-table-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(420px, 1fr);
  gap: 18px;
}

.beta-table-scroll {
  margin-top: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: right;
  white-space: nowrap;
  font-size: 13px;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  background: #f8fafc;
  color: #44546a;
  font-weight: 750;
}

tr:last-child td {
  border-bottom: 0;
}

.is-positive {
  color: var(--green);
  font-weight: 750;
}

.is-negative {
  color: var(--red);
  font-weight: 750;
}

.beta-table-link {
  display: block;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 2px 4px;
  background: transparent;
  font-weight: 800;
  text-align: left;
}

.beta-table-panel small {
  display: block;
  margin-top: 2px;
}

.beta-method-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.beta-method-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
}

.beta-method-card strong,
.beta-method-card span {
  display: block;
}

.beta-method-card p {
  margin: 8px 0 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 1120px) {
  .beta-topbar,
  .beta-selection-band,
  .beta-score-grid,
  .beta-table-grid {
    grid-template-columns: 1fr;
  }

  .beta-score-grid {
    gap: 14px;
  }
}

@media (max-width: 720px) {
  .beta-topbar {
    position: static;
    gap: 12px;
    padding: 12px;
  }

  .beta-search {
    grid-template-columns: 1fr auto;
  }

  .beta-search label {
    grid-column: 1 / -1;
  }

  .beta-shell {
    padding: 12px 10px 28px;
  }

  .beta-selection-band,
  .beta-score-panel,
  .beta-components-panel,
  .beta-prediction-panel,
  .beta-period-band,
  .beta-chart-band,
  .beta-method-band,
  .beta-table-panel {
    padding: 14px;
  }

  .beta-prediction-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .beta-period-heading {
    display: grid;
    gap: 12px;
  }

  .beta-range-buttons {
    justify-content: flex-start;
  }

  .beta-period-benchmarks {
    grid-template-columns: 1fr;
  }

  .beta-oscillator-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  h1 {
    font-size: 30px;
  }
}
