/* Home V10 Phase 5S — final mobile flow/order/spacing correction.
 * Fixes the production issues visible in the full-page audit: section order,
 * duplicate card chrome, dead space before the footer, and compact rules/insight.
 */
@media (max-width:820px){
  /* Explicit flex order: generic .v9Section{order:8} must not push injected sales to the bottom. */
  html[data-cardondo-home="v10-shell"] .homeV10PublicSummary{order:1!important}
  html[data-cardondo-home="v10-shell"] .v9CompactFeatured{order:2!important}
  html[data-cardondo-home="v10-shell"] .v9News{order:3!important}
  html[data-cardondo-home="v10-shell"] .v9Movement{order:4!important}
  html[data-cardondo-home="v10-shell"] .homeV10RecentSales{order:5!important}
  html[data-cardondo-home="v10-shell"] .v9CompactOneInsight{order:6!important}
  html[data-cardondo-home="v10-shell"] .v9Rules{order:7!important}

  /* Old full-market blocks are not part of the approved Home flow. */
  html[data-cardondo-home="v10-shell"] .v9Grid,
  html[data-cardondo-home="v10-shell"] .v9Feed,
  html[data-cardondo-home="v10-shell"] .v9Must:not(.v9CompactFeatured),
  html[data-cardondo-home="v10-shell"] .v9EvidenceMore{display:none!important}

  /* Re-assert 5R summary without the oversized card shell. */
  html[data-cardondo-home="v10-shell"] .homeV10PublicSummary{
    margin:12px 0 0!important;
    padding:0!important;
    border:0!important;
    border-radius:0!important;
    background:#fff!important;
    box-shadow:none!important;
  }
  html[data-cardondo-home="v10-shell"] .homeV10SummaryTop h1{font-size:23px!important;line-height:1.12!important}
  html[data-cardondo-home="v10-shell"] .homeV10SummaryTop p{margin-top:5px!important;font-size:10.5px!important}
  html[data-cardondo-home="v10-shell"] .homeV10LivePill{min-height:25px!important;padding:0 9px!important;font-size:9.5px!important}
  html[data-cardondo-home="v10-shell"] .homeV10SummaryMetrics{gap:5px!important;margin-top:11px!important}
  html[data-cardondo-home="v10-shell"] .homeV10SummaryMetric{min-height:56px!important;padding:8px 4px 7px!important;border:0!important;border-radius:10px!important}
  html[data-cardondo-home="v10-shell"] .homeV10SummaryMetric small{margin-bottom:5px!important;font-size:8.7px!important}
  html[data-cardondo-home="v10-shell"] .homeV10SummaryMetric strong{font-size:20px!important}
  html[data-cardondo-home="v10-shell"] .homeV10SummaryMetric em{font-size:8px!important}
  html[data-cardondo-home="v10-shell"] .homeV10SummaryFoot{display:none!important}

  /* One compact insight card only — remove the inner-card-on-outer-card effect. */
  html[data-cardondo-home="v10-shell"] .v9CompactOneInsight{
    margin-top:14px!important;
    padding:11px 12px!important;
    border:1px solid #ececea!important;
    border-radius:12px!important;
    background:#fff!important;
    box-shadow:none!important;
  }
  html[data-cardondo-home="v10-shell"] .v9CompactOneInsight>div{
    margin:0!important;
    padding:0!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
    display:grid!important;
    grid-template-columns:24px minmax(0,1fr)!important;
    gap:8px!important;
    align-items:start!important;
  }
  html[data-cardondo-home="v10-shell"] .v9CompactOneInsight>div>span{font-size:18px!important;line-height:1!important}
  html[data-cardondo-home="v10-shell"] .v9CompactOneInsight p{margin:0!important;padding:0!important;font-size:10px!important;line-height:1.38!important;color:#555b60!important}
  html[data-cardondo-home="v10-shell"] .v9CompactOneInsight p b{display:block!important;margin:0 0 5px!important;font-size:12.5px!important;line-height:1.15!important;color:#202326!important}

  /* Compact data-basis drawer; no tall standalone block. */
  html[data-cardondo-home="v10-shell"] .v9Rules{
    margin-top:12px!important;
    border:1px solid #ececea!important;
    border-radius:12px!important;
    background:#fff!important;
    box-shadow:none!important;
  }
  html[data-cardondo-home="v10-shell"] .v9Rules summary{
    min-height:42px!important;
    padding:0 12px!important;
    display:flex!important;
    align-items:center!important;
    font-size:11px!important;
    line-height:1.2!important;
    font-weight:850!important;
  }
  html[data-cardondo-home="v10-shell"] .v9Rules>div{padding:0 10px 8px!important;grid-template-columns:1fr!important;gap:5px!important}
  html[data-cardondo-home="v10-shell"] .v9Rules p{padding:7px 8px!important;border-radius:8px!important;font-size:8.5px!important;line-height:1.35!important}
  html[data-cardondo-home="v10-shell"] .v9Rules>small{padding:0 12px 10px!important;font-size:8px!important}

  /* Keep the lower flow continuous and remove the several-hundred-pixel visual dead zone. */
  html[data-cardondo-home="v10-shell"] .homeV10RecentSales{margin-top:14px!important;padding-top:10px!important}
  html[data-cardondo-home="v10-shell"] .v9Main{margin-bottom:12px!important;min-height:0!important}
  html[data-cardondo-home="v10-shell"] .v9Footer{
    width:calc(100% - 28px)!important;
    margin:10px auto calc(76px + env(safe-area-inset-bottom))!important;
    padding:0!important;
    min-height:0!important;
    gap:10px!important;
    font-size:8px!important;
    line-height:1.35!important;
  }
  html[data-cardondo-home="v10-shell"] .v9Footer span{min-width:0!important}
  html[data-cardondo-home="v10-shell"] .v9Footer a{flex:0 0 auto!important;white-space:nowrap!important}
}

@media (max-width:390px){
  html[data-cardondo-home="v10-shell"] .homeV10SummaryMetric{min-height:54px!important;padding-left:3px!important;padding-right:3px!important}
  html[data-cardondo-home="v10-shell"] .homeV10SummaryMetric small{font-size:8.2px!important}
  html[data-cardondo-home="v10-shell"] .homeV10SummaryMetric strong{font-size:19px!important}
  html[data-cardondo-home="v10-shell"] .v9Footer{width:calc(100% - 24px)!important}
}
