/* AFL Match Lab v78 — responsive showcase UI
   Visual implementation of the selected desktop + mobile mockup.
   Presentation-only layer: no Supabase calls, no model mutation. */

:root{
  --v78-navy:#0b1f3a;
  --v78-navy-2:#17365f;
  --v78-blue:#1769ff;
  --v78-blue-soft:#edf4ff;
  --v78-bg:#f5f7fb;
  --v78-card:#ffffff;
  --v78-line:#e1e7ef;
  --v78-muted:#6f7f93;
  --v78-good:#119b68;
  --v78-good-soft:#e9f7f1;
  --v78-warn:#b67814;
  --v78-warn-soft:#fff5de;
  --v78-bad:#d34b59;
  --v78-bad-soft:#fff0f2;
  --v78-shadow:0 8px 28px rgba(19,42,72,.07);
  --v78-shadow-soft:0 3px 14px rgba(19,42,72,.055);
  --v78-radius:14px;
}

html{background:var(--v78-bg)}
body.v78-showcase{
  background:var(--v78-bg)!important;
  color:var(--v78-navy)!important;
}
body.v78-showcase .parallel-test-banner{display:none!important}
body.v78-showcase .panel{
  background:var(--v78-card)!important;
  border-color:var(--v78-line)!important;
  border-radius:var(--v78-radius)!important;
  box-shadow:var(--v78-shadow-soft)!important;
}
body.v78-showcase .eyebrow{
  color:#8190a3!important;
  letter-spacing:.115em!important;
}
body.v78-showcase button:not(.p2-nav-button):not(.p2-nav-more):not(.p2-header-more):not(.p2-drawer-item):not(.p2-drawer-close):not(.market-stepper button):not(.threshold-step){
  border-radius:9px!important;
}
body.v78-showcase .v78-preview-action,
body.v78-showcase .system-run-simulation,
body.v78-showcase .player-market-row .add-leg,
body.v78-showcase .send-builder,
body.v78-showcase #builderValueBtn,
body.v78-showcase .value-btn{
  background:var(--v78-blue)!important;
  color:#fff!important;
}
body.v78-showcase button.ghost{
  background:var(--v78-blue-soft)!important;
  color:var(--v78-blue)!important;
}
body.v78-showcase .badge.good{background:var(--v78-good-soft)!important;color:var(--v78-good)!important}
body.v78-showcase .badge.warn{background:var(--v78-warn-soft)!important;color:var(--v78-warn)!important}
body.v78-showcase .badge.bad{background:var(--v78-bad-soft)!important;color:var(--v78-bad)!important}
body.v78-showcase .badge.neutral{background:#f0f3f7!important;color:#627288!important}

/* ---------- App chrome ---------- */
body.v78-showcase .topbar{
  position:fixed!important;
  z-index:160!important;
  inset:0 0 auto 0!important;
  min-height:68px!important;
  height:68px!important;
  max-width:none!important;
  padding:0 22px!important;
  display:flex!important;
  align-items:center!important;
  gap:18px!important;
  background:rgba(255,255,255,.985)!important;
  border-bottom:1px solid var(--v78-line)!important;
  box-shadow:0 2px 14px rgba(21,42,70,.04)!important;
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
}
body.v78-showcase .brand{
  flex:0 0 auto!important;
  align-self:auto!important;
  min-width:206px!important;
  padding:0!important;
  border-right:0!important;
  gap:10px!important;
}
body.v78-showcase .brand-mark{
  width:34px!important;
  height:34px!important;
  color:var(--v78-blue)!important;
}
body.v78-showcase .brand-mark svg{width:34px!important;height:34px!important}
body.v78-showcase .brand h1{
  color:var(--v78-navy)!important;
  font-size:20px!important;
  font-weight:850!important;
}
body.v78-showcase .brand-subtitle{
  color:#8b98a8!important;
  font-size:7px!important;
  letter-spacing:.14em!important;
}
body.v78-showcase .topbar .match-picker{
  max-width:440px!important;
  min-width:250px!important;
}
body.v78-showcase .topbar .match-picker select{
  height:38px!important;
  border:1px solid #d9e1ec!important;
  background:#f8fafc!important;
  color:#3a4e68!important;
  box-shadow:none!important;
}
body.v78-showcase #healthBadge{
  min-height:32px!important;
  border:1px solid #d8e7df!important;
  background:var(--v78-good-soft)!important;
  color:var(--v78-good)!important;
}
body.v78-showcase #refreshBtn{
  min-height:34px!important;
  background:#f3f6fa!important;
  color:#425772!important;
}

/* Desktop: selected mockup uses a horizontal nav instead of a left rail. */
@media(min-width:901px){
  body.v78-showcase .p2-primary-nav{
    z-index:150!important;
    left:0!important;right:0!important;top:68px!important;bottom:auto!important;
    width:auto!important;height:50px!important;
    padding:0 24px!important;
    display:flex!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:4px!important;
    overflow:visible!important;
    border:0!important;
    border-bottom:1px solid var(--v78-line)!important;
    background:rgba(255,255,255,.99)!important;
    box-shadow:0 3px 12px rgba(21,42,70,.035)!important;
  }
  body.v78-showcase .p2-nav-button{
    width:auto!important;
    min-width:0!important;
    min-height:49px!important;
    height:49px!important;
    padding:0 12px!important;
    display:flex!important;
    grid-template-columns:none!important;
    gap:6px!important;
    border-radius:0!important;
    background:transparent!important;
    color:#53667f!important;
    box-shadow:none!important;
  }
  body.v78-showcase .p2-nav-button:hover{
    background:transparent!important;
    color:var(--v78-navy)!important;
  }
  body.v78-showcase .p2-nav-button.active{
    background:transparent!important;
    color:var(--v78-blue)!important;
    box-shadow:inset 0 -3px 0 var(--v78-blue)!important;
  }
  body.v78-showcase .p2-nav-icon{
    width:18px!important;height:18px!important;
    color:currentColor!important;
  }
  body.v78-showcase .p2-nav-icon svg{
    width:17px!important;height:17px!important;
    min-width:17px!important;min-height:17px!important;
    stroke-width:2!important;
  }
  body.v78-showcase .p2-nav-copy{display:block!important}
  body.v78-showcase .p2-nav-copy strong{
    font-size:10px!important;
    font-weight:850!important;
    letter-spacing:.045em!important;
  }
  body.v78-showcase .p2-nav-copy small{display:none!important}
  body.v78-showcase .p2-nav-badge{
    position:static!important;
    min-width:18px!important;height:18px!important;
    margin-left:1px!important;
    background:var(--v78-blue-soft)!important;
    color:var(--v78-blue)!important;
  }
  body.v78-showcase .p2-nav-secondary{
    margin:0 0 0 4px!important;
    padding:0!important;
    border:0!important;
  }
  body.v78-showcase .p2-nav-more{
    width:auto!important;
    min-height:49px!important;
    padding:0 11px!important;
    display:flex!important;
    gap:6px!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    color:#53667f!important;
  }
  body.v78-showcase .p2-nav-more:hover,
  body.v78-showcase .p2-nav-more.active{
    background:transparent!important;
    color:var(--v78-blue)!important;
  }
  body.v78-showcase .p2-nav-more svg{width:16px!important;height:16px!important}
  body.v78-showcase .p2-nav-more strong{font-size:10px!important;letter-spacing:.04em!important}
  body.v78-showcase .p2-nav-more small{display:none!important}
  body.v78-showcase .p2-nav-footer{display:none!important}

  body.v78-showcase main{
    max-width:1440px!important;
    margin:0 auto!important;
    padding:136px 24px 72px!important;
    gap:14px!important;
  }
  body.v78-showcase .p2-more-drawer{
    left:24px!important;
    top:126px!important;
    width:min(390px,calc(100vw - 48px))!important;
  }
}

/* ---------- Match page / desktop workstation ---------- */
body.v78-showcase .match-dashboard-shell{
  grid-template-columns:minmax(0,1fr) 292px!important;
  gap:14px!important;
}
body.v78-showcase .match-dashboard-main{gap:12px!important}
body.v78-showcase .match-dashboard-rail{
  gap:12px!important;
  top:132px!important;
}

body.v78-showcase #matchSummary{
  padding:17px 20px!important;
  min-height:122px!important;
  overflow:hidden!important;
  background:
    radial-gradient(circle at 50% -80%,rgba(23,105,255,.09),transparent 45%),
    #fff!important;
  border:1px solid #dfe6ef!important;
}
body.v78-showcase #matchSummary::after{
  background:radial-gradient(circle,rgba(23,105,255,.08),transparent 68%)!important;
}
body.v78-showcase #matchSummary .team-name{
  color:var(--v78-navy)!important;
  font-size:22px!important;
  font-weight:900!important;
}
body.v78-showcase #matchSummary .match-mid .eyebrow{color:#718198!important}
body.v78-showcase #matchSummary .match-mid strong{
  color:var(--v78-navy)!important;
  font-size:17px!important;
  font-weight:850!important;
}
body.v78-showcase #matchSummary .match-meta{color:#7b8a9d!important}
body.v78-showcase #matchSummary .match-team-logo .team-logo-large{
  width:72px!important;height:72px!important;
  filter:drop-shadow(0 5px 8px rgba(14,35,62,.12));
}

.v78-kpi-strip{
  display:grid;
  grid-template-columns:1.15fr 1fr 1fr .95fr;
  gap:10px;
}
.v78-kpi{
  position:relative;
  min-width:0;
  min-height:106px;
  padding:13px 14px;
  overflow:hidden;
  border:1px solid var(--v78-line);
  border-radius:12px;
  background:#fff;
  box-shadow:var(--v78-shadow-soft);
}
.v78-kpi .v78-label{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  color:#53677e;
  font-size:9px;
  font-weight:850;
  letter-spacing:.03em;
}
.v78-kpi .v78-main{
  margin-top:9px;
  color:var(--v78-navy);
  font-size:25px;
  font-weight:930;
  letter-spacing:-.025em;
}
.v78-kpi .v78-sub{
  margin-top:4px;
  color:#76879a;
  font-size:9px;
  line-height:1.35;
}
.v78-kpi .v78-split{
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:8px;
  margin-top:9px;
}
.v78-kpi .v78-split strong{font-size:19px;color:var(--v78-navy)}
.v78-kpi .v78-split span{font-size:9px;color:#73849a}
.v78-prob-bar{
  height:6px;
  margin-top:9px;
  overflow:hidden;
  display:flex;
  border-radius:999px;
  background:#edf1f6;
}
.v78-prob-bar i{display:block;height:100%;background:var(--v78-blue)}
.v78-prob-bar b{display:block;height:100%;background:var(--v78-navy-2)}
.v78-ready{
  display:inline-flex;
  align-items:center;
  gap:5px;
  margin-top:8px;
  padding:4px 7px;
  border-radius:999px;
  background:var(--v78-good-soft);
  color:var(--v78-good);
  font-size:8px;
  font-weight:900;
}
.v78-ready.medium{background:var(--v78-warn-soft);color:var(--v78-warn)}
.v78-ready.low{background:#f1f3f6;color:#66768a}

/* Legacy line/total controls remain available as the deeper analysis layer. */
body.v78-showcase #matchPrediction{
  padding:11px!important;
  background:#fbfcfe!important;
}
body.v78-showcase #matchPrediction::before{
  content:"MARKET CONTROLS";
  display:block;
  margin:0 0 8px 2px;
  color:#8996a7;
  font-size:8px;
  font-weight:900;
  letter-spacing:.12em;
}
body.v78-showcase #matchPrediction .match-pred-grid{
  grid-template-columns:1.25fr 1fr 1fr!important;
  gap:8px!important;
}
body.v78-showcase #matchPrediction .prediction-card{
  padding:11px!important;
  border-color:#e5eaf1!important;
  border-radius:10px!important;
  background:#fff!important;
  box-shadow:none!important;
}
body.v78-showcase #matchPrediction .score-pair b{color:var(--v78-navy)!important}
body.v78-showcase #matchPrediction .market-stepper button{
  background:var(--v78-blue-soft)!important;
  color:var(--v78-blue)!important;
  border-color:#d7e5ff!important;
}

