/**
 * H2H Insights — product UI blocks (H2H window, prediction stats, corners/cards model).
 * Scoped under #h2h-market-panels; uses existing theme + #h2h-market-panels hit-rate tokens.
 * No box-shadows per spec (hero prediction row uses match-header gradient tint).
 *
 * Card chrome uses --match-card-bg / --match-border so blocks sit on the same neutral stack
 * as .match-card / body canvas (avoids the bluer --surface-* tokens used elsewhere).
 */

#h2h-market-panels .h2h-pro-ui {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#h2h-market-panels .h2h-pro-sec-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 20px 0 8px;
}

#h2h-market-panels .h2h-pro-sec-left {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

#h2h-market-panels .h2h-pro-sec-right {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: right;
}

#h2h-market-panels .h2h-pro-card {
  border-radius: 10px;
  border: 0.5px solid var(--match-border, var(--border-light));
  background: var(--match-card-bg, var(--surface-1, #1a1a1a));
  box-shadow: none;
  overflow: hidden;
}

#h2h-market-panels .h2h-pro-rule {
  border: none;
  border-top: 0.5px solid var(--match-border, var(--border-light));
  margin: 0;
}

#h2h-market-panels .h2h-pro-window-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}

#h2h-market-panels .h2h-pro-cell {
  padding: 14px 16px;
  border-right: 0.5px solid var(--match-border, var(--border-light));
}

#h2h-market-panels .h2h-pro-cell:last-child {
  border-right: none;
}

#h2h-market-panels .h2h-pro-val {
  display: block;
  font-size: 20px;
  font-weight: 500;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

#h2h-market-panels .h2h-pro-lbl {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  text-transform: lowercase;
}

#h2h-market-panels .h2h-pro-window-foot {
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 20px;
}

#h2h-market-panels .h2h-pro-wf-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

#h2h-market-panels .h2h-pro-wf-val {
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

#h2h-market-panels .h2h-pro-wf-lbl {
  font-size: 11px;
  color: var(--text-muted);
}

#h2h-market-panels .h2h-pro-wf-sep {
  width: 1px;
  height: 12px;
  background: var(--match-border, var(--border-light));
  flex-shrink: 0;
}

#h2h-market-panels .h2h-pro-sig--hi {
  color: var(--h2h-hit-green);
}

#h2h-market-panels .h2h-pro-sig--lo {
  color: var(--h2h-hit-red);
}

#h2h-market-panels .h2h-pro-sig--mid {
  color: var(--match-amber, #c2924f);
}

/* —— H2H markets stat strip —— */
#h2h-market-panels .h2h-pro-strip-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 18px 16px 14px;
  border-top: 3px solid transparent;
}

#h2h-market-panels .h2h-pro-strip-cell.h2h-pro-sig--hi {
  border-top-color: var(--h2h-hit-green);
}

#h2h-market-panels .h2h-pro-strip-cell.h2h-pro-sig--lo {
  border-top-color: var(--h2h-hit-red);
}

#h2h-market-panels .h2h-pro-strip-cell.h2h-pro-sig--mid {
  border-top-color: var(--match-amber, #c2924f);
}

#h2h-market-panels .h2h-pro-strip-val {
  display: block;
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

#h2h-market-panels .h2h-pro-strip-val sup {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 1px;
  vertical-align: super;
  line-height: 0;
}

#h2h-market-panels .h2h-pro-strip-lbl {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 6px;
}

/* —— Prediction card —— */
#h2h-market-panels .h2h-pro-pred-head {
  padding: 14px 16px;
  border-bottom: 0.5px solid var(--match-border, var(--border-light));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#h2h-market-panels .h2h-pro-pred-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

#h2h-market-panels .h2h-pro-pred-badge {
  font-size: 10px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--match-card-bg, var(--surface-2, #1a1a1a));
  color: var(--text-secondary);
  border: 0.5px solid var(--match-border, var(--border-light));
}

#h2h-market-panels .h2h-pro-pred-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}

#h2h-market-panels .h2h-pro-pred-cell {
  padding: 14px 16px;
  border-right: 0.5px solid var(--match-border, var(--border-light));
}

#h2h-market-panels .h2h-pro-pred-cell:last-child {
  border-right: none;
}

#h2h-market-panels .h2h-pro-pm-val {
  display: block;
  font-size: 22px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

#h2h-market-panels .h2h-pro-pm-lbl {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

#h2h-market-panels .h2h-pro-pm-bar {
  height: 3px;
  background: var(--match-border, var(--border-light));
  border-radius: 99px;
  margin-top: 8px;
  overflow: hidden;
}

#h2h-market-panels .h2h-pro-pm-bar-fill {
  height: 100%;
  border-radius: 99px;
  max-width: 100%;
  background: var(--h2h-hit-neutral);
  opacity: 0.65;
}

#h2h-market-panels .h2h-pro-pm-bar-fill.h2h-pro-sig--hi {
  background: var(--h2h-hit-green);
  opacity: 0.9;
}

#h2h-market-panels .h2h-pro-pm-bar-fill.h2h-pro-sig--lo {
  background: var(--h2h-hit-red);
  opacity: 0.88;
}

