/* Mobile reflow from the approved patch. Desktop/tablet remain unchanged. */
@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 .app-header {
    gap: 6px;
  }
  html.mobile-reflow-active .brand {
    min-width: 0;
    flex: 0 1 auto;
    gap: 6px;
  }
  html.mobile-reflow-active .brand-name {
    font-size: clamp(14px, 4.2vw, 18px);
  }
  html.mobile-reflow-active .brand-slim {
    font-size: clamp(10px, 3.4vw, 14px);
  }
  html.mobile-reflow-active .header-right {
    min-width: 0;
    flex: 0 1 auto;
    gap: 6px;
  }
  html.mobile-reflow-active #feedStatus {
    display: none !important;
  }
  html.mobile-reflow-active #mobileTagline {
    display: block;
    flex: 0 1 auto;
    width: clamp(86px, 29vw, 132px);
    max-width: 132px;
    margin: 0;
    color: var(--mint);
    font-size: clamp(8px, 2.55vw, 11px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    text-align: right;
    overflow-wrap: normal;
  }
  html.mobile-reflow-active #refreshButton {
    flex: 0 0 34px;
  }
  html.mobile-reflow-active .intro-bar {
    display: none !important;
  }

  /* Reuse the original verdict box as the four-card KPI host. */
  html.mobile-reflow-active .hero-panel .hero-price-line {
    margin-bottom: 6px !important;
  }
  html.mobile-reflow-active .hero-panel .verdict-box.mobile-reflow-kpi-host {
    display: block !important;
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 5px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  html.mobile-reflow-active .mobile-reflow-kpi-host > :not(#heroStats) {
    display: none !important;
  }
  html.mobile-reflow-active #heroStats.hero-stat-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 3px !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
  html.mobile-reflow-active #heroStats .hero-stat {
    min-width: 0 !important;
    min-height: 78px !important;
    padding: 6px 3px !important;
    overflow: hidden;
  }
  html.mobile-reflow-active #heroStats .hero-stat-label {
    font-size: clamp(7px, 2.05vw, 9px) !important;
    line-height: 1.12;
    overflow-wrap: anywhere;
  }
  html.mobile-reflow-active #heroStats .hero-stat-value {
    margin: 5px 0 3px !important;
    font-size: clamp(11px, 3.45vw, 17px) !important;
    line-height: 1.2 !important;
    letter-spacing: -.4px !important;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
  }
  html.mobile-reflow-active #heroStats .hero-stat-hint {
    font-size: clamp(7px, 1.8vw, 8px) !important;
    line-height: 1.12 !important;
    overflow-wrap: anywhere;
  }
  html.mobile-reflow-active #heroStats .hero-stat .supply-toggle button {
    min-width: 0 !important;
    padding: 2px 1px !important;
    font-size: 0 !important;
    line-height: 1 !important;
  }
  html.mobile-reflow-active #heroStats .supply-toggle button[data-supply-view="circulating"]::after {
    content: "Circ.";
    font-size: 8px;
  }
  html.mobile-reflow-active #heroStats .supply-toggle button[data-supply-view="max"]::after {
    content: "Max";
    font-size: 8px;
  }
  html.mobile-reflow-active #heroStats .hero-stat [data-tip] {
    transform: scale(.78);
    transform-origin: right top;
  }

  /* Put both independent control groups on one row, revenue first. */
  html.mobile-reflow-active .hero-panel .hero-metrics-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: center;
    gap: 5px;
    margin: 6px 0 5px !important;
    min-width: 0;
  }
  html.mobile-reflow-active .hero-metrics-header > span {
    display: none !important;
  }
  html.mobile-reflow-active #heroRevenueHistory {
    order: 1;
    width: 100%;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
  }
  html.mobile-reflow-active .hero-metrics-header > .period-tabs {
    order: 2;
    width: 100%;
    min-width: 0;
    justify-content: space-around;
    gap: 2px;
  }
  html.mobile-reflow-active .revenue-single-controls-line,
  html.mobile-reflow-active #screenerRevenueHistoryControls {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 2px;
    width: 100%;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    font-size: 8px;
    line-height: 1.1;
  }
  html.mobile-reflow-active .revenue-single-controls-line > span,
  html.mobile-reflow-active #screenerRevenueHistoryControls > span {
    display: block;
    color: #9bdcc7;
    font-size: 8px;
    line-height: 1.1;
    white-space: nowrap;
  }
  html.mobile-reflow-active .revenue-history-controls,
  html.mobile-reflow-active .hero-metrics-header .period-tabs,
  html.mobile-reflow-active #tablePeriodControls {
    display: flex !important;
    width: 100%;
    min-width: 0;
    gap: 2px;
  }
  html.mobile-reflow-active .revenue-history-controls button,
  html.mobile-reflow-active .hero-metrics-header .period-tabs button,
  html.mobile-reflow-active #tablePeriodControls button {
    flex: 1 1 0;
    min-width: 0 !important;
    min-height: 30px;
    height: auto;
    padding: 4px 1px !important;
    font-size: clamp(7px, 1.85vw, 9px) !important;
    line-height: 1.1;
    white-space: nowrap;
  }

  html.mobile-reflow-active .tokens-panel .table-title-row .eyebrow,
  html.mobile-reflow-active .tokens-panel .table-title-row p.muted {
    display: none !important;
  }
  html.mobile-reflow-active .tokens-panel .table-title-row {
    margin-bottom: 4px !important;
  }
  html.mobile-reflow-active .tokens-panel {
    margin-top: 9px !important;
    padding-top: 12px !important;
  }
  html.mobile-reflow-active .tokens-panel .table-period-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: center;
    gap: 5px;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
  }
  html.mobile-reflow-active .tokens-panel .table-period-label {
    display: none !important;
  }
  html.mobile-reflow-active #screenerRevenueHistoryControls {
    order: 1;
  }
  html.mobile-reflow-active #tablePeriodControls {
    order: 2;
    justify-content: space-around;
  }

  /* This is the original live scorecard node, placed by responsive-layout.js. */
  html.mobile-reflow-active .hero-panel > aside.score-context {
    display: flex !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 5px 0 0 !important;
    padding: 10px 8px !important;
    gap: 9px !important;
  }
  html.mobile-reflow-active .hero-panel > aside.score-context .score-record-category {
    padding: 7px 8px !important;
  }
  html.mobile-reflow-active .hero-panel > aside.score-context .score-record-categories {
    gap: 5px !important;
  }
  html.mobile-reflow-active .hero-panel > aside.score-context .score-record-category p {
    line-height: 1.32;
  }
}