/* Make existing cockpit cards visible again and visually match the selected concept. */
body.v78-showcase #view-match .cockpit-highlight-strip{
  display:grid!important;
  grid-template-columns:1.25fr 1fr 1fr!important;
  gap:10px!important;
}
body.v78-showcase .cockpit-highlight{
  min-height:118px!important;
  padding:14px!important;
  border:1px solid var(--v78-line)!important;
  border-radius:12px!important;
  background:#fff!important;
  box-shadow:var(--v78-shadow-soft)!important;
}
body.v78-showcase .cockpit-highlight::before{background:linear-gradient(90deg,var(--v78-blue),#67a2ff)!important}
body.v78-showcase .cockpit-highlight.risk::before{background:linear-gradient(90deg,#e04f5f,#f19170)!important}
body.v78-showcase .cockpit-highlight.shape::before{background:linear-gradient(90deg,#6d63d8,#9b87ef)!important}
body.v78-showcase .cockpit-highlight .hero-metric{color:var(--v78-navy)!important}
body.v78-showcase .cockpit-highlight .mini-meta span{background:#f0f4fa!important;color:#5f7289!important}
body.v78-showcase .cockpit-highlight.risk .mini-meta span{background:var(--v78-bad-soft)!important;color:#a53d49!important}

/* Top player markets */
body.v78-showcase .top-edges-panel .section-head h2::after{
  content:" · Top Player Markets";
  color:#8a97a8;
  font-size:11px;
  font-weight:650;
}
body.v78-showcase .top-edges-panel .top-leg-grid{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:9px!important;
}
body.v78-showcase .top-edges-panel .top-leg{
  grid-template-columns:58px minmax(0,1fr)!important;
  grid-template-rows:auto auto auto!important;
  padding:12px!important;
  border-color:#e2e8f0!important;
  border-radius:11px!important;
  background:#fff!important;
  box-shadow:none!important;
}
body.v78-showcase .top-edges-panel .top-leg .p{
  grid-row:1/4!important;
  color:var(--v78-good)!important;
  font-size:20px!important;
}
body.v78-showcase .top-edges-panel .top-leg .sel{
  grid-column:2!important;
  color:var(--v78-navy)!important;
  font-size:11px!important;
}
body.v78-showcase .top-edges-panel .top-leg .meta{
  grid-column:2!important;
  color:#77879a!important;
}
body.v78-showcase .top-edges-panel .top-leg .add-leg{
  grid-column:2!important;
  grid-row:auto!important;
  justify-self:start!important;
  margin-top:3px!important;
  padding:6px 9px!important;
  background:var(--v78-blue-soft)!important;
  color:var(--v78-blue)!important;
}

/* Inline System Multi preview on Match */
.v78-multi-preview{
  padding:15px!important;
}
.v78-preview-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.v78-preview-head h2{margin:0;color:var(--v78-navy);font-size:16px}
.v78-preview-head p{margin:3px 0 0;color:#7b8b9e;font-size:9px}
.v78-multi-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
}
.v78-multi-card{
  min-width:0;
  padding:11px;
  border:1px solid #e2e8f0;
  border-radius:10px;
  background:#fbfcfe;
}
.v78-multi-card.featured{
  border-color:#bad2ff;
  background:#f7faff;
  box-shadow:inset 0 0 0 1px #dce9ff;
}
.v78-multi-card small{
  display:block;
  color:#75869a;
  font-size:8px;
  font-weight:850;
  text-transform:uppercase;
}
.v78-multi-card strong{
  display:block;
  margin-top:4px;
  color:var(--v78-navy);
  font-size:17px;
}
.v78-multi-card span{
  display:block;
  margin-top:4px;
  color:#687b91;
  font-size:9px;
}
.v78-preview-action{
  min-height:32px!important;
  padding:6px 10px!important;
  background:var(--v78-blue)!important;
  color:#fff!important;
}

/* Risk preview */
.v78-risk-preview{
  padding:14px!important;
}
.v78-risk-preview-list{display:grid;gap:7px}
.v78-risk-row{
  display:grid;
  grid-template-columns:8px minmax(0,1fr);
  gap:8px;
  align-items:start;
  padding:8px 0;
  border-top:1px solid #edf0f4;
}
.v78-risk-row:first-child{border-top:0}
.v78-risk-dot{
  width:7px;height:7px;margin-top:4px;border-radius:50%;background:var(--v78-bad)
}
.v78-risk-row strong{display:block;color:#32475f;font-size:10px}
.v78-risk-row span{display:block;margin-top:2px;color:#8190a1;font-size:8px;line-height:1.4}

/* Supporting evidence */
body.v78-showcase .recent-form-panel,
body.v78-showcase .match-lineup-panel{background:#fff!important}
body.v78-showcase .recent-form-team,
body.v78-showcase .top-leg,
body.v78-showcase .scenario-card,
body.v78-showcase .team-style-card,
body.v78-showcase .synergy-card{
  border-color:#e3e8ef!important;
  border-radius:10px!important;
}
body.v78-showcase .form-result.win{background:var(--v78-good-soft)!important;color:var(--v78-good)!important}
body.v78-showcase .form-result.loss{background:var(--v78-bad-soft)!important;color:var(--v78-bad)!important}

/* Rail */
body.v78-showcase .match-rail-panel{padding:14px!important}
body.v78-showcase .match-alert i{
  background:var(--v78-blue)!important;
  box-shadow:0 0 0 4px var(--v78-blue-soft)!important;
}
body.v78-showcase .match-alert.good i{
  background:var(--v78-good)!important;
  box-shadow:0 0 0 4px var(--v78-good-soft)!important;
}
body.v78-showcase .match-insight-card{
  min-height:150px!important;
  background:
    radial-gradient(circle at 82% 18%,rgba(68,126,255,.85) 0,transparent 34%),
    linear-gradient(145deg,#0b1f3a,#102d54)!important;
}
body.v78-showcase .match-insight-card small{color:#a9c2ef!important}

/* All major workspaces inherit the same design language. */
body.v78-showcase .player-markets-hero,
body.v78-showcase .system-multi-hero{
  background:
    radial-gradient(circle at 90% -20%,rgba(23,105,255,.10),transparent 35%),
    #fff!important;
  border-color:#dde5ef!important;
}
body.v78-showcase .player-markets-hero h1,
body.v78-showcase .system-multi-hero h1{color:var(--v78-navy)!important}
body.v78-showcase .system-run-simulation,
body.v78-showcase .player-market-row .add-leg,
body.v78-showcase .send-builder{
  background:var(--v78-blue)!important;
  color:#fff!important;
}
body.v78-showcase .system-filter-panel,
body.v78-showcase .system-results-toolbar{
  border-color:#e0e6ef!important;
}
body.v78-showcase .system-market-check:has(input:checked){
  border-color:#bcd3ff!important;
  background:#f0f6ff!important;
}
body.v78-showcase .multi-card{
  border-color:#e0e6ef!important;
  border-radius:12px!important;
  box-shadow:var(--v78-shadow-soft)!important;
}
body.v78-showcase .multi-leg{background:#f6f8fb!important}
body.v78-showcase .builder-summary,
body.v78-showcase .dependency-box{border-color:#e1e7ef!important}

/* Mobile match secondary nav */
.v78-mobile-match-tabs{display:none}

/* Sticky mobile builder bar */
.v78-mobile-builder{
  display:none;
  position:fixed;
  z-index:172;
  left:8px;right:8px;
  bottom:82px;
  min-height:48px;
  padding:7px 8px 7px 12px;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  border-radius:12px;
  background:linear-gradient(135deg,#0b1f3a,#17437c);
  color:#fff;
  box-shadow:0 10px 28px rgba(11,31,58,.22);
}
.v78-mobile-builder strong{font-size:11px}
.v78-mobile-builder span{display:block;margin-top:2px;color:#cfe0ff;font-size:8px}
.v78-mobile-builder button{
  min-height:34px!important;
  padding:6px 10px!important;
  background:var(--v78-blue)!important;
  color:#fff!important;
  white-space:nowrap;
}

/* ---------- Tablet ---------- */
@media(max-width:1180px) and (min-width:901px){
  body.v78-showcase .match-dashboard-shell{grid-template-columns:minmax(0,1fr) 250px!important}
  .v78-kpi-strip{grid-template-columns:repeat(2,minmax(0,1fr))}
  body.v78-showcase .top-edges-panel .top-leg-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

/* ---------- Mobile matchday companion ---------- */
@media(max-width:900px){
  body.v78-showcase .topbar{
    height:60px!important;
    min-height:60px!important;
    padding:0 12px!important;
    gap:8px!important;
  }
  body.v78-showcase .brand{
    min-width:0!important;
    flex:1 1 auto!important;
    gap:8px!important;
  }
  body.v78-showcase .brand-mark{width:28px!important;height:28px!important}
  body.v78-showcase .brand-mark svg{width:28px!important;height:28px!important}
  body.v78-showcase .brand h1{font-size:16px!important}
  body.v78-showcase .brand-subtitle{display:none!important}
  body.v78-showcase .topbar .match-picker{display:none!important}
  body.v78-showcase #healthBadge{
    width:9px!important;height:9px!important;min-width:9px!important;min-height:9px!important;
    padding:0!important;border:0!important;border-radius:50%!important;
    overflow:hidden!important;text-indent:-999px!important;
    background:var(--v78-good)!important;
  }
  body.v78-showcase #healthBadge::before{display:none!important}
  body.v78-showcase #refreshBtn{
    width:34px!important;height:34px!important;min-height:34px!important;
    padding:0!important;justify-content:center!important;
    overflow:hidden!important;text-indent:-999px!important;
  }
  body.v78-showcase #refreshBtn svg{margin:0!important;flex:0 0 auto}
  body.v78-showcase .p2-header-more{
    width:34px!important;height:34px!important;min-height:34px!important;padding:0!important;
    justify-content:center!important;border-color:#dde5ef!important;background:#f6f8fb!important;color:#4b6079!important;
  }

  body.v78-showcase main{
    margin:0!important;
    padding:72px 9px 150px!important;
    gap:9px!important;
  }
  body.v78-showcase .view{gap:9px!important}
  body.v78-showcase .panel{padding:11px!important;border-radius:11px!important}

  body.v78-showcase .p2-primary-nav{
    height:72px!important;
    padding:4px 5px max(6px,env(safe-area-inset-bottom))!important;
    border-top:1px solid #dfe5ee!important;
    background:rgba(255,255,255,.985)!important;
    box-shadow:0 -6px 18px rgba(17,38,66,.08)!important;
  }
  body.v78-showcase .p2-nav-button{
    min-height:56px!important;
    grid-template-rows:29px 17px!important;
  }
  body.v78-showcase .p2-nav-icon,
  body.v78-showcase .p2-nav-button .p2-nav-icon{
    color:#62738a!important;
  }
  body.v78-showcase .p2-nav-button.active,
  body.v78-showcase .p2-nav-button.active .p2-nav-icon,
  body.v78-showcase .p2-nav-button.active .p2-nav-copy strong{
    color:var(--v78-blue)!important;
  }
  body.v78-showcase .p2-nav-button.active{
    background:var(--v78-blue-soft)!important;
    border-radius:9px!important;
  }

  body.v78-showcase .p2-more-drawer{
    bottom:78px!important;
    border-color:#dfe5ee!important;
    box-shadow:0 16px 40px rgba(15,35,60,.18)!important;
  }

  body.v78-showcase .match-dashboard-shell,
  body.v78-showcase .match-dashboard-main{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
  }
  body.v78-showcase .match-dashboard-rail{display:none!important}

  body.v78-showcase #matchSummary{
    min-height:118px!important;
    padding:13px 10px!important;
    grid-template-columns:1fr auto 1fr!important;
    gap:6px!important;
  }
  body.v78-showcase #matchSummary .team-name{
    font-size:13px!important;
    line-height:1.1!important;
  }
  body.v78-showcase #matchSummary .match-team-logo{height:52px!important}
  body.v78-showcase #matchSummary .match-team-logo .team-logo-large{
    width:50px!important;height:50px!important;
  }
  body.v78-showcase #matchSummary .match-mid .eyebrow{font-size:7px!important}
  body.v78-showcase #matchSummary .match-mid strong{font-size:11px!important}
  body.v78-showcase #matchSummary .match-meta{font-size:8px!important}

  .v78-mobile-match-tabs{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:2px;
    padding:3px;
    overflow:hidden;
    border:1px solid var(--v78-line);
    border-radius:10px;
    background:#fff;
    box-shadow:var(--v78-shadow-soft);
  }
  .v78-mobile-match-tabs button{
    min-width:0!important;
    min-height:34px!important;
    padding:5px 2px!important;
    border:0!important;
    border-radius:7px!important;
    background:transparent!important;
    color:#6f8094!important;
    font-size:8px!important;
    font-weight:850!important;
  }
  .v78-mobile-match-tabs button.active{
    background:var(--v78-blue-soft)!important;
    color:var(--v78-blue)!important;
  }

  .v78-kpi-strip{
    grid-template-columns:1fr 1fr;
    gap:7px;
  }
  .v78-kpi{
    min-height:86px;
    padding:10px;
    border-radius:10px;
  }
  .v78-kpi .v78-label{font-size:8px}
  .v78-kpi .v78-main{margin-top:7px;font-size:20px}
  .v78-kpi .v78-sub{font-size:8px}
  .v78-kpi .v78-split strong{font-size:16px}

  body.v78-showcase #matchPrediction{display:none!important}
  body.v78-showcase #view-match .cockpit-highlight-strip{
    grid-template-columns:1fr!important;
    gap:7px!important;
  }
  body.v78-showcase .cockpit-highlight{
    min-height:92px!important;
    padding:11px!important;
  }
  body.v78-showcase .cockpit-highlight .mini-meta{display:flex!important}

  body.v78-showcase .top-edges-panel .section-head{margin-bottom:8px!important}
  body.v78-showcase .top-edges-panel .top-leg-grid{
    grid-template-columns:1fr!important;
    gap:6px!important;
  }
  body.v78-showcase .top-edges-panel .top-leg{
    grid-template-columns:50px minmax(0,1fr) auto!important;
    grid-template-rows:auto auto!important;
    padding:9px!important;
  }
  body.v78-showcase .top-edges-panel .top-leg .p{
    grid-row:1/3!important;
    font-size:18px!important;
  }
  body.v78-showcase .top-edges-panel .top-leg .sel{grid-column:2!important}
  body.v78-showcase .top-edges-panel .top-leg .meta{grid-column:2!important}
  body.v78-showcase .top-edges-panel .top-leg .add-leg{
    grid-column:3!important;
    grid-row:1/3!important;
    align-self:center!important;
    justify-self:end!important;
  }

  .v78-multi-preview{padding:11px!important}
  .v78-preview-head{margin-bottom:8px}
  .v78-preview-head h2{font-size:14px}
  .v78-multi-grid{
    display:flex;
    gap:7px;
    overflow-x:auto;
    scroll-snap-type:x proximity;
    scrollbar-width:none;
  }
  .v78-multi-grid::-webkit-scrollbar{display:none}
  .v78-multi-card{
    flex:0 0 72%;
    scroll-snap-align:start;
  }

  .v78-risk-preview{display:block!important}

  /* Mobile prioritises the decision path. Deep evidence remains available below. */
  body.v78-showcase .recent-form-panel,
  body.v78-showcase .match-lineup-panel,
  body.v78-showcase #view-match .grid.two,
  body.v78-showcase #view-match .match-dashboard-main>section.panel:has(#modelSummary){
    margin-top:2px!important;
  }
  body.v78-showcase .recent-form-grid{grid-template-columns:1fr!important}

  .v78-mobile-builder{display:flex}
  body.v78-showcase .p2-more-drawer{z-index:210!important}
}

@media(max-width:480px){
  body.v78-showcase main{padding-left:7px!important;padding-right:7px!important}
  body.v78-showcase .topbar{padding-left:10px!important;padding-right:9px!important}
  body.v78-showcase .brand h1{font-size:15px!important}
  .v78-kpi{min-height:82px}
  .v78-kpi .v78-main{font-size:19px}
  .v78-multi-card{flex-basis:82%}
}

/* Reduced motion + touch/accessibility */
@media(prefers-reduced-motion:reduce){
  body.v78-showcase *,body.v78-showcase *::before,body.v78-showcase *::after{
    scroll-behavior:auto!important;
    transition:none!important;
    animation:none!important;
  }
}
@media(hover:none){
  body.v78-showcase button:hover{filter:none!important}
}


/* v78.1 — visual QA calibration: 1440 desktop / iPad / small iPhone */
body.v78-showcase button:focus-visible,
body.v78-showcase input:focus-visible,
body.v78-showcase select:focus-visible,
body.v78-showcase summary:focus-visible{
  outline-color:rgba(23,105,255,.38)!important;
}

/* Match hero status language shared across breakpoints. */
.v78-match-status{
  display:flex;justify-content:center;gap:5px;flex-wrap:wrap;margin-top:7px
}
.v78-match-status span{
  display:inline-flex;align-items:center;gap:4px;min-height:20px;padding:3px 6px;border-radius:999px;
  background:#f0f3f7;color:#66768a;font-size:7.5px;font-weight:900;letter-spacing:.02em
}
.v78-match-status span.good{background:var(--v78-good-soft);color:var(--v78-good)}
.v78-match-status span.info{background:var(--v78-blue-soft);color:var(--v78-blue)}
.v78-countdown{display:block;margin-top:4px;color:var(--v78-blue);font-size:9px;font-weight:900}

/* Desktop homepage mirrors the reference: full-width decision workspace, no duplicate sticky rail. */
@media(min-width:901px){
  body.v78-showcase .match-dashboard-shell{grid-template-columns:minmax(0,1fr)!important}
  body.v78-showcase .match-dashboard-rail{display:none!important}
  body.v78-showcase .top-edges-panel .top-leg:nth-child(n+4){display:none!important}
  .v78-insight-row{
    display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,.95fr) minmax(220px,.72fr);gap:10px;align-items:stretch
  }
  .v78-insight-row>section{min-width:0;margin:0!important}
  .v78-insight-row .recent-form-panel{height:100%}
  .v78-insight-row .recent-form-grid{grid-template-columns:1fr!important;gap:8px!important}
  .v78-insight-row .recent-form-team{padding:10px!important}
  .v78-insight-row .recent-form-list{gap:4px!important;margin-top:8px!important}
  .v78-insight-row .recent-form-row:nth-child(n+4){display:none!important}
}

/* At 1440 the selected reference uses one unified header row. */
@media(min-width:1280px){
  body.v78-showcase .topbar{padding-right:18px!important}
  body.v78-showcase .p2-primary-nav{
    z-index:166!important;left:226px!important;right:auto!important;top:0!important;bottom:auto!important;
    width:auto!important;height:68px!important;padding:0!important;gap:0!important;
    border:0!important;background:transparent!important;box-shadow:none!important
  }
  body.v78-showcase .p2-nav-button{
    min-height:68px!important;height:68px!important;padding:0 11px!important
  }
  body.v78-showcase .p2-nav-icon{display:none!important}
  body.v78-showcase .p2-nav-copy strong{font-size:9.5px!important}
  body.v78-showcase .p2-nav-secondary{height:68px!important;margin-left:0!important}
  body.v78-showcase .p2-nav-more{min-height:68px!important;height:68px!important;padding:0 10px!important}
  body.v78-showcase .p2-nav-more>svg{display:none!important}
  body.v78-showcase .topbar .match-picker{
    flex:0 1 280px!important;max-width:280px!important;min-width:210px!important;margin-left:auto!important
  }
  body.v78-showcase main{padding-top:88px!important}
  body.v78-showcase .p2-more-drawer{top:76px!important;left:236px!important}
}

/* Tablet keeps two horizontal chrome rows and allows cards to breathe. */
@media(max-width:1279px) and (min-width:901px){
  body.v78-showcase main{padding-top:136px!important}
  .v78-kpi-strip{grid-template-columns:repeat(4,minmax(0,1fr))}
  .v78-kpi{min-height:96px;padding:11px 12px}
  .v78-kpi .v78-main{font-size:22px}
  .v78-insight-row{grid-template-columns:1fr 1fr}
  .v78-insight-row .v78-risk-preview{grid-column:1/-1}
}

/* Match reference shows three top markets in the first decision pass. */
body.v78-showcase .top-edges-panel .top-leg-grid{align-items:stretch}

@media(max-width:900px){
  body.v78-showcase .top-actions{gap:4px!important}
  body.v78-showcase #refreshBtn,
  body.v78-showcase .p2-header-more{width:40px!important;height:40px!important;min-height:40px!important}
  .v78-mobile-match-tabs button{min-height:40px!important;font-size:9px!important}
  .v78-kpi .v78-label{font-size:8.5px}
  .v78-kpi .v78-sub{font-size:8.5px}
  .v78-ready{font-size:7.5px;line-height:1.25}
  body.v78-showcase .p2-nav-copy strong{font-size:9.5px!important}
  body.v78-showcase .p2-nav-button{touch-action:manipulation}
  body.v78-showcase .top-edges-panel .top-leg:nth-child(n+4){display:none!important}
  .v78-insight-row{display:flex;flex-direction:column;gap:7px}
  .v78-insight-row .v78-multi-preview{order:1}
  .v78-insight-row .v78-risk-preview{order:2}
  .v78-insight-row .recent-form-panel{order:3}
  .v78-match-status{margin-top:5px;gap:3px}
  .v78-match-status span{min-height:18px;padding:2px 5px;font-size:6.5px}
  .v78-countdown{font-size:8px}
}

/* iPhone SE / small-width hardening. */
@media(max-width:390px){
  body.v78-showcase .brand-mark{display:none!important}
  body.v78-showcase .brand h1{font-size:14px!important}
  body.v78-showcase .top-actions{margin-left:auto!important}
  body.v78-showcase #matchSummary{gap:3px!important;padding-left:7px!important;padding-right:7px!important}
  body.v78-showcase #matchSummary .team-name{font-size:12px!important}
  body.v78-showcase #matchSummary .match-team-logo .team-logo-large{width:44px!important;height:44px!important}
  .v78-kpi{padding:9px;min-height:80px}
  .v78-kpi .v78-main{font-size:18px}
  .v78-kpi .v78-split strong{font-size:14px}
  .v78-mobile-builder{left:6px;right:6px;padding-left:10px}
  .v78-mobile-builder strong{font-size:10px}
}


/* v78.2 — Final Visual Acceptance hardening
   Scope: chrome spacing, equal-height cards, logo safe area, mobile fold,
   sticky builder clearance, and 1440px information density. */
:root{--v782-bottom-nav:72px;--v782-builder-gap:8px}

/* Logo optical safe area: never crop tall/wide club marks. */
body.v78-showcase .match-team-logo,
body.v78-showcase .team-logo-shell{
  overflow:visible!important;
  clip-path:none!important;
  contain:none!important;
}
body.v78-showcase #matchSummary .team-logo-shell.team-logo-large{
  --afl-logo-pad:7px!important;
}
body.v78-showcase #matchSummary .team-logo-image{
  object-fit:contain!important;
  object-position:50% 50%!important;
  transform:none!important;
}

/* Cards in the reference read as one aligned decision row. */
.v78-insight-row{grid-auto-rows:1fr}
.v78-insight-row>section{height:100%!important}
.v78-multi-grid{grid-auto-rows:1fr}
.v78-multi-card{height:100%;display:flex;flex-direction:column;justify-content:flex-start}
.v78-multi-card span:last-child{margin-top:auto;padding-top:5px}

@media(min-width:1280px){
  /* Reserve a deterministic right utility zone so nav never collides with selector/actions. */
  body.v78-showcase .p2-primary-nav{
    left:214px!important;
    right:420px!important;
    width:auto!important;
    justify-content:center!important;
  }
  body.v78-showcase .p2-nav-button{padding-left:14px!important;padding-right:14px!important}
  body.v78-showcase .p2-nav-more{padding-left:13px!important;padding-right:13px!important}
  body.v78-showcase .topbar .match-picker{
    flex:0 1 248px!important;
    width:248px!important;
    max-width:248px!important;
    min-width:190px!important;
  }

  /* 1440 × 900 target: decision layer should fit before deep analysis. */
  body.v78-showcase main{max-width:1440px!important;padding:82px 20px 54px!important;gap:10px!important}
  body.v78-showcase .match-dashboard-main{gap:10px!important}
  body.v78-showcase #matchSummary{min-height:104px!important;padding:13px 18px!important}
  body.v78-showcase #matchSummary .team-name{font-size:20px!important}
  body.v78-showcase #matchSummary .match-team-logo{width:70px!important;height:70px!important;margin-top:1px!important}
  body.v78-showcase #matchSummary .team-logo-shell.team-logo-large{--afl-logo-size:66px!important}
  .v78-kpi-strip{gap:8px!important}
  .v78-kpi{min-height:90px!important;padding:10px 12px!important}
  .v78-kpi .v78-main{margin-top:6px!important;font-size:22px!important}
  .v78-kpi .v78-split{margin-top:6px!important}
  .v78-prob-bar{margin-top:6px!important}
  body.v78-showcase #view-match .cockpit-highlight-strip{gap:8px!important}
  body.v78-showcase .cockpit-highlight{min-height:98px!important;padding:11px 12px!important}
  body.v78-showcase .cockpit-highlight::before{height:34px!important;margin:-11px -12px 9px!important}
  body.v78-showcase .cockpit-highlight .kicker{top:8px!important;left:13px!important;font-size:10px!important}
  body.v78-showcase .cockpit-highlight .hero-metric{font-size:20px!important}
  body.v78-showcase .cockpit-highlight h3{font-size:13px!important}
  body.v78-showcase .cockpit-highlight p{font-size:9px!important}
  body.v78-showcase .top-edges-panel{padding:13px!important}
  body.v78-showcase .top-edges-panel .section-head{margin-bottom:9px!important}
  body.v78-showcase .top-edges-panel .top-leg{min-height:78px!important;padding:9px 10px!important}
  body.v78-showcase .top-edges-panel .top-leg .p{font-size:18px!important}
  body.v78-showcase .top-edges-panel .top-leg .meta{font-size:8px!important}
  .v78-insight-row{gap:8px!important;min-height:196px}
  .v78-insight-row>section{min-height:196px!important;padding:12px!important}
  .v78-insight-row .v78-preview-head{margin-bottom:7px!important}
  .v78-insight-row .v78-preview-head h2{font-size:14px!important}
  .v78-insight-row .recent-form-row{padding:6px 7px!important}
}

@media(max-width:1279px) and (min-width:901px){
  /* iPad: keep readable breathing room; equal-height two-column decision row. */
  .v78-insight-row{align-items:stretch!important}
  .v78-insight-row>section{min-height:190px!important}
  body.v78-showcase #matchSummary .team-logo-shell.team-logo-large{--afl-logo-pad:6px!important}
}

@media(max-width:900px){
  html,body.v78-showcase{min-height:100%;padding-bottom:env(safe-area-inset-bottom,0px)}
  body.v78-showcase main{
    padding-top:67px!important;
    padding-bottom:calc(var(--v782-bottom-nav) + 22px + env(safe-area-inset-bottom,0px))!important;
  }
  body.v78-showcase.v78-has-builder main{
    padding-bottom:calc(var(--v782-bottom-nav) + 82px + env(safe-area-inset-bottom,0px))!important;
  }
  body.v78-showcase .p2-primary-nav{
    height:var(--v782-bottom-nav)!important;
    padding-bottom:max(6px,env(safe-area-inset-bottom,0px))!important;
  }
  .v78-mobile-builder{
    bottom:calc(var(--v782-bottom-nav) + var(--v782-builder-gap) + env(safe-area-inset-bottom,0px))!important;
  }
  .v78-mobile-builder[hidden]{display:none!important}
  body.v78-showcase .p2-more-drawer{
    bottom:calc(var(--v782-bottom-nav) + 8px + env(safe-area-inset-bottom,0px))!important;
  }
  body.v78-showcase.v78-has-builder .p2-more-drawer{
    bottom:calc(var(--v782-bottom-nav) + 68px + env(safe-area-inset-bottom,0px))!important;
  }
  body.v78-showcase #matchSummary .team-logo-shell.team-logo-large{--afl-logo-pad:5px!important}
}

/* Compact mobile fold: Best Read becomes a swipe row instead of three stacked blocks. */
@media(max-width:600px){
  body.v78-showcase .topbar{height:56px!important;min-height:56px!important}
  body.v78-showcase main{padding-top:63px!important}
  body.v78-showcase #matchSummary{min-height:104px!important;padding-top:9px!important;padding-bottom:9px!important}
  .v78-mobile-match-tabs{padding:2px!important}
  .v78-mobile-match-tabs button{min-height:38px!important}
  .v78-kpi-strip{gap:6px!important}
  .v78-kpi{min-height:74px!important;padding:8px!important}
  .v78-kpi .v78-main{margin-top:5px!important;font-size:17px!important}
  .v78-kpi .v78-split{margin-top:5px!important}
  .v78-kpi .v78-split strong{font-size:13px!important}
  .v78-prob-bar{margin-top:5px!important;height:5px!important}
  .v78-ready{margin-top:5px!important;padding:3px 5px!important}
  body.v78-showcase #view-match .cockpit-highlight-strip{
    display:flex!important;
    overflow-x:auto!important;
    scroll-snap-type:x mandatory;
    gap:6px!important;
    padding-bottom:2px;
    scrollbar-width:none;
  }
  body.v78-showcase #view-match .cockpit-highlight-strip::-webkit-scrollbar{display:none}
  body.v78-showcase .cockpit-highlight{
    flex:0 0 82%;
    min-height:80px!important;
    scroll-snap-align:start;
  }
  body.v78-showcase .cockpit-highlight .mini-meta{display:none!important}
  body.v78-showcase .top-edges-panel{padding:10px!important}
  body.v78-showcase .top-edges-panel .top-leg{min-height:64px!important}
  body.v78-showcase .top-edges-panel .top-leg .add-leg{min-height:36px!important}
  .v78-insight-row>section{min-height:0!important;height:auto!important}
}

@media(max-width:390px){
  /* Small iPhone: preserve team identity and keep the first useful action above the fold. */
  body.v78-showcase #matchSummary{min-height:96px!important}
  body.v78-showcase #matchSummary .match-team-logo{height:42px!important}
  body.v78-showcase #matchSummary .team-logo-shell.team-logo-large{--afl-logo-size:42px!important;--afl-logo-pad:4px!important}
  .v78-match-status span{font-size:6px!important;padding-left:4px!important;padding-right:4px!important}
  .v78-kpi .v78-label{font-size:7.5px!important}
  .v78-kpi .v78-sub{display:none!important}
  body.v78-showcase .cockpit-highlight{flex-basis:88%}
}


/* v78.3 — live iPhone Safari hotfix from user-supplied 390px screenshot */
@media(max-width:900px){
  /* Remove duplicate journey/status layers. Mobile already has Hero + KPI + bottom nav. */
  body.v78-showcase #matchdayStatusStrip,
  body.v78-showcase #matchdayDecisionBand,
  body.v78-showcase .p2-decision-flow{
    display:none!important;
  }

  /* Quick tabs: compact segmented control, never solid blue buttons. */
  body.v78-showcase #v78MobileMatchTabs{
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:3px!important;
    padding:3px!important;
    border:1px solid #dfe6ef!important;
    border-radius:12px!important;
    background:#fff!important;
    box-shadow:0 2px 10px rgba(19,42,72,.045)!important;
  }
  body.v78-showcase #v78MobileMatchTabs button,
  body.v78-showcase #v78MobileMatchTabs button:hover,
  body.v78-showcase #v78MobileMatchTabs button:focus,
  body.v78-showcase #v78MobileMatchTabs button:active{
    min-height:38px!important;
    padding:5px 2px!important;
    border:0!important;
    border-radius:8px!important;
    background:transparent!important;
    color:#6c7e93!important;
    box-shadow:none!important;
    filter:none!important;
    font-size:9px!important;
    font-weight:850!important;
  }
  body.v78-showcase #v78MobileMatchTabs button.active{
    background:var(--v78-blue-soft)!important;
    color:var(--v78-blue)!important;
  }

  /* Header More: keep the control visible without dominating the header. */
  body.v78-showcase #p2HeaderMore{
    width:40px!important;
    min-width:40px!important;
    height:40px!important;
    min-height:40px!important;
    padding:0!important;
    display:grid!important;
    place-items:center!important;
    border:1px solid #dbe4ef!important;
    border-radius:11px!important;
    background:#f7f9fc!important;
    color:#53677f!important;
    box-shadow:none!important;
  }
  body.v78-showcase #p2HeaderMore .p2-header-more-copy{display:none!important}
  body.v78-showcase #p2HeaderMore .p2-header-more-icon{width:22px!important;height:22px!important;display:grid!important;place-items:center!important}

  /* Win-probability card: stop long team names colliding/wrapping across the midpoint. */
  body.v78-showcase .v78-kpi .v78-split>div{
    min-width:0!important;
    width:48%!important;
    display:grid!important;
    gap:2px!important;
  }
  body.v78-showcase .v78-kpi .v78-split>div:last-child{justify-items:end!important;text-align:right!important}
  body.v78-showcase .v78-kpi .v78-split span{
    display:block!important;
    max-width:100%!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    color:#78899f!important;
    font-size:7.5px!important;
    line-height:1.15!important;
  }
  body.v78-showcase .v78-kpi .v78-split strong{
    font-size:15px!important;
    line-height:1.05!important;
  }

  /* Bottom nav: float above Safari chrome, use one visual language, no legacy green active fill. */
  body.v78-showcase #p2PrimaryNav{
    left:8px!important;
    right:8px!important;
    bottom:calc(8px + env(safe-area-inset-bottom,0px))!important;
    width:auto!important;
    height:64px!important;
    padding:4px 5px!important;
    border:1px solid #dfe6ef!important;
    border-radius:15px!important;
    background:rgba(255,255,255,.985)!important;
    box-shadow:0 8px 28px rgba(14,35,62,.14)!important;
    overflow:visible!important;
  }
  body.v78-showcase #p2PrimaryNav .p2-nav-button,
  body.v78-showcase #p2PrimaryNav .p2-nav-button:hover,
  body.v78-showcase #p2PrimaryNav .p2-nav-button:focus,
  body.v78-showcase #p2PrimaryNav .p2-nav-button:active{
    min-height:54px!important;
    height:54px!important;
    padding:3px 1px!important;
    grid-template-rows:28px 16px!important;
    border:0!important;
    border-radius:10px!important;
    background:transparent!important;
    color:#62748a!important;
    box-shadow:none!important;
  }
  body.v78-showcase #p2PrimaryNav .p2-nav-button.active{
    background:var(--v78-blue-soft)!important;
    color:var(--v78-blue)!important;
  }
  body.v78-showcase #p2PrimaryNav .p2-nav-button .p2-nav-icon,
  body.v78-showcase #p2PrimaryNav .p2-nav-button .p2-nav-copy strong{
    color:inherit!important;
  }
  body.v78-showcase #p2PrimaryNav .p2-nav-icon{width:27px!important;height:27px!important}
  body.v78-showcase #p2PrimaryNav .p2-nav-icon svg{width:22px!important;height:22px!important;min-width:22px!important;min-height:22px!important}
  body.v78-showcase #p2PrimaryNav .p2-nav-copy strong{font-size:8.5px!important;line-height:1!important}
  body.v78-showcase #p2PrimaryNav .p2-nav-badge{top:1px!important;right:12%!important}

  /* Dynamic builder clears the floating nav and is smaller than the v78.2 bar. */
  body.v78-showcase.v78-has-builder #v78MobileBuilder{
    left:10px!important;
    right:10px!important;
    bottom:calc(80px + env(safe-area-inset-bottom,0px))!important;
    min-height:44px!important;
    padding:6px 7px 6px 11px!important;
    border-radius:12px!important;
  }
  body.v78-showcase #v78MobileBuilder button{min-height:32px!important;padding:5px 9px!important;font-size:10px!important}
  body.v78-showcase.v78-has-builder main{
    padding-bottom:calc(140px + env(safe-area-inset-bottom,0px))!important;
  }
  body.v78-showcase:not(.v78-has-builder) main{
    padding-bottom:calc(86px + env(safe-area-inset-bottom,0px))!important;
  }

  /* Risk/shape carousel in the screenshot was visually too tall. */
  body.v78-showcase #view-match .cockpit-highlight-strip{gap:7px!important}
  body.v78-showcase #view-match .cockpit-highlight{
    flex-basis:82%!important;
    min-height:96px!important;
    padding:9px 11px 10px!important;
  }
  body.v78-showcase #view-match .cockpit-highlight::before{
    height:34px!important;
    margin:-9px -11px 8px!important;
  }
  body.v78-showcase #view-match .cockpit-highlight .kicker{top:8px!important;left:12px!important;font-size:10px!important}
  body.v78-showcase #view-match .cockpit-highlight .hero-metric{font-size:20px!important;margin-top:0!important}
  body.v78-showcase #view-match .cockpit-highlight h3{font-size:13px!important}
  body.v78-showcase #view-match .cockpit-highlight p{font-size:9px!important;line-height:1.35!important}
}

