.research-page {
  display: grid;
  gap: 16px;
}

.research-hero,
.research-results-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.research-hero h1,
.research-results-head h2 {
  margin: 6px 0;
}

.research-hero h1 {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.research-hero p,
.research-disclaimer {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.research-market-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  color: #0f4e78;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.24);
}

.market-controls {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-soft);
  padding: 4px 8px;
}

.market-tab,
.research-tab {
  border: 0;
  background: var(--control-bg);
  color: var(--control-text);
  box-shadow: var(--control-shadow);
  font-weight: 800;
  cursor: pointer;
  transition:
    color 0.16s ease,
    background 0.16s ease,
    opacity 0.16s ease;
}

.market-tab:hover,
.research-tab:hover {
  opacity: 0.9;
}

.market-tab {
  width: 100%;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.76rem;
}

.research-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.research-tab {
  border-radius: 999px;
  padding: 7px 12px;
}

.market-tab[aria-pressed="true"],
.research-tab[aria-pressed="true"] {
  color: #fff;
  background: linear-gradient(125deg, var(--btn-primary-start), var(--btn-primary-end));
  box-shadow: 0 10px 22px var(--btn-primary-shadow);
}

.research-results {
  display: grid;
  gap: 12px;
}

.research-disclaimer,
.research-status {
  font-size: 0.86rem;
}

.research-status {
  margin: 0;
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

.research-load-more {
  min-height: 42px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.82rem;
}

.research-load-more.is-visible {
  display: flex;
}

.research-loader {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(14, 165, 233, 0.2);
  border-top-color: #0ea5e9;
  border-radius: 50%;
  animation: research-spin 0.75s linear infinite;
}

@keyframes research-spin {
  to {
    transform: rotate(360deg);
  }
}

.research-card {
  position: relative;
  overflow: hidden;
  min-height: 154px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 13px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.96), rgba(240, 249, 255, 0.84)) padding-box,
    linear-gradient(130deg, rgba(14, 165, 233, 0.48), rgba(34, 197, 94, 0.4)) border-box;
  box-shadow: 0 10px 20px rgba(24, 55, 85, 0.08);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.research-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(24, 55, 85, 0.16);
}

.research-card:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 4px var(--ring),
    0 18px 34px rgba(24, 55, 85, 0.16);
}

.research-card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.research-symbol {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 900;
}

.research-score {
  flex: 0 0 auto;
  border: 1px solid rgba(14, 165, 233, 0.24);
  border-radius: 999px;
  padding: 5px 8px;
  color: #0f4e78;
  background: rgba(14, 165, 233, 0.12);
  font-size: 0.72rem;
  font-weight: 900;
}

.research-name,
.research-reason {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.38;
}

.research-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.research-metrics span {
  border: 1px solid rgba(100, 116, 139, 0.22);
  border-radius: 999px;
  padding: 4px 7px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  font-size: 0.7rem;
}

body[data-theme="dark"] .market-controls {
  border-color: rgba(67, 90, 113, 0.72);
  background: rgba(18, 32, 47, 0.86);
}

body[data-theme="dark"] .research-market-pill {
  color: #bae6fd;
  background: rgba(14, 165, 233, 0.16);
  border-color: rgba(125, 211, 252, 0.28);
}

body[data-theme="dark"] .research-card {
  background:
    linear-gradient(155deg, rgba(24, 38, 56, 0.95), rgba(21, 33, 48, 0.9)) padding-box,
    linear-gradient(130deg, rgba(110, 194, 255, 0.55), rgba(52, 211, 153, 0.42)) border-box;
}

body[data-theme="dark"] .research-score {
  color: #f0f9ff;
  border-color: rgba(125, 211, 252, 0.72);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.72), rgba(37, 99, 235, 0.68));
  box-shadow: 0 7px 16px rgba(2, 132, 199, 0.22);
}

body[data-theme="dark"] .research-metrics span {
  border-color: rgba(99, 130, 160, 0.34);
  background: rgba(16, 28, 42, 0.72);
}

@media (max-width: 720px) {
  .market-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .research-results-head {
    align-items: flex-start;
  }
}
