:root {
  --bg: #090b0f;
  --bg-elevated: #11151b;
  --bg-panel: #151a22;
  --bg-panel-2: #1b222c;
  --border: #2a3442;
  --text: #edf2f7;
  --text-muted: #91a0b3;
  --accent: #3dd6c6;
  --accent-dim: #2a9d8f;
  --blue: #6ea8fe;
  --violet: #b48cff;
  --warn: #f4a261;
  --danger: #e76f51;
  --success: #52b788;
  --score-very-high: #b48cff;
  --score-high: #45d6c5;
  --score-elevated: #55a7d9;
  --score-watch: #7897b8;
  --score-mid: #7897b8;
  --score-low: #8b9bb0;
  --radius: 8px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", "Consolas", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background:
    linear-gradient(180deg, rgba(110, 168, 254, 0.08), transparent 280px),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.1rem;
  background: rgba(10, 13, 18, 0.94);
  border-right: 1px solid var(--border);
}

.app-main {
  min-width: 0;
  padding: 1.1rem 1.25rem 2rem;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
  min-width: 200px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  color: #071014;
  font-weight: 800;
}

.brand strong {
  display: block;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.brand small,
.subtitle {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.app-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-item {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: var(--accent);
  background: rgba(61, 214, 198, 0.1);
  border-color: rgba(61, 214, 198, 0.28);
}

.sidebar-status {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 18px rgba(82, 183, 136, 0.7);
}

.topbar h1 {
  margin: 0.1rem 0 0;
  font-size: 1.35rem;
}

.eyebrow,
.panel-kicker,
.metric-label {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.session-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.language-control {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2rem;
  padding: 0.2rem 0.35rem 0.2rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.language-control select {
  border: 0;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 0.2rem 0.35rem 0.2rem 0.55rem;
  font: inherit;
  cursor: pointer;
}

.language-control option {
  background: var(--bg-elevated);
  color: var(--text);
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.hero-panel,
.landing-hero {
  margin-bottom: 1rem;
  padding: 1.1rem;
  background: linear-gradient(135deg, rgba(61, 214, 198, 0.1), rgba(110, 168, 254, 0.07)), var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.compact-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
}

.hero-panel h2,
.landing-hero h2 {
  max-width: 900px;
  margin: 0.25rem 0 0;
  font-size: 1.15rem;
  line-height: 1.35;
}

.landing-hero {
  min-height: min(54vh, 520px);
  display: flex;
  flex-direction: column;
  justify-content: end;
  background:
    linear-gradient(90deg, rgba(9, 11, 15, 0.95), rgba(9, 11, 15, 0.6)),
    url("https://images.unsplash.com/photo-1642790106117-e829e14a795f?auto=format&fit=crop&w=1800&q=80");
  background-size: cover;
  background-position: center;
}

.landing-hero p {
  max-width: 760px;
  color: var(--text-muted);
}

.hero-actions,
.hero-metrics {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.hero-metrics > div {
  min-width: 112px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(9, 11, 15, 0.36);
}

.main-tabs {
  margin-bottom: 1rem;
}

.tabs {
  display: flex;
  gap: 0.35rem;
  background: var(--bg-elevated);
  padding: 0.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0.45rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  background: var(--bg-panel);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--border);
}

.pill {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pill-idle {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.pill-loading {
  background: rgba(61, 214, 198, 0.12);
  color: var(--accent);
  border: 1px solid rgba(61, 214, 198, 0.35);
}

.pill-error {
  background: rgba(231, 111, 81, 0.12);
  color: var(--danger);
  border: 1px solid rgba(231, 111, 81, 0.35);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.filter-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  margin-bottom: 0;
}

.radar-workspace {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.filter-sidebar {
  position: sticky;
  top: 1rem;
  padding: 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.filter-sidebar-title {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.filter-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
}

.filter-group-label {
  min-width: unset;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-price {
  margin-top: 0.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.price-range-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.price-range-inputs input[type="number"] {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  font: inherit;
  font-size: 0.85rem;
}

.price-range-inputs input[type="number"]:focus {
  outline: none;
  border-color: var(--accent-dim);
}

.radar-main {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.radar-panel-secondary .table-wrap {
  min-height: 280px;
}

.radar-panel .table-wrap {
  border-top: 1px solid var(--border);
}

body.modal-open {
  overflow: hidden;
}

.news-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.news-modal.hidden {
  display: none;
}

.news-modal-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(11, 15, 20, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
}

.news-panel {
  position: relative;
  z-index: 1;
  width: min(540px, calc(100vw - 2.5rem));
  max-height: min(80vh, calc(100vh - 2.5rem));
  display: flex;
  flex-direction: column;
  padding: 1rem 1.1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.58);
  overflow: hidden;
}

.news-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.news-list-header h3 {
  margin: 0;
  font-size: 0.95rem;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

.btn-icon {
  min-width: 2rem;
  padding: 0.2rem 0.45rem;
  line-height: 1.2;
  font-size: 1.1rem;
}

.news-summary {
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.news-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.news-summary-header h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
}

.news-summary-body {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.news-summary-link {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
}

.news-summary-link a {
  color: var(--accent);
}

.news-timeline {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.timeline-item-clickable {
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s;
}

.timeline-item-clickable:hover {
  background: rgba(61, 214, 198, 0.06);
}

.timeline-item-selected {
  background: rgba(61, 214, 198, 0.1);
  outline: 1px solid rgba(61, 214, 198, 0.35);
}

.filter-chip {
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-muted);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.filter-chip:hover {
  color: var(--text);
  border-color: var(--accent-dim);
}

.filter-chip.active {
  background: rgba(61, 214, 198, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.inline-title {
  margin: 0;
  font-size: 1rem;
}

input[type="search"] {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font: inherit;
  min-width: 180px;
}

input[type="search"]:focus {
  outline: none;
  border-color: var(--accent-dim);
}

.btn {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-primary {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: #041210;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--text-muted);
}

.select-filter {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-size: 0.875rem;
}

.pill-meta {
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.headline-cell {
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

a.link {
  color: var(--accent);
  text-decoration: none;
}

a.link:hover {
  text-decoration: underline;
}

.radar-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 1.1fr);
  gap: 1rem;
  align-items: start;
}

.backtest-layout {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(380px, 1.1fr);
  gap: 1rem;
  align-items: start;
}

.bar-event-day {
  background: rgba(61, 214, 198, 0.08);
}

.bar-event-day td {
  color: var(--accent);
  font-weight: 600;
}

.bar-reference-day {
  background: rgba(255, 193, 7, 0.06);
}

.bar-reference-day td {
  color: var(--warn);
}

@media (max-width: 960px) {
  .radar-workspace {
    grid-template-columns: 1fr;
  }

  .filter-sidebar {
    position: static;
  }

  .radar-layout,
  .backtest-layout {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.radar-panel {
  position: relative;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.panel-header h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.muted {
  color: var(--text-muted);
  font-size: 0.8rem;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th,
td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-elevated);
}

tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}

tbody tr:hover {
  background: rgba(61, 214, 198, 0.05);
}

tbody tr.selected {
  background: rgba(61, 214, 198, 0.1);
  box-shadow: inset 3px 0 0 var(--accent);
}

.empty-row td {
  color: var(--text-muted);
  text-align: center;
  cursor: default;
  padding: 2rem;
}

.score-badge {
  display: inline-block;
  min-width: 2.5rem;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.8rem;
  text-align: center;
}

.score-high {
  background: rgba(61, 214, 198, 0.18);
  color: var(--score-high);
}

.score-mid {
  background: rgba(120, 151, 184, 0.16);
  color: var(--score-mid);
}

.score-low {
  background: rgba(139, 155, 176, 0.15);
  color: var(--score-low);
}

.event-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.35rem;
}

.event-tag {
  display: inline-flex;
  align-items: center;
  min-height: 1.25rem;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.event-tag-info {
  border-color: rgba(88, 166, 255, 0.36);
  background: rgba(88, 166, 255, 0.1);
  color: #9ecbff;
}

.event-tag-positive {
  border-color: rgba(61, 214, 198, 0.38);
  background: rgba(61, 214, 198, 0.12);
  color: var(--accent);
}

.event-tag-warning {
  border-color: rgba(241, 196, 15, 0.4);
  background: rgba(241, 196, 15, 0.12);
  color: #f4d35e;
}

.event-tag-danger {
  border-color: rgba(231, 111, 81, 0.42);
  background: rgba(231, 111, 81, 0.12);
  color: var(--danger);
}

.phase-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.detail-panel {
  min-height: 480px;
}

.empty-state {
  padding: 2.5rem 1.25rem;
  text-align: center;
  color: var(--text-muted);
}

.hidden {
  display: none !important;
}

#detail-content {
  padding: 1rem;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.score-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
}

.score-card .label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.score-card .value {
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 0.2rem;
}

.score-card.highlight .value {
  color: var(--accent);
}

.backtest-news-block {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.backtest-news-meta {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
}

.backtest-news-headline {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}

.backtest-news-summary {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.backtest-news-link {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
}

.backtest-news-link a {
  color: var(--accent);
}

.backtest-impact-note {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
}

.compact-recs {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.verdict-long {
  color: var(--success);
  font-weight: 600;
}

.verdict-short {
  color: var(--danger);
  font-weight: 600;
}

.verdict-volatile {
  color: var(--warn);
  font-weight: 600;
}

.verdict-omit,
.verdict-insufficient {
  color: var(--text-muted);
}

.impact-high {
  color: var(--accent);
  font-weight: 600;
}

.valuation-row-clickable {
  cursor: pointer;
}

.valuation-row-clickable:hover td {
  background: rgba(61, 214, 198, 0.05);
}

.detail-block {
  margin-bottom: 1.25rem;
}

.detail-block h3 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.thesis {
  margin: 0;
  font-size: 0.9rem;
}

.warnings {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  color: var(--warn);
  font-size: 0.85rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
}

.metric {
  background: var(--bg-elevated);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
}

.metric .label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.metric .value {
  font-family: var(--mono);
  font-size: 0.9rem;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 1rem;
  border-left: 2px solid var(--border);
}

.timeline-item {
  position: relative;
  padding: 0 0 1rem 1rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.35rem;
  top: 0.35rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--bg-panel);
}

.timeline-item.timeline-context::before {
  background: var(--muted);
  opacity: 0.6;
}

.timeline-section-title {
  margin: 0.75rem 0 0.5rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}

.timeline-section-title:first-child {
  margin-top: 0;
}

.timeline-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

.timeline-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0.15rem 0;
}

.timeline-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.timeline-summary {
  font-size: 0.85rem;
  margin: 0.35rem 0 0;
  color: var(--text);
}

.reliability {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.7rem;
  text-transform: uppercase;
  margin-left: 0.35rem;
}

.reliability-official,
.reliability-high {
  background: rgba(82, 183, 136, 0.2);
  color: var(--success);
}

.reliability-medium {
  background: rgba(244, 162, 97, 0.2);
  color: var(--warn);
}

.reliability-low,
.reliability-unverified {
  background: rgba(139, 155, 176, 0.2);
  color: var(--text-muted);
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.summary-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.summary-card .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.summary-card .value {
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.recommendations {
  margin: 0;
  padding: 0.75rem 1rem 1rem 2rem;
  color: var(--text);
}

.recommendations li {
  margin-bottom: 0.35rem;
}

.outcome-win {
  color: var(--success);
}

.outcome-loss {
  color: var(--danger);
}

.outcome-pending {
  color: var(--text-muted);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-header h2,
.docs-content h2 {
  margin: 0.15rem 0 0;
  font-size: 1.25rem;
}

.section-copy {
  max-width: 720px;
  margin: 0.35rem 0 0;
  color: var(--text-muted);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.8rem;
}

.market-news-card,
.market-news-empty,
.feature-card,
.pricing-card {
  padding: 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.market-news-card {
  display: flex;
  flex-direction: column;
  min-height: 210px;
}

.market-news-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: var(--mono);
}

.market-news-card h3 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.35;
}

.market-news-card p {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.ticker-strip {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 0.75rem;
}

.ticker-pill {
  padding: 0.12rem 0.38rem;
  border-radius: 5px;
  background: rgba(110, 168, 254, 0.12);
  color: var(--blue);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.feature-grid,
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.feature-card span {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.feature-card h3,
.pricing-card h3 {
  margin: 0.45rem 0 0.35rem;
}

.feature-card p,
.pricing-card p {
  color: var(--text-muted);
}

.docs-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1rem;
}

.docs-index {
  position: sticky;
  top: 1rem;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
}

.docs-index a,
.market-news-card a {
  color: var(--accent);
  text-decoration: none;
}

.docs-index a:hover,
.market-news-card a:hover {
  text-decoration: underline;
}

.docs-content section {
  margin-bottom: 0.8rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
}

.docs-content p {
  color: var(--text-muted);
}

.pricing-card.featured {
  border-color: rgba(61, 214, 198, 0.6);
  box-shadow: inset 0 0 0 1px rgba(61, 214, 198, 0.18);
}

.price {
  margin: 0.25rem 0;
  color: var(--text) !important;
  font-size: 2rem;
  font-weight: 700;
}

.price span {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .app-nav {
    flex: 1;
    min-width: 280px;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .nav-item {
    width: auto;
  }

  .sidebar-status {
    margin-top: 0;
  }

  .compact-hero,
  .section-header {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  .app-main {
    padding: 0.85rem;
  }

  .topbar,
  .feature-grid,
  .pricing-grid,
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
    margin-left: 0;
  }

  .feature-grid,
  .pricing-grid,
  .docs-layout {
    display: grid;
  }

  .news-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Account & auth --- */
.auth-grid,
.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 18px;
  margin-top: 18px;
}

.auth-panel,
.account-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
}

.auth-panel label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
}

.auth-panel input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: inherit;
  padding: 10px 12px;
  font-size: 0.95rem;
}

.auth-panel input:focus {
  outline: 2px solid rgba(94, 234, 212, 0.4);
  outline-offset: 1px;
}

.auth-error {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(248, 113, 113, 0.5);
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
  font-size: 0.9rem;
}

.account-feedback {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(94, 234, 212, 0.45);
  border-radius: 8px;
  background: rgba(94, 234, 212, 0.09);
  color: var(--text);
}

.feedback-error {
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
}

.feedback-warning {
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(251, 191, 36, 0.1);
}

.turnstile-widget:empty {
  display: none;
}

.account-details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 18px;
  margin: 0;
  font-size: 0.92rem;
}

.account-details dt {
  opacity: 0.65;
}

.account-details dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.account-api-key {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(94, 234, 212, 0.08);
  border: 1px dashed rgba(94, 234, 212, 0.4);
  font-size: 0.8rem;
  word-break: break-all;
  user-select: all;
}

.compact-form {
  padding: 0;
}

.onboarding-card {
  margin-top: 1rem;
  padding: 1.25rem;
  border-color: rgba(94, 234, 212, 0.42);
}

.onboarding-steps {
  display: grid;
  gap: 0.55rem;
  margin: 0.75rem 0;
  padding-left: 1.3rem;
}

.inline-confirm {
  margin-top: 0.9rem;
  padding: 0.85rem;
  border: 1px solid rgba(248, 113, 113, 0.45);
  border-radius: 8px;
  background: rgba(248, 113, 113, 0.08);
}

.inline-confirm p {
  margin-top: 0;
}

.btn-danger {
  border-color: rgba(248, 113, 113, 0.7);
  background: #991b1b;
  color: #fff;
}

.session-list {
  display: grid;
  gap: 0.65rem;
}

.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.session-item div {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.session-item strong,
.session-item small {
  overflow-wrap: anywhere;
}

.session-current {
  width: fit-content;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  background: rgba(94, 234, 212, 0.13);
  color: var(--accent);
  font-size: 0.75rem;
}

.payment-security-note {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.payment-panel {
  position: relative;
  z-index: 2;
  width: min(94vw, 520px);
  max-height: 90vh;
  overflow: auto;
  padding: 1.25rem;
}

#paypal-button-container {
  min-height: 45px;
  margin: 1rem 0;
}

@media (max-width: 520px) {
  .session-item {
    align-items: stretch;
    flex-direction: column;
  }
}

/* --- Accessibility foundations --- */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2000;
  padding: 0.65rem 0.9rem;
  border: 2px solid currentColor;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(calc(-100% - 1rem));
}

.skip-link:focus {
  transform: translateY(0);
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid #ffffff !important;
  outline-offset: 3px;
}

.filter-price {
  min-width: 0;
  margin-inline: 0;
  padding-inline: 0;
  padding-bottom: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
}

.filter-price legend {
  width: 100%;
  padding: 0;
}

.price-range-inputs label {
  display: block;
}

.radar-open-button {
  display: block;
  width: 100%;
  padding: 0.2rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.radar-open-button:hover .radar-title {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.risk-disclaimer {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.5;
}