@media(max-width:390px){
  body.v78-showcase main{padding-left:6px!important;padding-right:6px!important;gap:7px!important}
  body.v78-showcase .panel{border-radius:10px!important}
  body.v78-showcase #matchSummary{min-height:92px!important}
  body.v78-showcase .v78-kpi{min-height:70px!important;padding:8px!important}
  body.v78-showcase .v78-kpi .v78-main{font-size:16px!important}
  body.v78-showcase #view-match .cockpit-highlight{flex-basis:86%!important}
}


/* v78.3b — Player Markets live iPhone calibration */
@media(max-width:900px){
  body.v78-showcase #view-players .player-markets-workspace{gap:7px!important}

  /* Mobile player page is a decision/filter tool, not a marketing hero. */
  body.v78-showcase #view-players .player-markets-hero{
    min-height:0!important;
    display:block!important;
    padding:11px 12px!important;
    border:1px solid var(--v78-line)!important;
    border-radius:11px!important;
    background:#fff!important;
    color:var(--v78-navy)!important;
    box-shadow:var(--v78-shadow-soft)!important;
  }
  body.v78-showcase #view-players .player-markets-hero:after{display:none!important}
  body.v78-showcase #view-players .player-markets-hero .eyebrow{
    color:#8190a3!important;
    font-size:7px!important;
  }
  body.v78-showcase #view-players .player-markets-hero h1{
    margin:2px 0 0!important;
    color:var(--v78-navy)!important;
    font-size:18px!important;
    line-height:1.1!important;
    letter-spacing:-.02em!important;
  }
  body.v78-showcase #view-players .player-markets-hero p,
  body.v78-showcase #view-players .player-market-hero-flow{
    display:none!important;
  }

  /* Search/filter stays directly under the app header when scrolling. */
  body.v78-showcase #view-players .player-market-toolbar{
    top:62px!important;
    z-index:120!important;
    gap:6px!important;
    padding:8px!important;
    border:1px solid #dfe6ef!important;
    border-radius:11px!important;
    background:rgba(255,255,255,.97)!important;
    box-shadow:0 5px 18px rgba(19,42,72,.075)!important;
    backdrop-filter:blur(14px)!important;
    -webkit-backdrop-filter:blur(14px)!important;
  }
  body.v78-showcase #view-players .player-market-toolbar-title{
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:8px!important;
  }
  body.v78-showcase #view-players .player-market-toolbar-title h2{
    margin:0!important;
    color:var(--v78-navy)!important;
    font-size:13px!important;
  }
  body.v78-showcase #view-players .player-market-summary{
    max-width:58%!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    color:#7b8b9e!important;
    font-size:7px!important;
  }
  body.v78-showcase #view-players .player-market-controls{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 108px!important;
    gap:6px!important;
  }
  body.v78-showcase #view-players .player-market-controls label{
    min-width:0!important;
    padding:4px 5px!important;
    border:1px solid #e1e7ef!important;
    border-radius:9px!important;
    background:#f7f9fc!important;
  }
  body.v78-showcase #view-players .player-market-controls label>span{
    color:#7c8b9e!important;
    font-size:6px!important;
  }
  body.v78-showcase #view-players #playerSearch,
  body.v78-showcase #view-players #marketFilter{
    height:32px!important;
    min-height:32px!important;
    padding:4px 7px!important;
    border:0!important;
    background:#fff!important;
    color:var(--v78-navy)!important;
    font-size:10px!important;
  }

  /* Player card: compact identity and one market decision per visual block. */
  body.v78-showcase #view-players .player-card-list{gap:7px!important}
  body.v78-showcase #view-players .player-card{
    border:1px solid #dfe6ef!important;
    border-radius:12px!important;
    box-shadow:0 3px 12px rgba(19,42,72,.055)!important;
  }
  body.v78-showcase #view-players .player-card-head{
    padding:9px 10px!important;
    border-bottom:1px solid #edf0f4!important;
    background:#fbfcfe!important;
  }
  body.v78-showcase #view-players .player-jersey{
    width:32px!important;
    height:32px!important;
    border-radius:9px!important;
    background:linear-gradient(145deg,#0f4fa8,#1769ff)!important;
    box-shadow:none!important;
    font-size:10px!important;
  }
  body.v78-showcase #view-players .player-card-name h3{
    color:var(--v78-navy)!important;
    font-size:13px!important;
  }
  body.v78-showcase #view-players .player-card-name .match-meta{
    color:#7a8a9d!important;
    font-size:7.5px!important;
  }
  body.v78-showcase #view-players .player-card-status .badge{
    padding:3px 5px!important;
    font-size:6.5px!important;
  }
  body.v78-showcase #view-players .player-risk-strip{
    padding:6px 10px!important;
    gap:4px!important;
    border-bottom:1px solid #f0e8d9!important;
    background:#fff9ee!important;
    color:#7c6742!important;
    font-size:7px!important;
  }

  body.v78-showcase #view-players .player-market-grid{
    grid-template-columns:1fr!important;
    gap:6px!important;
    padding:6px!important;
  }
  body.v78-showcase #view-players .player-market-row{
    border:1px solid #e2e8f0!important;
    border-radius:10px!important;
    background:#fff!important;
  }
  body.v78-showcase #view-players .player-market-row-head{
    padding:8px!important;
    gap:7px!important;
    background:#fbfcfe!important;
  }
  body.v78-showcase #view-players .player-market-label{
    color:#52667d!important;
    font-size:7.5px!important;
  }
  body.v78-showcase #view-players .threshold-stepper{
    grid-template-columns:28px 40px 12px 28px!important;
    gap:3px!important;
    padding:3px!important;
    border-color:#dde5ef!important;
    border-radius:9px!important;
  }
  body.v78-showcase #view-players .threshold-stepper .threshold-step{
    width:28px!important;
    min-width:28px!important;
    height:29px!important;
    border-radius:7px!important;
    background:var(--v78-blue-soft)!important;
    color:var(--v78-blue)!important;
    font-size:14px!important;
  }
  body.v78-showcase #view-players .threshold-stepper .threshold-input{
    width:40px!important;
    height:29px!important;
    color:var(--v78-navy)!important;
    font-size:13px!important;
  }
  body.v78-showcase #view-players .player-market-price .prob{
    font-size:21px!important;
  }
  body.v78-showcase #view-players .player-market-price>span{
    padding:2px 5px!important;
    background:#f0f3f7!important;
    color:#65768b!important;
    font-size:6.5px!important;
  }

  /* Recent 5 is the primary visual evidence on mobile. */
  body.v78-showcase #view-players .recent-block{padding:0 8px 8px!important}
  body.v78-showcase #view-players .recent-caption{margin-bottom:4px!important;font-size:6.5px!important}
  body.v78-showcase #view-players .recent-strip{gap:3px!important}
  body.v78-showcase #view-players .recent-cell{
    min-height:32px!important;
    padding:4px 2px!important;
    border-radius:7px!important;
  }
  body.v78-showcase #view-players .recent-cell b{font-size:9.5px!important}
  body.v78-showcase #view-players .recent-cell small{font-size:5.5px!important}
  body.v78-showcase #view-players .recent-cell.hit{background:var(--v78-good)!important}
  body.v78-showcase #view-players .recent-cell.miss{background:var(--v78-bad)!important}

  /* Keep context secondary; Add to Multi remains the obvious action. */
  body.v78-showcase #view-players .player-market-footer{
    grid-template-columns:minmax(0,1fr) 104px!important;
    gap:6px!important;
    align-items:center!important;
    padding:7px 8px 8px!important;
    border-top:1px solid #edf0f4!important;
    background:#fbfcfe!important;
  }
  body.v78-showcase #view-players .player-context-details{
    border-color:#e1e7ef!important;
    border-radius:8px!important;
  }
  body.v78-showcase #view-players .player-context-details summary{
    min-height:34px!important;
    padding:6px 7px!important;
    color:#697b90!important;
    font-size:7px!important;
  }
  body.v78-showcase #view-players .player-market-footer .add-leg{
    width:104px!important;
    min-width:104px!important;
    height:36px!important;
    padding:6px 7px!important;
    border-radius:8px!important;
    background:var(--v78-blue)!important;
    color:#fff!important;
    font-size:8px!important;
  }
}