#h2h-market-panels .h2h-pro-pm-bar-fill.h2h-pro-sig--mid {
  background: var(--match-amber, #c2924f);
  opacity: 0.85;
}

/* —— Prediction stat-bar list —— */
#h2h-market-panels .h2h-pro-pred-list {
  display: flex;
  flex-direction: column;
}

#h2h-market-panels .h2h-pro-stat-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--match-border, var(--border-light));
}

#h2h-market-panels .h2h-pro-stat-row:last-child {
  border-bottom: none;
}

#h2h-market-panels .h2h-pro-stat-row--hero {
  padding: 18px 16px;
  background: linear-gradient(135deg, rgba(89, 135, 100, 0.22) 0%, rgba(64, 109, 76, 0.16) 55%, rgba(35, 74, 54, 0.10) 100%);
}

[data-theme="light"] #h2h-market-panels .h2h-pro-stat-row--hero {
  background: linear-gradient(135deg, rgba(89, 135, 100, 0.14) 0%, rgba(64, 109, 76, 0.10) 55%, rgba(35, 74, 54, 0.06) 100%);
}

#h2h-market-panels .h2h-pro-stat-lbl {
  width: 96px;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

#h2h-market-panels .h2h-pro-stat-row--hero .h2h-pro-stat-lbl {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 11px;
}

#h2h-market-panels .h2h-pro-stat-track {
  flex: 1;
  min-width: 0;
  height: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 0.5px solid var(--match-border, var(--border-light));
  border-radius: 2px;
  overflow: hidden;
}

#h2h-market-panels .h2h-pro-stat-row--hero .h2h-pro-stat-track {
  height: 18px;
  background: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] #h2h-market-panels .h2h-pro-stat-track {
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] #h2h-market-panels .h2h-pro-stat-row--hero .h2h-pro-stat-track {
  background: rgba(0, 0, 0, 0.06);
}

#h2h-market-panels .h2h-pro-stat-fill {
  height: 100%;
  max-width: 100%;
  border-radius: 1px;
}

#h2h-market-panels .h2h-pro-stat-fill.h2h-pro-sig--hi {
  background: var(--h2h-hit-green);
  opacity: 0.9;
}

#h2h-market-panels .h2h-pro-stat-fill.h2h-pro-sig--lo {
  background: var(--h2h-hit-red);
  opacity: 0.88;
}

#h2h-market-panels .h2h-pro-stat-fill.h2h-pro-sig--mid {
  background: var(--match-amber, #c2924f);
  opacity: 0.85;
}

#h2h-market-panels .h2h-pro-stat-val {
  width: 64px;
  flex-shrink: 0;
  text-align: right;
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

#h2h-market-panels .h2h-pro-stat-row--hero .h2h-pro-stat-val {
  font-size: 26px;
}

#h2h-market-panels .h2h-pro-stat-unit {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 1px;
}

#h2h-market-panels .h2h-pro-pred-tabs {
  display: flex;
  border-top: 0.5px solid var(--match-border, var(--border-light));
  position: relative;
  z-index: 2;
}

#h2h-market-panels .h2h-pro-pred-tab {
  flex: 1;
  text-align: center;
  padding: 12px 6px 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  background: none;
  border: none;
  border-right: 0.5px solid var(--match-border, var(--border-light));
  border-bottom: 2px solid transparent;
}

#h2h-market-panels .h2h-pro-pred-tab:last-child {
  border-right: none;
}

#h2h-market-panels .h2h-pro-pred-tab:hover {
  color: var(--text-primary);
}

#h2h-market-panels .h2h-pro-pred-tab.is-active {
  color: var(--text-primary);
  border-bottom-color: var(--match-green);
}

#h2h-market-panels .h2h-pro-panel-inner {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
}

#h2h-market-panels .h2h-metrics-surface.h2h-pro-panel-inner {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

@media (max-width: 640px) {
  #h2h-market-panels .h2h-metrics-surface.h2h-pro-panel-inner {
    padding: 0 !important;
  }
}

[data-theme="light"] #h2h-market-panels .h2h-metrics-surface.h2h-pro-panel-inner {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* —— Corners & cards model —— */
#h2h-market-panels .h2h-pro-tabstrip {
  display: flex;
  padding: 0 14px;
  border-bottom: 0.5px solid var(--match-border, var(--border-light));
  gap: 0;
}

#h2h-market-panels .h2h-pro-tab {
  font-size: 11px;
  font-weight: 500;
  padding: 10px 12px;
  margin-bottom: -0.5px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  font-family: inherit;
}

#h2h-market-panels .h2h-pro-tab:hover {
  color: var(--text-secondary);
}

#h2h-market-panels .h2h-pro-tab.is-active {
  color: var(--h2h-hit-green);
  border-bottom-color: var(--h2h-hit-green);
}

#h2h-market-panels .h2h-pro-panel {
  display: none;
}

#h2h-market-panels .h2h-pro-panel.is-active {
  display: block;
}

