/* Mobile hold-to-view scorecard and KPI/timeframe refinements. */
@media (max-width: 720px), (min-width: 721px) and (max-width: 1060px) and (orientation: landscape) and (max-height: 500px) and (any-pointer: coarse) {
  html.mobile-reflow-active .hero-panel .verdict-box.mobile-reflow-kpi-host {
    display: none !important;
  }

  html.mobile-reflow-active .hero-panel #heroStats.hero-stat-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 3px !important;
    margin: 6px 0 0 !important;
    width: 100% !important;
  }

  html.mobile-reflow-active #heroStats .hero-stat {
    display: flex !important;
    flex-direction: column;
    align-items: center !important;
    text-align: center !important;
    min-width: 0 !important;
  }

  html.mobile-reflow-active #heroStats .hero-stat-label,
  html.mobile-reflow-active #heroStats .hero-stat-value,
  html.mobile-reflow-active #heroStats .hero-stat-hint {
    width: 100%;
    text-align: center !important;
    align-self: center !important;
  }

  html.mobile-reflow-active #heroStats .hero-stat-label {
    position: relative;
  }

  html.mobile-reflow-active #heroStats .hero-stat-label [data-tip] {
    position: absolute;
    right: 0;
    top: 0;
  }

  html.mobile-reflow-active #heroStats .supply-toggle {
    align-self: center !important;
    max-width: 100% !important;
    justify-content: center !important;
  }

  html.mobile-reflow-active .hero-panel .hero-metrics-header {
    align-items: stretch !important;
    gap: 5px !important;
  }

  html.mobile-reflow-active .hero-metrics-header .mobile-time-glance {
    order: 2;
    min-width: 0;
    display: flex !important;
    flex-direction: column;
    justify-content: flex-end;
    gap: 4px;
  }

  html.mobile-reflow-active .hero-metrics-header .mobile-time-glance > span,
  html.mobile-reflow-active #heroRevenueHistory .revenue-single-controls-line > span {
    display: block !important;
    font-size: clamp(9px, 2.4vw, 12px) !important;
    line-height: 1.2;
    color: #a9ccbd;
    font-weight: 600;
  }

  html.mobile-reflow-active .hero-metrics-header .mobile-time-glance .period-tabs {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px !important;
    margin: 0 !important;
  }

  html.mobile-reflow-active .hero-metrics-header .mobile-time-glance .period-tabs button,
  html.mobile-reflow-active #heroRevenueHistory [data-revenue-group="hero"] {
    height: 36px !important;
    min-height: 36px !important;
    box-sizing: border-box;
    padding: 0 1px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(9px, 2.3vw, 12px) !important;
  }

  html.mobile-reflow-active #heroRevenueHistory .revenue-history-controls {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px !important;
    width: 100%;
  }

  html.mobile-reflow-active .hero-metrics-header > .period-tabs {
    display: none !important;
  }

  /* The same aside is hidden in-flow, then fixed above the page while held. */
  html.mobile-reflow-active .hero-panel > aside.score-context:not(.mobile-hold-open):not(.mobile-hold-closing) {
    display: none !important;
  }

  html.mobile-reflow-active .hero-panel > aside.score-context.mobile-hold-open,
  html.mobile-reflow-active .hero-panel > aside.score-context.mobile-hold-closing {
    display: flex !important;
    position: fixed !important;
    z-index: 10000 !important;
    inset: max(12px, env(safe-area-inset-top)) 10px max(12px, env(safe-area-inset-bottom)) !important;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    margin: 0 !important;
    padding: 14px 12px !important;
    flex-direction: column !important;
    background: #071e18 !important;
    border: 1px solid #70e2ba !important;
    border-radius: 18px !important;
    box-shadow: 0 18px 65px #000a !important;
  }

  html.mobile-reflow-active .hero-panel > aside.score-context.mobile-hold-open {
    animation: mobileHoldPop .23s cubic-bezier(.16, 1, .3, 1) both;
  }

  html.mobile-reflow-active body.mobile-hold-active::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000a;
  }

  html.mobile-reflow-active .hero-panel > aside.score-context.mobile-hold-closing {
    animation: mobileHoldClose .16s ease-in both;
  }

  @keyframes mobileHoldPop {
    from { opacity: 0; transform: scale(.94) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
  }

  @keyframes mobileHoldClose {
    to { opacity: 0; transform: scale(.97) translateY(6px); }
  }

  @media (prefers-reduced-motion: reduce) {
    html.mobile-reflow-active .hero-panel > aside.score-context.mobile-hold-open,
    html.mobile-reflow-active .hero-panel > aside.score-context.mobile-hold-closing {
      animation: none !important;
    }
  }
}