@media(max-width:390px){
  body.v78-showcase #view-players .player-market-controls{grid-template-columns:minmax(0,1fr) 100px!important}
  body.v78-showcase #view-players .player-market-toolbar{top:58px!important}
  body.v78-showcase #view-players .player-market-footer{grid-template-columns:minmax(0,1fr) 96px!important}
  body.v78-showcase #view-players .player-market-footer .add-leg{width:96px!important;min-width:96px!important}
}


/* v78.4 — mobile consistency pass from live iPhone screenshots */

/* System Multi had a white v78 hero with inherited white V71 text. Fix at all sizes. */
body.v78-showcase #view-system-multi .system-multi-hero{
  background:radial-gradient(circle at 90% -20%,rgba(23,105,255,.10),transparent 36%),#fff!important;
  color:var(--v78-navy)!important;
  border:1px solid #dde5ef!important;
  box-shadow:var(--v78-shadow-soft)!important;
}
body.v78-showcase #view-system-multi .system-multi-hero:after{border-color:rgba(23,105,255,.08)!important}
body.v78-showcase #view-system-multi .system-multi-hero .eyebrow{color:#8190a3!important}
body.v78-showcase #view-system-multi .system-multi-hero h1{color:var(--v78-navy)!important}
body.v78-showcase #view-system-multi .system-multi-hero p{color:#6f8095!important}
body.v78-showcase #view-system-multi .system-multi-hero-stats>div{
  border-color:#dfe7f2!important;
  background:#f7f9fc!important;
  backdrop-filter:none!important;
}
body.v78-showcase #view-system-multi .system-multi-hero-stats span{color:var(--v78-blue)!important}
body.v78-showcase #view-system-multi .system-multi-hero-stats strong{color:var(--v78-navy)!important}
body.v78-showcase #view-system-multi .system-multi-hero-stats small{color:#7b8b9e!important}
body.v78-showcase #view-system-multi .system-mobile-filter-btn,
body.v78-showcase #view-system-multi #systemFilterConfirm{
  background:var(--v78-blue)!important;
  color:#fff!important;
  box-shadow:none!important;
}
body.v78-showcase #view-system-multi .multi-card:before{background:linear-gradient(90deg,var(--v78-blue),#73a6ff)!important}
body.v78-showcase #view-system-multi .multi-strategy{color:var(--v78-blue)!important}
body.v78-showcase #view-system-multi .market-chip{background:var(--v78-blue-soft)!important;color:var(--v78-blue)!important}
body.v78-showcase #view-system-multi .send-builder{background:var(--v78-blue)!important;color:#fff!important}

