.trends-stage {
  display: grid;
  gap: 20px;
  padding: 32px;
  background: #f4f2ec;
}

.trends-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(18, 32, 51, 0.1);
}

.trends-toolbar h2 {
  margin-top: 6px;
  color: #0d1321;
  font-family: "Geist", "IBM Plex Sans", sans-serif;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.trends-toolbar p:last-child {
  margin-top: 10px;
  color: #66758a;
  font-size: 0.8rem;
}

.trends-toolbar-actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.trends-sort {
  display: grid;
  gap: 5px;
}

.trends-sort span {
  color: #697484;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.trends-sort select,
#trends-refresh-button {
  min-height: 40px;
  border: 1px solid rgba(18, 32, 51, 0.14);
  border-radius: 2px;
  color: #122033;
  background: rgba(255, 252, 246, 0.82);
}

.trends-sort select {
  padding: 0 34px 0 12px;
  font-weight: 700;
}

.trends-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid rgba(18, 32, 51, 0.1);
  background: rgba(255, 252, 246, 0.76);
}

.trend-summary-cell {
  min-width: 0;
  padding: 15px 18px;
  border-right: 1px solid rgba(18, 32, 51, 0.08);
}

.trend-summary-cell:last-child {
  border-right: 0;
}

.trend-summary-cell span,
.trend-summary-cell small {
  display: block;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  text-transform: uppercase;
}

.trend-summary-cell span {
  color: #8a96a6;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.11em;
}

.trend-summary-cell strong {
  display: block;
  margin-top: 5px;
  color: #0d1321;
  font-family: "Geist", "IBM Plex Sans", sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
}

.trend-summary-cell small {
  margin-top: 3px;
  color: #8a96a6;
  font-size: 0.52rem;
  letter-spacing: 0.04em;
}

.trends-control-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  padding: 14px;
  border: 1px solid rgba(18, 32, 51, 0.1);
  background: rgba(255, 252, 246, 0.76);
}

.trends-view-switch {
  display: flex;
  align-items: stretch;
}

.trends-view-switch button {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid rgba(18, 32, 51, 0.14);
  color: #66758a;
  background: #fffdf8;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.trends-view-switch button + button {
  margin-left: -1px;
}

.trends-view-switch button.is-active {
  position: relative;
  z-index: 1;
  border-color: #0d1321;
  color: #fff9ef;
  background: #0d1321;
}

.trends-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.trends-selector-grid label {
  display: grid;
  gap: 5px;
  color: #697484;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.trends-selector-grid select {
  width: 100%;
  min-height: 40px;
  padding: 0 30px 0 11px;
  border: 1px solid rgba(18, 32, 51, 0.14);
  border-radius: 0;
  color: #122033;
  background: #fffdf8;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  font-weight: 700;
}

.trends-control-result {
  display: grid;
  justify-items: end;
  gap: 7px;
  min-width: 150px;
  padding-bottom: 3px;
  color: #7a8695;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.trends-control-result button {
  padding: 0;
  border: 0;
  color: #8f6418;
  background: transparent;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

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

.trend-match-group {
  grid-column: 1 / -1;
  border: 1px solid rgba(18, 32, 51, 0.11);
  background: rgba(255, 252, 246, 0.62);
}

.trend-match-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  border-left: 3px solid #c9a46a;
  list-style: none;
  cursor: pointer;
}

.trend-match-group > summary::-webkit-details-marker {
  display: none;
}

.trend-match-group > summary span,
.trend-match-counts small {
  color: #8f6418;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trend-match-group > summary h3 {
  margin-top: 4px;
  color: #0d1321;
  font-family: "Geist", "IBM Plex Sans", sans-serif;
  font-size: 1rem;
  font-weight: 800;
}

.trend-match-counts {
  display: grid;
  grid-template-columns: auto auto 18px;
  align-items: center;
  gap: 14px;
  text-align: right;
}

.trend-match-counts strong {
  color: #122033;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.61rem;
  text-transform: uppercase;
}

.trend-match-counts small {
  color: #7a8695;
}

.trend-match-counts i {
  color: #8f6418;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 1rem;
  font-style: normal;
  transition: transform 160ms ease;
}

.trend-match-group[open] .trend-match-counts i {
  transform: rotate(180deg);
}

.trend-match-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 14px;
  border-top: 1px solid rgba(18, 32, 51, 0.09);
  background: rgba(232, 226, 214, 0.28);
}

.trend-section-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 4px 0 8px;
  border-bottom: 1px solid rgba(18, 32, 51, 0.09);
}

.trend-section-heading h3 {
  color: #0d1321;
  font-family: "Geist", "IBM Plex Sans", sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
}

.trend-section-heading span {
  color: #8a96a6;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trend-card {
  position: relative;
  display: grid;
  align-content: start;
  min-width: 0;
  border: 1px solid rgba(18, 32, 51, 0.11);
  border-top: 3px solid #c9a46a;
  background: linear-gradient(155deg, rgba(255, 252, 246, 0.98), rgba(248, 239, 224, 0.88));
}

.trend-card-body {
  display: block;
}

