/* Lion AI Cloud — Nexus KPI layout hotfix v1.0 (candidate). CSS only, scoped to html[data-skin=nexus] dashboard KPI cards.
   Root cause: lac-motion-v1 (R8.5.2) draws .lm-ring / .lm-spark / .lm-mini with position:absolute at the bottom-right/bottom
   of each card, while nexus-premium-v1 keeps .nx-metric-icon absolute at the top-right. In the narrow 3/6-column grid (all skins)
   they land on the subtitle and on each other. Here every graphic gets its own grid cell instead. */
html[data-skin] body #appView #view-dashboard .prime-v2-kpi{
  display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;grid-auto-rows:auto;
  align-items:start!important;justify-items:start;column-gap:14px!important;row-gap:4px!important;min-height:132px}
html[data-skin] body #appView #view-dashboard .prime-v2-kpi>label{grid-column:1;grid-row:1;align-self:center;max-width:100%!important}
html[data-skin] body #appView #view-dashboard .prime-v2-kpi>strong{grid-column:1;grid-row:2;margin:6px 0 2px!important}
html[data-skin] body #appView #view-dashboard .prime-v2-kpi>small{grid-column:1;grid-row:3;margin:0!important}
html[data-skin] body #appView #view-dashboard .prime-v2-kpi>.nx-metric-icon{position:relative!important;inset:auto!important;grid-column:2;grid-row:1;justify-self:end;margin:0!important}
/* CPU/RAM: ring takes the right column under the icon, never over it */
html[data-skin] body #appView #view-dashboard .prime-v2-kpi>.lm-ring{position:relative!important;inset:auto!important;grid-column:2;grid-row:2 / span 2;justify-self:end;align-self:center;width:58px!important;height:58px!important;margin:0!important}
html[data-skin] body #appView #view-dashboard .prime-v2-kpi.lm-has-ring>.nx-metric-icon{display:none!important}
html[data-skin] body #appView #view-dashboard .prime-v2-kpi.lm-has-ring>.lm-ring{grid-row:1 / span 3}
/* sparkline: own full-width row under the subtitle */
html[data-skin] body #appView #view-dashboard .prime-v2-kpi>.lm-spark{position:relative!important;inset:auto!important;grid-column:1 / -1;grid-row:4;justify-self:stretch;width:100%!important;height:30px!important;margin-top:8px}
/* mini visuals (node pills, hexagons, request split, latency scale): own full-width row */
html[data-skin] body #appView #view-dashboard .prime-v2-kpi>.lm-mini{position:relative!important;inset:auto!important;grid-column:1 / -1;grid-row:5;justify-self:stretch;max-width:100%!important;width:100%!important;min-width:0!important;margin-top:8px}
html[data-skin] body #appView #view-dashboard .prime-v2-kpi>.lm-mini.lm-mini-nodes,
html[data-skin] body #appView #view-dashboard .prime-v2-kpi>.lm-mini.lm-mini-models{justify-content:flex-start!important}
html[data-skin] body #appView #view-dashboard .prime-v2-kpi .lm-scale-legend{padding:0 2px}
html[data-skin] body #appView #view-dashboard .prime-v2-kpi .lm-split-legend span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
/* background fx layer stays a full-card overlay behind content */
html[data-skin] body #appView #view-dashboard .prime-v2-kpi>.lm-fx{position:absolute!important;inset:0!important;grid-area:auto}
@media (max-width:720px){
  html[data-skin] body #appView #view-dashboard .prime-v2-kpi{min-height:0;column-gap:8px!important}
  html[data-skin] body #appView #view-dashboard .prime-v2-kpi>.lm-ring{width:46px!important;height:46px!important}
  html[data-skin] body #appView #view-dashboard .prime-v2-kpi>.nx-metric-icon{width:28px!important;height:28px!important}
}
/* Gateway Analytics: skins draw a decorative sparkline as .gw-card::after (bottom-right, 22px high) under the subtitle text;
   reserve a bottom lane for it so the text never sits on top of it. */
html[data-skin] body #appView #view-gateway .gw-card{padding-bottom:40px!important}
@media (max-width:680px){html[data-skin] body #appView #view-gateway .gw-card{padding-bottom:38px!important}}
/* Stat boxes on Hub / Nodes / Firewall (lac-motion .lm-box): the orbit sits top-right and the live spark fills the bottom 40%
   behind the text. Reserve a right lane for the orbit and a bottom lane for a slimmer spark. */
html[data-skin] body #appView .lm-box{padding-right:74px!important;padding-bottom:36px!important}
html[data-skin] body #appView .lm-box>.lm-viz .lm-bspark{height:26px!important;bottom:4px!important;top:auto!important}
@media (max-width:720px){html[data-skin] body #appView .lm-box{padding-bottom:34px!important}}
html[data-skin] body #appView .lm-box>:not(.lm-fx):not(.lm-viz){min-width:0!important;max-width:100%!important;overflow-wrap:anywhere}
html[data-skin] body #appView .lm-box>:not(.lm-fx):not(.lm-viz) *{min-width:0;overflow-wrap:anywhere}
html[data-skin] body #appView .lm-box .lm-val,html[data-skin] body #appView .skfw-tile b{font-size:min(1em,100%)}
/* Aurora draws a small icon as .eh-kpi::after at the top-right; drop the orbit below it. */
html[data-skin="aurora"] body #appView #enterpriseRoot .eh-kpi>.lm-viz .lm-orbit{top:42px!important}
/* Enterprise Hub KPIs: decorative ::after sparkline sits under the subtitle; reserve its lane. */
html[data-skin] body #appView #enterpriseRoot .eh-kpi{padding-bottom:40px!important}
/* Aurora keeps its decorative KPI ::after sparkline; on ring cards it lands under the live ring, so drop it there. */
html[data-skin="aurora"].lm-ready body #appView #view-dashboard .prime-v2-kpi.lm-has-ring::after{display:none!important}

/* R9 UI fix: dashboard shortcut cards: the arrow no longer sits on top of the subtitle (reserved right gutter) */
html body #view-dashboard .prime-v2-shortcuts>button{position:relative!important;padding-right:34px!important}
html body #view-dashboard .prime-v2-shortcuts>button em{position:absolute!important;right:12px!important;top:50%!important;bottom:auto!important;transform:translateY(-50%);grid-column:auto!important;grid-row:auto!important;margin:0!important}
html.lm-on body #view-dashboard .prime-v2-shortcuts>button:hover em{transform:translate(4px,-50%)}