@media(max-width:900px){
  /* More / Model Lab is a bottom sheet, not a near-full-screen page. */
  body.v78-showcase #p2MoreDrawer{
    left:8px!important;
    right:8px!important;
    top:auto!important;
    bottom:calc(80px + env(safe-area-inset-bottom,0px))!important;
    width:auto!important;
    max-height:min(68dvh,610px)!important;
    padding:8px!important;
    overflow:auto!important;
    border:1px solid #dfe6ef!important;
    border-radius:17px!important;
    background:rgba(255,255,255,.995)!important;
    box-shadow:0 18px 54px rgba(11,31,58,.20)!important;
  }
  body.v78-showcase #p2MoreDrawer:before{
    content:"";
    display:block;
    width:36px;
    height:4px;
    margin:1px auto 7px;
    border-radius:999px;
    background:#d8e0ea;
  }
  body.v78-showcase.p2-more-open #v78MobileBuilder{display:none!important}
  body.v78-showcase .p2-drawer-head{padding:3px 4px 8px!important;gap:8px!important}
  body.v78-showcase .p2-drawer-head h3{margin:0!important;color:var(--v78-navy)!important;font-size:14px!important;line-height:1.2!important}
  body.v78-showcase .p2-drawer-head p{display:none!important}
  body.v78-showcase .p2-drawer-close{
    width:30px!important;height:30px!important;min-width:30px!important;padding:0!important;
    background:#f2f5f9!important;color:#5c6f86!important
  }
  body.v78-showcase .p2-drawer-section{padding:7px 2px 2px!important}
  body.v78-showcase .p2-drawer-label{margin:0 3px 5px!important;color:#8190a3!important;font-size:7px!important}
  body.v78-showcase .p2-drawer-grid{grid-template-columns:1fr 1fr!important;gap:6px!important}
  body.v78-showcase .p2-drawer-grid.single{grid-template-columns:1fr!important}
  body.v78-showcase .p2-drawer-item{
    min-height:56px!important;
    padding:8px!important;
    grid-template-columns:24px minmax(0,1fr)!important;
    gap:1px 7px!important;
    border:1px solid #e1e7ef!important;
    border-radius:10px!important;
    background:#f8fafc!important;
    color:var(--v78-navy)!important;
  }
  body.v78-showcase .p2-drawer-item .p2-mini-icon{color:var(--v78-blue)!important}
  body.v78-showcase .p2-drawer-item .p2-mini-icon svg{width:18px!important;height:18px!important}
  body.v78-showcase .p2-drawer-item strong{font-size:9px!important}
  body.v78-showcase .p2-drawer-item small{font-size:6.5px!important;line-height:1.25!important;color:#78899c!important}
  body.v78-showcase .p2-system-status{padding:8px!important;border-color:#e1e7ef!important;background:#fbfcfe!important}
  body.v78-showcase .p2-status-line strong{font-size:9px!important}
  body.v78-showcase #p2SystemDetail{display:none!important}
  body.v78-showcase #p2SystemRefresh{
    width:100%!important;min-height:34px!important;margin-top:7px!important;padding:6px 8px!important;
    border:1px solid #dce5ef!important;background:#fff!important;color:#465b74!important;font-size:8px!important
  }

  /* Stronger v78 ownership of the bottom nav than the legacy v65 green layer. */
  body.v78-showcase.p2-nav-ready #p2PrimaryNav .p2-nav-button.active,
  body.v78-showcase.p2-nav-ready #p2PrimaryNav .p2-nav-button.active:hover,
  body.v78-showcase.p2-nav-ready #p2PrimaryNav .p2-nav-button.active:focus{
    background:var(--v78-blue-soft)!important;
    color:var(--v78-blue)!important;
  }
  body.v78-showcase.p2-nav-ready #p2PrimaryNav .p2-nav-button.active .p2-nav-icon,
  body.v78-showcase.p2-nav-ready #p2PrimaryNav .p2-nav-button.active .p2-nav-copy strong{
    color:var(--v78-blue)!important;
  }

  /* Multi Lab: make one selected leg fit as a compact decision card. */
  body.v78-showcase #view-multi-lab .builder-grid{display:grid!important;grid-template-columns:1fr!important;gap:7px!important}
  body.v78-showcase #view-multi-lab .builder-grid>.panel{padding:10px!important}
  body.v78-showcase #view-multi-lab .section-head{margin-bottom:8px!important;align-items:center!important}
  body.v78-showcase #view-multi-lab .section-head h2{font-size:18px!important}
  body.v78-showcase #view-multi-lab #clearBuilder{
    min-height:34px!important;padding:5px 9px!important;border:1px solid #dce5ef!important;
    background:#fff!important;color:#53677f!important;font-size:9px!important
  }
  body.v78-showcase #view-multi-lab #builderLegs{gap:6px!important}
  body.v78-showcase #view-multi-lab .builder-leg{
    grid-template-columns:minmax(0,1fr) auto auto!important;
    gap:6px!important;
    align-items:center!important;
    padding:8px 9px!important;
    border-color:#e0e7ef!important;
    border-radius:10px!important;
    background:#fff!important;
    font-size:9px!important;
  }
  body.v78-showcase #view-multi-lab .builder-leg strong{font-size:10px!important;color:var(--v78-navy)!important}
  body.v78-showcase #view-multi-lab .builder-leg .match-meta{font-size:8px!important;color:#78899c!important}
  body.v78-showcase #view-multi-lab .remove-leg{
    width:auto!important;min-width:0!important;min-height:30px!important;height:30px!important;
    padding:4px 8px!important;border:0!important;border-radius:8px!important;
    background:var(--v78-bad-soft)!important;color:var(--v78-bad)!important;font-size:8px!important
  }
  body.v78-showcase #view-multi-lab #builderSummary{
    margin-top:7px!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:5px!important;
  }
  body.v78-showcase #view-multi-lab #builderSummary .stat{
    min-height:58px!important;padding:8px 6px!important;border:1px solid #e2e8f0!important;
    border-radius:10px!important;background:#f8fafc!important
  }
  body.v78-showcase #view-multi-lab #builderSummary .stat b{
    display:block!important;color:var(--v78-navy)!important;font-size:16px!important;line-height:1.1!important
  }
  body.v78-showcase #view-multi-lab #builderSummary .stat span{
    display:block!important;margin-top:5px!important;color:#7a8b9e!important;font-size:7px!important
  }
  body.v78-showcase #view-multi-lab #builderDependencyDetails:empty,
  body.v78-showcase #view-multi-lab #builderValueResult:empty{display:none!important}
  body.v78-showcase #view-multi-lab #builderDependencyDetails{
    margin-top:7px!important;padding:8px!important;border-radius:9px!important;font-size:8px!important
  }
  body.v78-showcase #view-multi-lab .builder-value{
    margin-top:8px!important;
    padding:8px!important;
    grid-template-columns:minmax(0,1fr) 108px!important;
    gap:6px!important;
    border:1px solid #e1e7ef!important;
    border-radius:10px!important;
    background:#fbfcfe!important;
  }
  body.v78-showcase #view-multi-lab .builder-value label{gap:4px!important;font-size:8px!important}
  body.v78-showcase #view-multi-lab #builderActualOdds{height:38px!important;padding:6px 8px!important;font-size:11px!important}
  body.v78-showcase #view-multi-lab #builderValueBtn{
    width:108px!important;height:38px!important;min-height:38px!important;padding:6px!important;
    border-radius:9px!important;font-size:9px!important
  }
  body.v78-showcase #view-multi-lab .builder-grid>.panel:first-child>.note{display:none!important}

  /* System Multi: turn the old marketing hero into a compact control header. */
  body.v78-showcase #view-system-multi .system-multi-workspace{gap:7px!important}
  body.v78-showcase #view-system-multi .system-multi-hero{
    grid-template-columns:1fr!important;
    gap:8px!important;
    padding:10px 11px!important;
    border-radius:11px!important;
  }
  body.v78-showcase #view-system-multi .system-multi-hero:after{display:none!important}
  body.v78-showcase #view-system-multi .system-multi-hero-copy{min-width:0!important}
  body.v78-showcase #view-system-multi .system-multi-hero .eyebrow{font-size:6.5px!important}
  body.v78-showcase #view-system-multi .system-multi-hero h1{
    margin:1px 0 0!important;font-size:18px!important;line-height:1.1!important
  }
  body.v78-showcase #view-system-multi .system-multi-hero p{display:none!important}
  body.v78-showcase #view-system-multi .system-multi-hero-stats{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:5px!important
  }
  body.v78-showcase #view-system-multi .system-multi-hero-stats>div{
    padding:6px 7px!important;border-radius:8px!important
  }
  body.v78-showcase #view-system-multi .system-multi-hero-stats span{font-size:6px!important;letter-spacing:.08em!important}
  body.v78-showcase #view-system-multi .system-multi-hero-stats strong{margin-top:2px!important;font-size:9px!important}
  body.v78-showcase #view-system-multi .system-multi-hero-stats small{font-size:6px!important}
  body.v78-showcase #view-system-multi .system-results-toolbar{
    top:62px!important;
    z-index:110!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    gap:7px!important;
    padding:9px 10px!important;
    border-radius:11px!important;
    border-color:#dfe6ef!important;
    box-shadow:0 5px 18px rgba(19,42,72,.065)!important;
  }
  body.v78-showcase #view-system-multi .system-results-toolbar h2{font-size:15px!important}
  body.v78-showcase #view-system-multi .system-mobile-filter-btn{
    grid-column:2!important;grid-row:1!important;
    min-height:34px!important;padding:6px 9px!important;border:0!important;border-radius:9px!important;
    font-size:8px!important
  }
  body.v78-showcase #view-system-multi .system-filter-summary{
    grid-column:1/-1!important;gap:4px!important;font-size:7px!important
  }
  body.v78-showcase #view-system-multi .system-filter-summary span,
  body.v78-showcase #view-system-multi .system-filter-summary b{
    padding:4px 6px!important;border-radius:7px!important
  }
  body.v78-showcase #view-system-multi .system-filter-summary b{background:var(--v78-blue-soft)!important;color:var(--v78-blue)!important}
  body.v78-showcase #view-system-multi .multi-grid{gap:7px!important}
  body.v78-showcase #view-system-multi .multi-card{border-radius:12px!important}
  body.v78-showcase #view-system-multi .multi-top{padding:10px 11px 8px!important}
  body.v78-showcase #view-system-multi .multi-title{font-size:15px!important}
  body.v78-showcase #view-system-multi .multi-legs{padding:8px 10px 7px!important;gap:5px!important}
  body.v78-showcase #view-system-multi .multi-leg{padding:7px 8px!important;border-color:#e6ebf1!important;background:#f8fafc!important}
  body.v78-showcase #view-system-multi .multi-metrics{padding:0 10px 8px!important}
  body.v78-showcase #view-system-multi .multi-actions{padding:0 10px 9px!important}
  body.v78-showcase #view-system-multi .send-builder{min-height:34px!important;padding:6px 8px!important;font-size:8px!important}
}

