/* V393 - Gross Sales OW comparison legend/tooltip. Scoped to the existing Home panel. */
#home #v239SalesPanel .v239-sales-chart-wrap{position:relative!important}
#home #v239SalesPanel .v239-sales-chart-wrap .v239-sales-legend{
  display:flex!important;position:absolute!important;top:5px!important;right:6px!important;bottom:auto!important;left:auto!important;
  gap:9px!important;align-items:center!important;flex-wrap:wrap!important;justify-content:flex-end!important;
  z-index:5!important;padding:4px 7px!important;border:1px solid rgba(172,199,217,.20)!important;
  border-radius:7px!important;background:rgba(1,9,17,.79)!important;max-width:calc(100% - 12px)!important;
  font-size:9px!important;color:#f3f5f7!important;line-height:1.1!important;
}
#home #v239SalesPanel .v239-sales-legend span{display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
#home #v239SalesPanel .v239-sales-dot{display:inline-block;width:9px;height:3px;border-radius:3px;flex:none}
#home #v239SalesPanel .v239-sales-dot.gross{background:#65e6d1;box-shadow:0 0 7px rgba(101,230,209,.5)}
#home #v239SalesPanel .v239-sales-dot.prev-week{background:#ffae45}
#home #v239SalesPanel .v239-sales-dot.prev-year{background:#fa6974}
#home #v239SalesPanel .v393-sales-tooltip{
  position:absolute;z-index:6;bottom:24px;left:8px;max-width:min(360px,calc(100% - 12px));
  padding:7px 10px;background:rgba(3,13,25,.97);border:1px solid rgba(255,211,125,.45);
  border-radius:9px;box-shadow:0 12px 30px rgba(0,0,0,.45);color:#f3f7fc;
  font:600 11px/1.4 Inter,Segoe UI,Arial,sans-serif;pointer-events:none;white-space:normal
}
#home #v239SalesPanel .v393-sales-tooltip[hidden]{display:none!important}
@media(max-width:650px){
  #home #v239SalesPanel .v239-sales-chart-wrap .v239-sales-legend{font-size:7.8px!important;gap:7px!important;padding:4px 5px!important;justify-content:flex-end!important}
  #home #v239SalesPanel .v393-sales-tooltip{font-size:10px;padding:6px 8px}
}
@media(max-width:360px){#home #v239SalesPanel .v239-sales-chart-wrap .v239-sales-legend{font-size:7px!important;gap:5px!important}}

/* V394 grouped-bar comparison: preserve the live dashboard layout. */
#home #v239SalesPanel .v239-sales-chart-wrap{min-height:155px!important}
#home #v239SalesPanel #v239SalesCanvas{touch-action:pan-y}
#home #v239SalesPanel .v239-sales-dot{height:8px!important;width:8px!important;border-radius:2px!important;box-shadow:none!important}
@media(max-width:650px){#home #v239SalesPanel .v239-sales-chart-wrap{min-height:175px!important}}

/* V396: Gross Sales panel is fixed at 286px by the Home layout.
   V395's 225px chart overflowed the panel; its bottom-anchored value labels were invisible.
   Reserve a chart size that fits the panel and keep full £ values within the visible canvas. */
body.dashboard-home #home #v239SalesPanel .v239-sales-chart-wrap{
  height:132px!important;min-height:132px!important;max-height:132px!important;
  box-sizing:border-box!important;overflow-x:auto!important;overflow-y:hidden!important;
  scrollbar-width:thin;scrollbar-color:rgba(242,202,102,.55) transparent;
}
body.dashboard-home #home #v239SalesPanel #v239SalesCanvas{
  display:block!important;width:100%!important;height:100%!important;touch-action:pan-y;
}
@media(max-width:650px){
  body.dashboard-home #home #v239SalesPanel .v239-sales-chart-wrap{
    height:150px!important;min-height:150px!important;max-height:150px!important;
    overflow:hidden!important;
  }
  body.dashboard-home #home #v239SalesPanel #v239SalesCanvas{
    min-width:0!important;width:100%!important;
  }
}


/* V397 mobile fit: keep all 7 day groups inside the card without horizontal clipping. */
@media(max-width:650px){
  #home #v239SalesPanel .v239-sales-chart-wrap .v239-sales-legend{font-size:7px!important;gap:5px!important;padding:3px 5px!important;right:5px!important;top:4px!important}
}