.trend-card[data-status="potential"],
.trend-card[data-status="tracking"] {
  border-top-color: #27598f;
}

.trend-card[data-status="rejected"] {
  border-top-color: #9b4a3f;
}

.trend-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
}

.trend-card-head-main {
  min-width: 0;
}

.trend-card-eyebrow {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.trend-state,
.trend-tier {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.trend-state {
  color: #1e7d62;
}

.trend-card[data-status="potential"] .trend-state,
.trend-card[data-status="tracking"] .trend-state {
  color: #27598f;
}

.trend-card[data-status="rejected"] .trend-state {
  color: #9b4a3f;
}

.trend-tier {
  color: #8f6418;
}

.trend-matchup {
  color: #8f6418;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.trend-card h3 {
  margin-top: 5px;
  color: #0d1321;
  font-family: "Geist", "IBM Plex Sans", sans-serif;
  font-size: 1.42rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.trend-wager {
  margin-top: 6px;
  color: #122033;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 700;
}

.trend-score {
  flex: 0 0 78px;
  padding-left: 14px;
  border-left: 1px solid rgba(18, 32, 51, 0.1);
  text-align: right;
}

.trend-score span {
  display: block;
  color: #8a96a6;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.trend-score strong {
  display: block;
  margin-top: 5px;
  color: #0d1321;
  font-family: "Geist", "IBM Plex Sans", sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
}

.trend-evidence-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid rgba(18, 32, 51, 0.08);
  border-bottom: 1px solid rgba(18, 32, 51, 0.08);
}

.trend-evidence-cell {
  min-width: 0;
  padding: 12px 10px;
  border-right: 1px solid rgba(18, 32, 51, 0.07);
}

.trend-evidence-cell:last-child {
  border-right: 0;
}

.trend-evidence-cell span {
  display: block;
  color: #8a96a6;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.47rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.trend-evidence-cell strong {
  display: block;
  margin-top: 5px;
  color: #122033;
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: 1.08rem;
  font-weight: 800;
}

.trend-confirmation {
  display: grid;
  gap: 8px;
  padding: 14px 20px 4px;
}

.trend-confirmation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.trend-confirmation-head span,
.trend-confirmation-head strong {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.56rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.trend-confirmation-head span {
  color: #697484;
}

.trend-confirmation-head strong {
  color: #27598f;
}

.trend-progress {
  height: 3px;
  overflow: hidden;
  background: rgba(18, 32, 51, 0.09);
}

.trend-progress i {
  display: block;
  height: 100%;
  background: #27598f;
}

.trend-details {
  margin: 14px 20px 0;
  border-top: 1px solid rgba(18, 32, 51, 0.08);
}

.trend-details summary {
  padding-top: 12px;
  color: #49576a;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}

.trend-condition-list {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.trend-condition {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 8px;
  color: #5d6a7c;
  font-size: 0.68rem;
  line-height: 1.35;
}

.trend-condition i {
  width: 7px;
  height: 7px;
  margin-top: 3px;
  background: #1e7d62;
}

.trend-condition.is-pending i {
  background: #27598f;
}

.trend-card-actions {
  padding: 16px 20px 18px;
}

.trend-track-button {
  width: 100%;
  min-height: 40px;
  border: 1px solid #122033;
  border-radius: 2px;
  color: #fff9ef;
  background: #122033;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.trend-track-button.is-tracked {
  color: #122033;
  border-color: #c9a46a;
  background: #f1e5d2;
}

.trend-track-button:disabled {
  color: #8a96a6;
  border-color: rgba(18, 32, 51, 0.09);
  background: rgba(18, 32, 51, 0.04);
  cursor: default;
}

.trends-empty {
  grid-column: 1 / -1;
  padding: 54px 28px;
  border: 1px solid rgba(18, 32, 51, 0.11);
  text-align: left;
  background: linear-gradient(155deg, rgba(255, 252, 246, 0.98), rgba(248, 239, 224, 0.88));
}

.trends-empty p {
  color: #c9a46a;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.trends-empty h3 {
  margin-top: 8px;
  color: #0d1321;
  font-family: "Geist", "IBM Plex Sans", sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
}

.trends-empty span {
  display: block;
  max-width: 620px;
  margin-top: 8px;
  color: #66758a;
  font-size: 0.78rem;
  line-height: 1.55;
}

.trends-access-gate {
  padding: 46px 28px;
  border-top: 3px solid #c9a46a;
  color: #f4f2ec;
  text-align: left;
  background: #0d1321;
}

#trends-control-panel[hidden] {
  display: none !important;
}

.trends-access-gate p:first-child {
  color: #c9a46a;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.trends-access-gate h3 {
  margin-top: 10px;
  color: #fff9ef;
  font-family: "Geist", "IBM Plex Sans", sans-serif;
  font-size: 1.9rem;
  font-weight: 800;
}

.trends-access-gate p {
  max-width: 560px;
  margin-top: 10px;
  color: #aab3c0;
  font-size: 0.82rem;
  line-height: 1.55;
}

.trends-access-gate button {
  min-height: 42px;
  margin-top: 22px;
  padding: 0 22px;
  border: 1px solid #c9a46a;
  border-radius: 2px;
  color: #0d1321;
  background: #c9a46a;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.trends-gate-previews {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 720px;
  margin-top: 22px;
}

.trends-gate-preview {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.trends-gate-preview div {
  display: flex;
  justify-content: space-between;
  color: #c9a46a;
  font: 700 0.54rem/1 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trends-gate-preview b { color: #68d391; }

.trends-gate-preview i {
  display: block;
  height: 9px;
  margin-top: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  filter: blur(3px);
}

.trends-gate-preview i:nth-of-type(2) { width: 76%; background: rgba(255, 255, 255, 0.3); }
.trends-gate-preview i:nth-of-type(3) { width: 52%; background: rgba(201, 164, 106, 0.62); }

.trends-gate-preview small {
  display: block;
  margin-top: 12px;
  color: #8f9aab;
  font-size: 0.62rem;
  line-height: 1.45;
}

.trends-access-gate .trends-gate-note {
  display: block;
  margin-top: 10px;
  color: #7f8998;
  font: 500 0.56rem/1.4 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

@media (max-width: 620px) {
  .trends-gate-previews { grid-template-columns: 1fr; }
}

html.mlb-trends-route body .page > .tab-panel:not(#panel-trends),
body.mlb-trends-figma-mode .page > .tab-panel:not(#panel-trends) {
  display: none !important;
}

html.mlb-trends-route body #panel-trends,
body.mlb-trends-figma-mode #panel-trends {
  display: block !important;
}

html.mlb-trends-route body .figma-official-chrome,
body.mlb-trends-figma-mode .figma-official-chrome {
  display: block;
  position: relative;
  height: 216px;
  pointer-events: none;
}

html.mlb-trends-route body .figma-official-chrome::after,
body.mlb-trends-figma-mode .figma-official-chrome::after {
  content: "";
  position: absolute;
  top: 64px;
  right: 0;
  left: 0;
  z-index: 0;
  height: 64px;
  background: #f4f2ec;
  pointer-events: none;
}

html.mlb-trends-route body .figma-official-chrome a,
body.mlb-trends-figma-mode .figma-official-chrome a {
  pointer-events: auto;
}

@media (max-width: 780px) {
  html.mlb-trends-route body,
  body.mlb-trends-figma-mode {
    background: #e5dece;
  }

  html.mlb-trends-route body .shell,
  body.mlb-trends-figma-mode .shell {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #f4f2ec;
  }

  html.mlb-trends-route body .sport-switcher,
  html.mlb-trends-route body .sport-sticky-tabs,
  html.mlb-trends-route body .hero,
  html.mlb-trends-route body .main-tabs,
  body.mlb-trends-figma-mode .sport-switcher,
  body.mlb-trends-figma-mode .sport-sticky-tabs,
  body.mlb-trends-figma-mode .hero,
  body.mlb-trends-figma-mode .main-tabs {
    display: none !important;
  }

  .trends-stage {
    gap: 16px;
    padding: 20px 16px 28px;
  }

  .trends-toolbar {
    display: block;
    padding-bottom: 0;
    border-bottom: 0;
  }

  .trends-toolbar > div:first-child {
    display: none;
  }

  .trends-toolbar-actions {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .trends-sort select {
    width: 100%;
  }

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

  .trend-summary-cell:nth-child(2) {
    border-right: 0;
  }

  .trend-summary-cell:nth-child(-n + 2) {
    border-bottom: 1px solid rgba(18, 32, 51, 0.08);
  }

  .trends-control-panel {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 12px;
    padding: 12px;
  }

  .trends-view-switch button {
    flex: 1 1 50%;
  }

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

  .trends-selector-grid label:last-child {
    grid-column: 1 / -1;
  }

  .trends-control-result {
    display: flex;
    justify-content: space-between;
    min-width: 0;
    padding: 2px 0 0;
  }

  .trends-feed {
    grid-template-columns: 1fr;
  }

  .trend-match-group > summary {
    gap: 12px;
    padding: 14px 12px;
  }

  .trend-match-counts {
    grid-template-columns: auto 16px;
    gap: 9px;
  }

  .trend-match-counts small {
    display: none;
  }

  .trend-match-cards {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }

  .trend-card-head {
    padding: 17px 16px;
    cursor: pointer;
  }

  .trend-card-body {
    display: none;
  }

  .trend-card.is-expanded .trend-card-body {
    display: block;
  }

  .trend-score {
    flex-basis: 67px;
  }

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

  .trend-evidence-cell:nth-child(2) {
    border-right: 0;
  }

  .trend-evidence-cell:nth-child(-n + 2) {
    border-bottom: 1px solid rgba(18, 32, 51, 0.07);
  }

  .trend-confirmation,
  .trend-card-actions {
    padding-right: 16px;
    padding-left: 16px;
  }

  .trend-details {
    margin-right: 16px;
    margin-left: 16px;
  }

  .trends-empty {
    padding: 38px 20px;
  }
}