@media(max-width:390px){
  body.v78-showcase #p2MoreDrawer{left:6px!important;right:6px!important;max-height:min(66dvh,570px)!important}
  body.v78-showcase #view-multi-lab #builderSummary .stat{min-height:54px!important;padding:7px 4px!important}
  body.v78-showcase #view-multi-lab #builderSummary .stat b{font-size:14px!important}
  body.v78-showcase #view-multi-lab .builder-value{grid-template-columns:minmax(0,1fr) 96px!important}
  body.v78-showcase #view-multi-lab #builderValueBtn{width:96px!important}
}


/* v78.5 — Mobile Typography Pass from live iPhone QA */
@media(max-width:430px){
  body.v78-showcase{font-size:16px!important;line-height:1.45!important}

  /* Safari: form controls at 16px avoid focus zoom and improve legibility. */
  body.v78-showcase input,
  body.v78-showcase select,
  body.v78-showcase textarea{
    font-size:16px!important;
  }

  body.v78-showcase .eyebrow{font-size:11px!important;letter-spacing:.08em!important}
  body.v78-showcase .note,
  body.v78-showcase .match-meta,
  body.v78-showcase .badge{font-size:12px!important;line-height:1.35!important}

  /* App chrome */
  body.v78-showcase .brand h1{font-size:20px!important;line-height:1.1!important}
  body.v78-showcase #p2HeaderMore{width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important}
  body.v78-showcase #p2PrimaryNav .p2-nav-copy strong{font-size:12px!important;line-height:1.05!important}
  body.v78-showcase #p2PrimaryNav .p2-nav-icon{width:30px!important;height:30px!important}
  body.v78-showcase #p2PrimaryNav .p2-nav-icon svg{width:24px!important;height:24px!important;min-width:24px!important;min-height:24px!important}

  /* Match */
  body.v78-showcase #matchSummary .team-name{font-size:18px!important;line-height:1.15!important}
  body.v78-showcase #matchSummary .match-mid strong{font-size:18px!important;line-height:1.15!important}
  body.v78-showcase #matchSummary .match-meta{font-size:12px!important}
  body.v78-showcase .v78-match-status span{font-size:11px!important;padding:4px 7px!important}
  body.v78-showcase #v78MobileMatchTabs button{font-size:14px!important;min-height:42px!important}
  body.v78-showcase .v78-kpi .v78-label{font-size:12px!important}
  body.v78-showcase .v78-kpi .v78-main{font-size:20px!important;line-height:1.1!important}
  body.v78-showcase .v78-kpi .v78-sub{font-size:12px!important;line-height:1.3!important}
  body.v78-showcase .v78-kpi .v78-split span{font-size:11px!important}
  body.v78-showcase .v78-kpi .v78-split strong{font-size:18px!important}
  body.v78-showcase .v78-ready{font-size:11px!important;padding:4px 7px!important}
  body.v78-showcase #view-match .cockpit-highlight .kicker{font-size:12px!important}
  body.v78-showcase #view-match .cockpit-highlight h3{font-size:18px!important;line-height:1.2!important}
  body.v78-showcase #view-match .cockpit-highlight .hero-metric{font-size:24px!important}
  body.v78-showcase #view-match .cockpit-highlight p{font-size:13px!important;line-height:1.4!important}
  body.v78-showcase .top-edges-panel .section-head h2{font-size:20px!important}
  body.v78-showcase .top-edges-panel .top-leg .sel{font-size:15px!important;line-height:1.25!important}
  body.v78-showcase .top-edges-panel .top-leg .meta{font-size:12px!important;line-height:1.35!important}
  body.v78-showcase .top-edges-panel .top-leg .p{font-size:22px!important}
  body.v78-showcase .top-edges-panel .top-leg .add-leg{font-size:12px!important;min-height:38px!important}

  /* Player Markets */
  body.v78-showcase #view-players .player-markets-hero h1,
  body.v78-showcase #view-players .player-market-toolbar-title h2{font-size:20px!important;line-height:1.2!important}
  body.v78-showcase #view-players .player-market-summary{font-size:11px!important}
  body.v78-showcase #view-players .player-market-controls label>span{font-size:11px!important}
  body.v78-showcase #view-players #playerSearch,
  body.v78-showcase #view-players #marketFilter{height:42px!important;min-height:42px!important;font-size:16px!important}
  body.v78-showcase #view-players .player-card-name h3{font-size:18px!important;line-height:1.2!important}
  body.v78-showcase #view-players .player-card-name .match-meta{font-size:12px!important}
  body.v78-showcase #view-players .player-market-label{font-size:12px!important}
  body.v78-showcase #view-players .player-market-price .prob{font-size:22px!important}
  body.v78-showcase #view-players .player-market-price>span{font-size:11px!important}
  body.v78-showcase #view-players .recent-caption,
  body.v78-showcase #view-players .recent-caption strong{font-size:11px!important}
  body.v78-showcase #view-players .recent-cell b{font-size:12px!important}
  body.v78-showcase #view-players .recent-cell small{font-size:10px!important}
  body.v78-showcase #view-players .player-context-details summary{font-size:12px!important}
  body.v78-showcase #view-players .player-market-footer .add-leg{font-size:13px!important;height:42px!important}
  body.v78-showcase #view-players .player-risk-strip{font-size:11px!important;line-height:1.35!important}

  /* P1 decision-speed scanner on Player Markets */
  body.v78-showcase #view-players .p1d-scanner-head h2{font-size:19px!important;line-height:1.2!important}
  body.v78-showcase #view-players .p1d-scanner-head p{font-size:12px!important;line-height:1.35!important}
  body.v78-showcase #view-players .p1d-scanner-head .badge{font-size:11px!important}
  body.v78-showcase #view-players .p1d-mode-tabs{gap:6px!important;overflow-x:auto!important;scrollbar-width:none}
  body.v78-showcase #view-players .p1d-mode-tabs::-webkit-scrollbar{display:none}
  body.v78-showcase #view-players .p1d-mode-tabs button{min-height:42px!important;padding:7px 12px!important;font-size:13px!important;white-space:nowrap!important}
  body.v78-showcase #view-players .p1d-rank-card{min-height:92px!important;padding:11px!important}
  body.v78-showcase #view-players .p1d-rank-card small{font-size:11px!important}
  body.v78-showcase #view-players .p1d-rank-card strong{font-size:17px!important;line-height:1.2!important}
  body.v78-showcase #view-players .p1d-rank-card b{font-size:14px!important;line-height:1.3!important}
  body.v78-showcase #view-players .p1d-rank-card em{font-size:11px!important;line-height:1.35!important}
  body.v78-showcase #view-players .p1d-rank-tag{font-size:11px!important}

  /* System Multi */
  body.v78-showcase #view-system-multi .system-multi-hero h1,
  body.v78-showcase #view-system-multi .system-results-toolbar h2,
  body.v78-showcase #view-system-multi .system-filter-header h2{font-size:20px!important;line-height:1.2!important}
  body.v78-showcase #view-system-multi .system-multi-hero-stats span{font-size:10px!important}
  body.v78-showcase #view-system-multi .system-multi-hero-stats strong{font-size:13px!important}
  body.v78-showcase #view-system-multi .system-multi-hero-stats small{font-size:10px!important}
  body.v78-showcase #view-system-multi .system-filter-summary,
  body.v78-showcase #view-system-multi .system-filter-summary small{font-size:11px!important;line-height:1.35!important}
  body.v78-showcase #view-system-multi .system-mobile-filter-btn,
  body.v78-showcase #view-system-multi .system-run-simulation{font-size:14px!important;min-height:42px!important}
  body.v78-showcase #view-system-multi .multi-strategy{font-size:11px!important}
  body.v78-showcase #view-system-multi .multi-title{font-size:18px!important;line-height:1.2!important}
  body.v78-showcase #view-system-multi .multi-leg{font-size:13px!important;line-height:1.35!important}
  body.v78-showcase #view-system-multi .market-chip,
  body.v78-showcase #view-system-multi .leg-role{font-size:10px!important}
  body.v78-showcase #view-system-multi .multi-leg>strong{font-size:13px!important}
  body.v78-showcase #view-system-multi .metric{font-size:11px!important}
  body.v78-showcase #view-system-multi .metric b{font-size:16px!important}
  body.v78-showcase #view-system-multi .send-builder{font-size:13px!important;min-height:42px!important}
  body.v78-showcase #view-system-multi .p1d-multi-intel{font-size:12px!important;line-height:1.4!important}
  body.v78-showcase #view-system-multi .p1d-multi-intel strong{font-size:14px!important}
  body.v78-showcase #view-system-multi .p1d-multi-intel small{font-size:11px!important}

  /* Multi Lab */
  body.v78-showcase #view-multi-lab .section-head h2{font-size:20px!important}
  body.v78-showcase #view-multi-lab .builder-leg{font-size:12px!important;line-height:1.35!important}
  body.v78-showcase #view-multi-lab .builder-leg strong{font-size:14px!important}
  body.v78-showcase #view-multi-lab .builder-leg .match-meta{font-size:11px!important}
  body.v78-showcase #view-multi-lab .remove-leg{font-size:12px!important;min-height:34px!important}
  body.v78-showcase #view-multi-lab #builderSummary .stat b{font-size:18px!important}
  body.v78-showcase #view-multi-lab #builderSummary .stat span{font-size:11px!important}
  body.v78-showcase #view-multi-lab #builderDependencyDetails{font-size:12px!important;line-height:1.4!important}
  body.v78-showcase #view-multi-lab .builder-value label{font-size:12px!important}
  body.v78-showcase #view-multi-lab #builderActualOdds{height:42px!important;font-size:16px!important}
  body.v78-showcase #view-multi-lab #builderValueBtn,
  body.v78-showcase #view-multi-lab #clearBuilder{font-size:13px!important;min-height:42px!important}
  body.v78-showcase #view-multi-lab .builder-match-markets{font-size:14px!important;line-height:1.4!important}

  /* More */
  body.v78-showcase #p2MoreDrawer .p2-drawer-head h3{font-size:20px!important}
  body.v78-showcase #p2MoreDrawer .p2-drawer-label{font-size:11px!important}
  body.v78-showcase #p2MoreDrawer .p2-drawer-item strong{font-size:14px!important}
  body.v78-showcase #p2MoreDrawer .p2-drawer-item small{font-size:11px!important;line-height:1.3!important}
  body.v78-showcase #p2MoreDrawer .p2-status-line strong{font-size:13px!important}
  body.v78-showcase #p2SystemRefresh{font-size:13px!important;min-height:42px!important}

  /* Floating Multi builder */
  body.v78-showcase #v78MobileBuilder{min-height:54px!important}
  body.v78-showcase #v78MobileBuilder strong{font-size:14px!important}
  body.v78-showcase #v78MobileBuilder span{font-size:12px!important}
  body.v78-showcase #v78MobileBuilder button{font-size:14px!important;min-height:40px!important;padding:7px 12px!important}
}


/* v78.6 — Mobile Harmony Pass
   Consolidates mobile components into one white/navy/blue product language. */