#h2h-market-panels .h2h-pro-cc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 0.5px solid var(--match-border, var(--border-light));
}

#h2h-market-panels .h2h-pro-cc-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
}

#h2h-market-panels .h2h-pro-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#h2h-market-panels .h2h-pro-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--text-muted);
}

#h2h-market-panels .h2h-pro-ldot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

#h2h-market-panels .h2h-pro-ldot--g {
  background: var(--h2h-hit-green);
}

#h2h-market-panels .h2h-pro-ldot--n {
  background: var(--h2h-hit-neutral);
}

#h2h-market-panels .h2h-pro-ldot--r {
  background: var(--h2h-hit-red);
}

#h2h-market-panels .h2h-pro-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 14px;
}

#h2h-market-panels .h2h-pro-tile {
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: var(--match-card-bg, var(--surface-2, #1a1a1a));
  border: 0.5px solid var(--match-border, var(--border-light));
}

#h2h-market-panels .h2h-pro-tile-name {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.25;
}

#h2h-market-panels .h2h-pro-tile-pick {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

#h2h-market-panels .h2h-pro-tile-vals {
  text-align: right;
  flex-shrink: 0;
}

#h2h-market-panels .h2h-pro-tile-val {
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

#h2h-market-panels .h2h-pro-model-note {
  padding: 10px 14px;
  font-size: 10px;
  color: var(--text-muted);
  border-top: 0.5px solid var(--match-border, var(--border-light));
}

@media (max-width: 479px) {
  #h2h-market-panels .h2h-pro-window-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #h2h-market-panels .h2h-pro-strip-cell:nth-child(2n) {
    border-right: none;
  }

  #h2h-market-panels .h2h-pro-strip-cell:nth-child(-n+2) {
    border-bottom: 0.5px solid var(--match-border, var(--border-light));
  }

  #h2h-market-panels .h2h-pro-stat-lbl {
    width: 72px;
    font-size: 9px;
  }

  #h2h-market-panels .h2h-pro-stat-val {
    width: 52px;
    font-size: 15px;
  }

  #h2h-market-panels .h2h-pro-stat-row--hero .h2h-pro-stat-val {
    font-size: 22px;
  }

  #h2h-market-panels .h2h-pro-pred-tab {
    font-size: 9px;
    padding: 10px 4px 8px;
    letter-spacing: 0.04em;
  }

  #h2h-market-panels .h2h-pro-cell,
  #h2h-market-panels .h2h-pro-pred-cell {
    border-right: none;
    border-bottom: 0.5px solid var(--match-border, var(--border-light));
  }

  #h2h-market-panels .h2h-pro-cell:last-child,
  #h2h-market-panels .h2h-pro-pred-cell:last-child {
    border-bottom: none;
  }

  #h2h-market-panels .h2h-pro-tiles {
    grid-template-columns: 1fr;
  }
}

[data-theme="light"] #h2h-market-panels .h2h-pro-card {
  background: var(--match-card-bg, var(--surface-1, #fff));
}

[data-theme="light"] #h2h-market-panels .h2h-pro-pred-badge,
[data-theme="light"] #h2h-market-panels .h2h-pro-tile {
  background: var(--match-card-bg, var(--surface-0, #f6f8fa));
}

/* Free H2H: explain tabbed / multi-tile depth so “hidden” sessions feel discoverable */
#h2h-market-panels .h2h-tease-nav-hint {
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-secondary, #9aa6b3);
  margin: 0 0 12px 0;
  padding: 8px 10px 8px 12px;
  border-left: 3px solid var(--primary-color, #629670);
  border-radius: 0 8px 8px 0;
  background: rgba(98, 150, 112, 0.08);
}

#h2h-market-panels .h2h-tease-nav-hint strong {
  color: var(--text-primary, #e3eaf0);
  font-weight: 600;
}

[data-theme="light"] #h2h-market-panels .h2h-tease-nav-hint {
  background: rgba(98, 150, 112, 0.12);
  color: #475569;
}

[data-theme="light"] #h2h-market-panels .h2h-tease-nav-hint strong {
  color: #0f172a;
}

#h2h-market-panels .h2h-tease-scope-chip {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
  border: 1px solid rgba(98, 150, 112, 0.55);
  border-radius: 999px;
  padding: 3px 10px;
  background: rgba(98, 150, 112, 0.18);
}

[data-theme="light"] #h2h-market-panels .h2h-tease-scope-chip {
  color: #14532d;
  border-color: rgba(21, 128, 61, 0.35);
  background: rgba(34, 197, 94, 0.12);
}

/* Optional row_gate states (macros); blur is inert when all rows are open */
.sn-h2h-tease-blur {
  filter: blur(5px);
  user-select: none;
}

.sn-h2h-free-pill {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(98, 150, 112, 0.45);
  color: var(--text-primary);
  background: rgba(98, 150, 112, 0.15);
}

[data-theme="light"] .sn-h2h-free-pill {
  color: #14532d;
  border-color: rgba(21, 128, 61, 0.35);
  background: rgba(34, 197, 94, 0.12);
}

.sn-h2h-row-lock {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