@media(max-width:430px){
  /* ----- Shared mobile component grammar ----- */
  body.v78-showcase .panel,
  body.v78-showcase .player-card,
  body.v78-showcase .multi-card,
  body.v78-showcase .match-leg-box,
  body.v78-showcase .player-market-row{
    border-color:#dfe6ef!important;
    border-radius:14px!important;
    background:#fff!important;
    box-shadow:0 3px 12px rgba(20,42,70,.045)!important;
  }
  body.v78-showcase .badge,
  body.v78-showcase .market-chip,
  body.v78-showcase .leg-role{
    border-radius:999px!important;
  }
  body.v78-showcase button{
    -webkit-tap-highlight-color:transparent;
  }

  /* ----- Match Hero: calmer hierarchy and safer long-team-name layout ----- */
  body.v78-showcase #matchSummary{
    grid-template-columns:minmax(0,.9fr) minmax(138px,1.2fr) minmax(0,.9fr)!important;
    gap:5px!important;
    padding:12px 9px!important;
    min-height:142px!important;
    align-items:center!important;
  }
  body.v78-showcase #matchSummary .team-name{
    max-width:100%!important;
    margin-inline:auto!important;
    font-size:16px!important;
    line-height:1.08!important;
    letter-spacing:-.015em!important;
    text-align:center!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
  }
  body.v78-showcase #matchSummary .match-mid{
    min-width:0!important;
    padding:0 2px!important;
  }
  body.v78-showcase #matchSummary .match-mid strong{
    font-size:17px!important;
    line-height:1.15!important;
    white-space:normal!important;
  }
  body.v78-showcase #matchSummary .match-meta{font-size:11px!important}
  body.v78-showcase #matchSummary .match-team-logo{height:46px!important;margin-top:5px!important}
  body.v78-showcase #matchSummary .team-logo-shell.team-logo-large{
    --afl-logo-size:44px!important;
    --afl-logo-pad:4px!important;
  }
  body.v78-showcase .v78-match-status{gap:4px!important;margin-top:6px!important}
  body.v78-showcase .v78-match-status span{
    min-height:23px!important;
    padding:3px 6px!important;
    font-size:9px!important;
    letter-spacing:0!important;
  }

  /* Late-change monitor should support the hero, not compete with it. */
  body.v78-showcase #matchdayLateChangeMonitor,
  body.v78-showcase .late-change-monitor{
    border-radius:13px!important;
  }

  /* ----- KPI / primary decision cards ----- */
  body.v78-showcase .v78-kpi{
    min-height:96px!important;
    padding:11px!important;
    border-radius:13px!important;
  }
  body.v78-showcase .v78-kpi .v78-label{font-size:11px!important}
  body.v78-showcase .v78-kpi .v78-main{font-size:19px!important}
  body.v78-showcase .v78-kpi .v78-split strong{font-size:17px!important}
  body.v78-showcase .v78-kpi .v78-split span{font-size:10px!important}
  body.v78-showcase .v78-ready{font-size:10px!important}

  /* ----- Floating Multi Lab: utility chip, not a second navigation bar ----- */
  body.v78-showcase.v78-has-builder #v78MobileBuilder{
    left:14px!important;
    right:14px!important;
    bottom:calc(78px + env(safe-area-inset-bottom,0px))!important;
    min-height:50px!important;
    height:50px!important;
    padding:5px 6px 5px 12px!important;
    border:1px solid #cfddf2!important;
    border-radius:15px!important;
    background:rgba(255,255,255,.97)!important;
    color:var(--v78-navy)!important;
    box-shadow:0 10px 24px rgba(18,42,74,.13)!important;
    backdrop-filter:blur(16px)!important;
    -webkit-backdrop-filter:blur(16px)!important;
  }
  body.v78-showcase #v78MobileBuilder>div{
    display:flex!important;
    align-items:baseline!important;
    min-width:0!important;
    gap:6px!important;
  }
  body.v78-showcase #v78MobileBuilder strong{
    color:var(--v78-navy)!important;
    font-size:13px!important;
    white-space:nowrap!important;
  }
  body.v78-showcase #v78MobileBuilder span{
    margin:0!important;
    color:#7a8b9e!important;
    font-size:11px!important;
    white-space:nowrap!important;
  }
  body.v78-showcase #v78MobileBuilder button{
    flex:0 0 auto!important;
    min-height:38px!important;
    height:38px!important;
    padding:6px 11px!important;
    border-radius:11px!important;
    font-size:13px!important;
    box-shadow:none!important;
  }
  body.v78-showcase.v78-has-builder main{
    padding-bottom:calc(132px + env(safe-area-inset-bottom,0px))!important;
  }

  /* ----- Bottom nav: lighter and visually separate from builder ----- */
  body.v78-showcase #p2PrimaryNav{
    left:12px!important;
    right:12px!important;
    height:68px!important;
    border-radius:17px!important;
    border-color:#dce5ef!important;
    box-shadow:0 8px 24px rgba(18,42,74,.11)!important;
  }
  body.v78-showcase #p2PrimaryNav .p2-nav-button{
    min-height:58px!important;
    height:58px!important;
    border-radius:12px!important;
  }
  body.v78-showcase #p2PrimaryNav .p2-nav-button.active{
    background:#edf4ff!important;
    color:var(--v78-blue)!important;
  }

  /* ----- Players: evidence should be readable but not all-green ----- */
  body.v78-showcase #view-players .player-card{
    overflow:hidden!important;
  }
  body.v78-showcase #view-players .player-card-head{
    background:#fbfcfe!important;
    padding:11px 12px!important;
  }
  body.v78-showcase #view-players .player-jersey{
    background:linear-gradient(145deg,#165bce,#2879ff)!important;
  }
  body.v78-showcase #view-players .player-risk-strip{
    background:#f7fafc!important;
    color:#667a91!important;
    border-color:#e8edf3!important;
  }
  body.v78-showcase #view-players .recent-cell{
    min-height:48px!important;
    border:1px solid transparent!important;
    border-radius:10px!important;
  }
  body.v78-showcase #view-players .recent-cell.hit{
    background:#e9f7f1!important;
    border-color:#d4eee3!important;
    color:#0c7c57!important;
  }
  body.v78-showcase #view-players .recent-cell.miss{
    background:#fff0f2!important;
    border-color:#f6d8dc!important;
    color:#b33c49!important;
  }
  body.v78-showcase #view-players .recent-cell b,
  body.v78-showcase #view-players .recent-cell small{color:inherit!important}
  body.v78-showcase #view-players .player-context-details{
    background:#f8fafc!important;
  }
  body.v78-showcase #view-players .player-market-footer .add-leg{
    background:var(--v78-blue)!important;
    color:#fff!important;
    border-radius:11px!important;
    box-shadow:none!important;
  }

  /* Decision-speed scanner belongs to the same blue system. */
  body.v78-showcase #view-players .p1d-mode-tabs button{
    border:1px solid #dfe6ef!important;
    background:#fff!important;
    color:#566b83!important;
    border-radius:11px!important;
  }
  body.v78-showcase #view-players .p1d-mode-tabs button.active{
    border-color:#bdd3ff!important;
    background:#edf4ff!important;
    color:var(--v78-blue)!important;
  }
  body.v78-showcase #view-players .p1d-rank-card{
    border:1px solid #dfe6ef!important;
    border-radius:13px!important;
    background:#fff!important;
    color:var(--v78-navy)!important;
    box-shadow:none!important;
  }
  body.v78-showcase #view-players .p1d-rank-card[data-p1d-rank="1"]{
    border-color:#b9d1ff!important;
    box-shadow:inset 3px 0 0 var(--v78-blue)!important;
  }
  body.v78-showcase #view-players .p1d-rank-tag{
    background:#edf4ff!important;
    color:var(--v78-blue)!important;
  }

  /* ----- System Multi: neutral evidence + semantic accents ----- */
  body.v78-showcase #view-system-multi .system-results-toolbar{
    background:rgba(255,255,255,.985)!important;
  }
  body.v78-showcase #view-system-multi .multi-card{
    background:#fff!important;
    border-color:#dfe6ef!important;
  }
  body.v78-showcase #view-system-multi .multi-card:before{
    height:3px!important;
    background:linear-gradient(90deg,#1769ff,#78aaff)!important;
  }
  body.v78-showcase #view-system-multi .multi-leg{
    background:#f8fafc!important;
    border:1px solid #e4eaf1!important;
    border-radius:11px!important;
  }
  body.v78-showcase #view-system-multi .market-chip{
    background:#edf4ff!important;
    color:#1769ff!important;
  }
  body.v78-showcase #view-system-multi .leg-role{
    background:#eef7f3!important;
    color:#147553!important;
  }
  body.v78-showcase #view-system-multi .p1d-multi-intel{
    display:grid!important;
    gap:6px!important;
  }
  body.v78-showcase #view-system-multi .p1d-multi-intel>div,
  body.v78-showcase #view-system-multi .p1d-multi-intel>section{
    border-color:#e1e7ef!important;
    background:#fbfcfe!important;
    border-radius:11px!important;
  }
  body.v78-showcase #view-system-multi .send-builder{
    background:var(--v78-blue)!important;
    color:#fff!important;
    border-radius:11px!important;
  }

  /* ----- Multi Lab + Match Markets: less oversized, same card rhythm ----- */
  body.v78-showcase #view-multi-lab .builder-grid>.panel{
    border-radius:14px!important;
  }
  body.v78-showcase #view-multi-lab .builder-leg{
    background:#fff!important;
    border-color:#dfe6ef!important;
    border-radius:11px!important;
  }
  body.v78-showcase #view-multi-lab #builderSummary .stat{
    background:#f8fafc!important;
    border-color:#e1e7ef!important;
    border-radius:11px!important;
  }
  body.v78-showcase #view-multi-lab .builder-value{
    background:#fbfcfe!important;
    border-color:#dfe6ef!important;
    border-radius:12px!important;
  }

  body.v78-showcase #view-multi-lab .match-leg-box{
    margin-top:8px!important;
    padding:12px!important;
  }
  body.v78-showcase #view-multi-lab .match-leg-box-head{
    margin-bottom:10px!important;
    gap:8px!important;
  }
  body.v78-showcase #view-multi-lab .match-leg-box-head h3{
    margin:2px 0 0!important;
    font-size:20px!important;
    line-height:1.15!important;
  }
  body.v78-showcase #view-multi-lab .match-leg-box-head small{
    font-size:11px!important;
    color:#7a8b9e!important;
  }
  body.v78-showcase #view-multi-lab .match-leg-choice-grid{
    gap:8px!important;
  }
  body.v78-showcase #view-multi-lab .match-leg-choice{
    min-height:82px!important;
    padding:10px 11px!important;
    border:1px solid #dfe6ef!important;
    border-radius:12px!important;
    background:#fff!important;
    color:var(--v78-navy)!important;
    box-shadow:none!important;
  }
  body.v78-showcase #view-multi-lab .match-leg-choice:hover,
  body.v78-showcase #view-multi-lab .match-leg-choice:focus{
    border-color:#bad1ff!important;
    background:#f7faff!important;
  }
  body.v78-showcase #view-multi-lab .match-leg-choice strong,
  body.v78-showcase #view-multi-lab .match-leg-choice b{
    color:var(--v78-navy)!important;
  }
  body.v78-showcase #view-multi-lab .match-leg-choice small{
    color:#7a8b9e!important;
  }
  body.v78-showcase #view-multi-lab .total-box .model-midline,
  body.v78-showcase #view-multi-lab .handicap-box .model-midline{
    font-size:12px!important;
    line-height:1.35!important;
    color:#718399!important;
  }
  body.v78-showcase #view-multi-lab .market-range{
    margin:10px 0 4px!important;
  }
  body.v78-showcase #view-multi-lab .market-range-labels{
    margin-bottom:8px!important;
    font-size:11px!important;
  }
  body.v78-showcase #view-multi-lab .independent-handicap-grid{
    gap:8px!important;
  }
  body.v78-showcase #view-multi-lab .handicap-team-card{
    padding:10px!important;
    border:1px solid #dfe6ef!important;
    border-radius:12px!important;
    background:#fbfcfe!important;
  }

  /* ----- More drawer: same card surfaces, semantic green only for system health ----- */
  body.v78-showcase #p2MoreDrawer .p2-drawer-item{
    background:#f8fafc!important;
    border-color:#e1e7ef!important;
  }
  body.v78-showcase #p2MoreDrawer .p2-drawer-item .p2-mini-icon{
    color:var(--v78-blue)!important;
  }
}

/* Slightly narrower iPhone tuning. */
@media(max-width:390px){
  body.v78-showcase #matchSummary{
    grid-template-columns:minmax(0,.88fr) minmax(132px,1.24fr) minmax(0,.88fr)!important;
  }
  body.v78-showcase #matchSummary .team-name{font-size:15px!important}
  body.v78-showcase #matchSummary .match-mid strong{font-size:16px!important}
  body.v78-showcase.v78-has-builder #v78MobileBuilder{
    left:12px!important;
    right:12px!important;
  }
}


/* v78.7 — Mobile refinement: density, alignment, overlap fixes */
@media(max-width:430px){

  /* ---------- Top Player Edges: eliminate probability/title overlap ---------- */
  body.v78-showcase .top-edges-panel .top-leg{
    display:grid!important;
    grid-template-columns:78px minmax(0,1fr) 106px!important;
    grid-template-rows:auto auto auto!important;
    column-gap:9px!important;
    row-gap:3px!important;
    align-items:center!important;
    min-height:92px!important;
    padding:11px!important;
  }
  body.v78-showcase .top-edges-panel .top-leg .p{
    grid-column:1!important;
    grid-row:1/3!important;
    align-self:center!important;
    justify-self:start!important;
    margin:0!important;
    font-size:20px!important;
    line-height:1!important;
    white-space:nowrap!important;
  }
  body.v78-showcase .top-edges-panel .top-leg .sel{
    grid-column:2!important;
    grid-row:1!important;
    min-width:0!important;
    align-self:end!important;
    font-size:14px!important;
    line-height:1.18!important;
    overflow-wrap:anywhere!important;
  }
  body.v78-showcase .top-edges-panel .top-leg .meta{
    grid-column:2!important;
    grid-row:2!important;
    min-width:0!important;
    align-self:start!important;
    font-size:11px!important;
    line-height:1.3!important;
    overflow-wrap:anywhere!important;
  }
  body.v78-showcase .top-edges-panel .top-leg .add-leg{
    grid-column:3!important;
    grid-row:1/3!important;
    align-self:center!important;
    justify-self:stretch!important;
    width:100%!important;
    min-width:0!important;
    min-height:40px!important;
    margin:0!important;
    padding:7px 6px!important;
    font-size:11px!important;
    line-height:1.1!important;
    text-align:center!important;
  }
  body.v78-showcase .top-edges-panel .top-leg .confidence-row,
  body.v78-showcase .top-edges-panel .top-leg .risk-row{
    grid-column:1/-1!important;
    grid-row:3!important;
    margin-top:5px!important;
  }

  /* ---------- Player Markets footer: compact context + CTA ---------- */
  body.v78-showcase #view-players .player-market-footer{
    grid-template-columns:minmax(0,1fr) 126px!important;
    gap:8px!important;
    align-items:center!important;
    padding:9px 10px!important;
  }
  body.v78-showcase #view-players .player-context-details summary{
    min-height:40px!important;
    padding:7px 9px!important;
    font-size:0!important;
    white-space:nowrap!important;
    overflow:hidden!important;
  }
  body.v78-showcase #view-players .player-context-details summary::before{
    content:"上下文";
    font-size:12px!important;
    color:#63758b!important;
    font-weight:850!important;
  }
  body.v78-showcase #view-players .player-context-details summary>b{
    margin-left:auto!important;
    font-size:11px!important;
  }
  body.v78-showcase #view-players .player-context-details summary:after{
    font-size:15px!important;
  }
  body.v78-showcase #view-players .player-market-footer .add-leg{
    width:126px!important;
    min-width:126px!important;
    height:42px!important;
    padding:6px 8px!important;
    font-size:12px!important;
    line-height:1.15!important;
    white-space:normal!important;
  }

  /* Recent evidence: slightly less tall, more consistent with card rhythm. */
  body.v78-showcase #view-players .recent-cell{
    min-height:44px!important;
    padding:5px 3px!important;
  }
  body.v78-showcase #view-players .recent-cell b{font-size:12px!important}
  body.v78-showcase #view-players .recent-cell small{
    font-size:9px!important;
    line-height:1.05!important;
  }

  /* ---------- Match Markets: reduce vertical drag ---------- */
  body.v78-showcase #view-multi-lab .match-leg-box{
    margin-top:6px!important;
    padding:10px!important;
  }
  body.v78-showcase #view-multi-lab .match-leg-box-head{
    margin-bottom:8px!important;
  }
  body.v78-showcase #view-multi-lab .match-leg-box-head h3{
    font-size:18px!important;
  }
  body.v78-showcase #view-multi-lab .match-leg-choice-grid{
    gap:7px!important;
  }
  body.v78-showcase #view-multi-lab .match-leg-choice{
    min-height:68px!important;
    padding:8px 10px!important;
  }
  body.v78-showcase #view-multi-lab .match-leg-choice .choice-kicker,
  body.v78-showcase #view-multi-lab .match-leg-choice .choice-market{
    font-size:11px!important;
  }
  body.v78-showcase #view-multi-lab .match-leg-choice .choice-team,
  body.v78-showcase #view-multi-lab .match-leg-choice>b{
    font-size:15px!important;
    line-height:1.2!important;
  }
  body.v78-showcase #view-multi-lab .match-leg-choice>strong{
    font-size:16px!important;
  }
  body.v78-showcase #view-multi-lab .match-leg-choice small{
    margin-top:3px!important;
    font-size:11px!important;
    line-height:1.3!important;
  }
  body.v78-showcase #view-multi-lab .total-box .model-midline,
  body.v78-showcase #view-multi-lab .handicap-box .model-midline{
    font-size:11px!important;
  }
  body.v78-showcase #view-multi-lab .market-range{
    margin:8px 0 3px!important;
  }
  body.v78-showcase #view-multi-lab .market-range-labels{
    margin-bottom:6px!important;
  }

  /* ---------- System Multi: slightly denser recommendation cards ---------- */
  body.v78-showcase #view-system-multi .multi-top{
    padding:9px 10px 7px!important;
  }
  body.v78-showcase #view-system-multi .multi-legs{
    padding:7px 9px!important;
    gap:5px!important;
  }
  body.v78-showcase #view-system-multi .multi-leg{
    padding:7px 8px!important;
  }
  body.v78-showcase #view-system-multi .multi-metrics{
    padding:0 9px 7px!important;
  }
  body.v78-showcase #view-system-multi .p1d-multi-intel{
    margin-top:7px!important;
    padding-top:7px!important;
  }
  body.v78-showcase #view-system-multi .p1d-intel-cell{
    padding:8px 9px!important;
  }

  /* ---------- Floating builder: slimmer, lighter, less content obstruction ---------- */
  body.v78-showcase.v78-has-builder #v78MobileBuilder{
    left:18px!important;
    right:18px!important;
    bottom:calc(74px + env(safe-area-inset-bottom,0px))!important;
    min-height:44px!important;
    height:44px!important;
    padding:4px 5px 4px 10px!important;
    border-radius:13px!important;
    box-shadow:0 8px 20px rgba(18,42,74,.10)!important;
  }
  body.v78-showcase #v78MobileBuilder strong{
    font-size:12px!important;
  }
  body.v78-showcase #v78MobileBuilder span{
    font-size:10px!important;
  }
  body.v78-showcase #v78MobileBuilder button{
    min-height:34px!important;
    height:34px!important;
    padding:5px 10px!important;
    border-radius:9px!important;
    font-size:12px!important;
  }
  body.v78-showcase.v78-has-builder main{
    padding-bottom:calc(120px + env(safe-area-inset-bottom,0px))!important;
  }

  /* ---------- Bottom nav: one notch lighter ---------- */
  body.v78-showcase #p2PrimaryNav{
    left:14px!important;
    right:14px!important;
    height:64px!important;
    bottom:calc(6px + env(safe-area-inset-bottom,0px))!important;
    border-radius:16px!important;
  }
  body.v78-showcase #p2PrimaryNav .p2-nav-button{
    min-height:54px!important;
    height:54px!important;
  }
  body.v78-showcase #p2PrimaryNav .p2-nav-icon{
    width:28px!important;
    height:28px!important;
  }
  body.v78-showcase #p2PrimaryNav .p2-nav-icon svg{
    width:22px!important;
    height:22px!important;
    min-width:22px!important;
    min-height:22px!important;
  }
  body.v78-showcase #p2PrimaryNav .p2-nav-copy strong{
    font-size:11px!important;
  }
}

@media(max-width:390px){
  body.v78-showcase .top-edges-panel .top-leg{
    grid-template-columns:72px minmax(0,1fr) 98px!important;
    column-gap:7px!important;
  }
  body.v78-showcase .top-edges-panel .top-leg .p{font-size:19px!important}
  body.v78-showcase .top-edges-panel .top-leg .sel{font-size:13px!important}
  body.v78-showcase .top-edges-panel .top-leg .add-leg{font-size:10.5px!important}
  body.v78-showcase #view-players .player-market-footer{
    grid-template-columns:minmax(0,1fr) 116px!important;
  }
  body.v78-showcase #view-players .player-market-footer .add-leg{
    width:116px!important;
    min-width:116px!important;
    font-size:11px!important;
  }
}


/* v78.8 — Mobile structural cleanup: Field + expanded Player context */
@media(max-width:700px){
  /* Field board: one team at a time on phone; keep the oval readable. */
  body.v78-showcase #matchFieldTeams .lineup-team-filters{
    width:100%!important;
    min-width:0!important;
    max-width:360px!important;
    margin:0 auto 6px!important;
    padding:3px!important;
    border-radius:12px!important;
    background:#f2f5f8!important;
  }
  body.v78-showcase #matchFieldTeams .lineup-team-filters button[data-team="all"],
  body.v78-showcase #matchFieldTeams .lineup-team-filters button[data-team="all"] + .filter-divider{
    display:none!important;
  }
  body.v78-showcase #matchFieldTeams .lineup-team-filters button{
    min-height:40px!important;
    padding:7px 10px!important;
    border-radius:9px!important;
    background:transparent!important;
    color:#607287!important;
    font-size:13px!important;
  }
  body.v78-showcase #matchFieldTeams .lineup-team-filters button.active{
    background:#edf4ff!important;
    color:var(--v78-blue)!important;
    box-shadow:inset 0 0 0 1px #c9dbff!important;
  }
  body.v78-showcase #matchFieldTeams .filter-divider{background:#dbe3ec!important}

  body.v78-showcase #matchFieldTeams .lineup-team-legend{
    gap:12px!important;
    margin-bottom:5px!important;
  }
  body.v78-showcase #matchFieldTeams .legend-team{
    font-size:12px!important;
    gap:5px!important;
  }
  body.v78-showcase #matchFieldTeams .legend-team.dim{display:none!important}

  body.v78-showcase #matchFieldTeams .overlay-afl-field{
    width:min(100%,360px)!important;
    max-width:360px!important;
    aspect-ratio:.80!important;
    margin:0 auto!important;
  }
  body.v78-showcase #matchFieldTeams .overlay-position-roster.single-team{
    inset:10% 7%!important;
    row-gap:2%!important;
  }
  body.v78-showcase #matchFieldTeams .overlay-position-roster.single-team>.position-row{
    margin-left:0!important;
    margin-right:0!important;
    grid-template-columns:24px minmax(0,1fr)!important;
    gap:4px!important;
  }
  body.v78-showcase #matchFieldTeams .overlay-position-roster.single-team .position-three{
    gap:5px!important;
  }
  body.v78-showcase #matchFieldTeams .overlay-position-roster.single-team .position-label{
    width:24px!important;
    min-width:24px!important;
    height:28px!important;
    font-size:9px!important;
    border-radius:6px!important;
  }
  body.v78-showcase #matchFieldTeams .overlay-position-roster.single-team .lineup-player-card{
    height:36px!important;
    min-height:36px!important;
    padding:4px 5px!important;
    border-radius:9px!important;
    background:rgba(255,255,255,.97)!important;
    box-shadow:0 2px 7px rgba(20,40,60,.11)!important;
  }
  body.v78-showcase #matchFieldTeams .overlay-position-roster.single-team .lineup-player-card strong{
    font-size:10px!important;
    line-height:1.05!important;
    text-align:left!important;
  }

  /* Followers / Interchanges become compact supporting lists below the field. */
  body.v78-showcase #matchFieldTeams .lineup-main-grid.overlay-field-mode{
    gap:8px!important;
  }
  body.v78-showcase #matchFieldTeams .lineup-main-grid.overlay-field-mode .lineup-side{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:6px!important;
    padding:8px 0 0!important;
  }
  body.v78-showcase #matchFieldTeams .lineup-main-grid.overlay-field-mode .lineup-side h3{
    margin:0 0 3px!important;
    text-align:left!important;
    font-size:14px!important;
  }
  body.v78-showcase #matchFieldTeams .side-team-block{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:6px!important;
  }
  body.v78-showcase #matchFieldTeams .side-team-block .lineup-player-card{
    height:38px!important;
    padding:5px 7px!important;
    border-radius:9px!important;
    font-size:11px!important;
  }

  /* The page already has the global Multi utility / LAB badge; remove the legacy field-only builder. */
  body.v78-showcase #matchFieldTeams .lineup-builder-float{
    display:none!important;
  }

  body.v78-showcase #matchFieldTeams .emergency-strip{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:6px!important;
    padding-top:10px!important;
  }
  body.v78-showcase #matchFieldTeams .emergency-strip>span{
    grid-column:1/-1!important;
    margin:0!important;
    font-size:12px!important;
  }
  body.v78-showcase #matchFieldTeams .emergency-strip .lineup-player-card{
    width:100%!important;
    min-width:0!important;
    height:38px!important;
    font-size:11px!important;
    border-radius:9px!important;
  }
}

@media(max-width:430px){
  /* Expanded Player context should occupy the full card width instead of a narrow left rail. */
  body.v78-showcase #view-players .player-market-footer:has(.player-context-details[open]){
    grid-template-columns:1fr!important;
    align-items:stretch!important;
    gap:8px!important;
  }
  body.v78-showcase #view-players .player-market-footer:has(.player-context-details[open]) .player-context-details{
    grid-column:1/-1!important;
    width:100%!important;
  }
  body.v78-showcase #view-players .player-context-details[open] summary{
    min-height:38px!important;
    border-bottom:1px solid #e7ecf2!important;
  }
  body.v78-showcase #view-players .player-context-details[open] .context-line{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:6px!important;
    padding:8px!important;
    font-size:11px!important;
  }
  body.v78-showcase #view-players .player-context-details[open] .context-line>span{
    min-width:0!important;
    padding:7px!important;
    border-radius:8px!important;
    background:#f7f9fc!important;
    color:#53677f!important;
    overflow-wrap:anywhere!important;
  }
  body.v78-showcase #view-players .player-context-details[open] .context-line .role-line{
    grid-column:1/-1!important;
  }
  body.v78-showcase #view-players .player-market-footer:has(.player-context-details[open]) .add-leg{
    grid-column:1/-1!important;
    justify-self:stretch!important;
    width:100%!important;
    min-width:0!important;
    height:42px!important;
  }
}
