/* Control ANDRIK 1.0 · v54.60 FINAL — layout fit, focus actions and push-safe UI. */

/* Admin panel heading: force true centering in the active swipe page. */
.control-home-page .control-menu-page .control-menu-heading{
  display:block!important;
  width:100%!important;
  max-width:none!important;
  margin:0 0 10px!important;
  padding:4px 0 8px!important;
  text-align:center!important;
}
.control-home-page .control-menu-page .control-menu-heading .control-admin-heading-copy{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  margin:0 auto!important;
  padding:0!important;
  text-align:center!important;
}
.control-home-page .control-menu-page .control-menu-heading .eyeline,
.control-home-page .control-menu-page .control-menu-heading h1{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  margin-left:auto!important;
  margin-right:auto!important;
  text-align:center!important;
}
.control-home-page .control-menu-page .control-menu-heading h1{
  margin-top:8px!important;
  white-space:nowrap!important;
  font-size:clamp(2rem,9.4vw,2.95rem)!important;
  line-height:1!important;
}

/* Give the map enough real scroll reserve above Android/browser controls. */
.analytics-v54-46-page .analytics-map-pane .analytics-map-pane-wrap{
  height:auto!important;
  min-height:100%!important;
  padding-bottom:calc(126px + env(safe-area-inset-bottom))!important;
}
.analytics-v54-46-page .analytics-map-pane{
  overflow-y:auto!important;
  -webkit-overflow-scrolling:touch!important;
  overscroll-behavior-y:contain!important;
}
.analytics-v54-46-page .analytics-map-pane .country-growth-toggle{
  position:relative!important;
  z-index:2!important;
  margin-bottom:4px!important;
}

/* Normal map overview is compact enough that the growth button is never cropped. */
@media(max-width:540px){
  .analytics-v54-46-page .analytics-map-pane .analytics-compact-header{margin-bottom:4px!important}
  .analytics-v54-46-page .analytics-map-pane .analytics-compact-header .eyeline{display:none!important}
  .analytics-v54-46-page .analytics-map-pane .analytics-compact-header h1{font-size:1.92rem!important;line-height:.96!important}
  .analytics-v54-46-page .analytics-map-pane .analytics-compact-header p{margin:3px 0 5px!important;font-size:.64rem!important}
  .analytics-v54-46-page .analytics-map-pane .analytics-auth-inline{min-height:32px!important;padding:5px 8px!important}
  .analytics-v54-46-page .analytics-map-pane .analytics-map-top:not(.has-country-focus){padding:9px!important}
  .analytics-v54-46-page .analytics-map-pane .analytics-map-top:not(.has-country-focus) h2{font-size:1.7rem!important}
  .analytics-v54-46-page .analytics-map-pane .analytics-map-top:not(.has-country-focus) p{font-size:.64rem!important}
  .analytics-v54-46-page .analytics-map-pane .analytics-map-top:not(.has-country-focus) .world-map-stage{aspect-ratio:3.28/1!important}
  .analytics-v54-46-page .analytics-map-pane .analytics-map-top:not(.has-country-focus) .world-country-button{min-height:32px!important;padding:4px 7px!important}
  .analytics-v54-46-page .analytics-map-pane .analytics-map-top:not(.has-country-focus) .world-country-toggle{min-height:33px!important;padding:5px 9px!important}
  .analytics-v54-46-page .analytics-map-pane .analytics-map-top:not(.has-country-focus) .country-growth-toggle{min-height:42px!important;margin-top:5px!important;font-size:.79rem!important}
}

/* Focused country: weekly figures stay on one horizontal line. */
.analytics-v54-46-page .world-country-list .world-country-button.is-selected .country-weekly-gain{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:8px!important;
  width:100%!important;
  min-width:0!important;
  margin:3px 0 0!important;
  font-size:clamp(.61rem,2.8vw,.76rem)!important;
  line-height:1.05!important;
  white-space:nowrap!important;
}
.analytics-v54-46-page .country-weekly-current{
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  color:#66efa1!important;
  text-align:left!important;
}
.analytics-v54-46-page .country-weekly-compare{
  min-width:0!important;
  margin:0!important;
  color:#66efa1!important;
  text-align:right!important;
}
.analytics-v54-46-page .country-weekly-compare.is-negative{color:#ff7f8a!important}
.analytics-v54-46-page .country-weekly-compare.is-flat{color:#a9c2cf!important}

/* Old plain shortcut is removed; focused mode gets a real two-button floating dock. */
.map-daily-shortcut{display:none!important}
.map-focus-actions{
  position:fixed;
  right:max(8px,env(safe-area-inset-right));
  bottom:calc(54px + env(safe-area-inset-bottom));
  z-index:2147482500;
  display:none;
  align-items:center;
  justify-content:flex-end;
  gap:7px;
  max-width:calc(100vw - 16px);
  pointer-events:none;
}
body[data-analytics-page="map"].is-country-focus-active .map-focus-actions{display:flex}
body:has(#countryGrowthPanel:not([hidden])) .map-focus-actions{display:none!important}
.map-focus-action{
  pointer-events:auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  min-height:40px;
  padding:0 12px;
  border:1px solid rgba(130,207,242,.34);
  border-radius:999px;
  background:rgba(8,31,44,.97);
  color:#e4f6ff;
  box-shadow:0 12px 30px rgba(0,0,0,.42),inset 0 0 0 1px rgba(255,255,255,.025);
  font:850 .72rem/1 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  text-decoration:none;
  white-space:nowrap;
  -webkit-tap-highlight-color:transparent;
}
.map-focus-action.is-activity{
  border-color:rgba(242,190,99,.34);
  background:rgba(49,34,12,.96);
  color:#ffe2a5;
}
.map-focus-action:active{transform:scale(.97)}
@media(max-width:390px){
  .map-focus-actions{right:5px;gap:5px}
  .map-focus-action{min-height:38px;padding:0 10px;font-size:.68rem}
}

/* Growth list remains independently scrollable on every browser. */
.country-growth-panel{
  overflow-y:auto!important;
  touch-action:pan-y!important;
  -webkit-overflow-scrolling:touch!important;
  overscroll-behavior-y:contain!important;
}
.country-growth-panel *{touch-action:pan-y!important}


/* v54.60 final hard overrides: exact centering and unobstructed map controls. */
.control-home-page .control-admin-menu-page .control-menu-heading,
.control-home-page .control-admin-menu-page .control-admin-heading-copy{
  box-sizing:border-box!important;
  position:relative!important;
  left:50%!important;
  transform:translateX(-50%)!important;
  width:100%!important;
  max-width:100%!important;
  align-self:stretch!important;
  justify-self:stretch!important;
  text-align:center!important;
}
.control-home-page .control-admin-menu-page .control-menu-heading .eyeline,
.control-home-page .control-admin-menu-page .control-menu-heading h1{
  width:max-content!important;
  max-width:100%!important;
  margin-left:auto!important;
  margin-right:auto!important;
  text-align:center!important;
}

/* Positive/negative weekly comparison in the full growth list. */
.country-growth-value small.is-positive{color:#66efa1!important}
.country-growth-value small.is-negative{color:#ff7f8a!important}
.country-growth-value small.is-flat{color:#a9c2cf!important}
body.is-country-growth-open .map-focus-actions{display:none!important}

/* Keep country actions above the browser bar and to the right, not under the pager. */
.map-focus-actions{
  right:max(9px,env(safe-area-inset-right))!important;
  bottom:calc(104px + env(safe-area-inset-bottom))!important;
  flex-direction:column!important;
  align-items:flex-end!important;
  gap:7px!important;
}
.map-focus-action{min-width:112px!important}

/* Compact overview: all controls, including weekly growth, fit before the bottom pager. */
@media(max-width:540px){
  .analytics-v54-46-page .analytics-map-pane .analytics-map-pane-wrap{
    padding-top:2px!important;
    padding-bottom:calc(108px + env(safe-area-inset-bottom))!important;
  }
  .analytics-v54-46-page .analytics-map-pane .analytics-compact-header{margin:0 0 3px!important}
  .analytics-v54-46-page .analytics-map-pane .analytics-compact-header .eyeline{display:none!important}
  .analytics-v54-46-page .analytics-map-pane .analytics-compact-header h1{font-size:1.72rem!important;line-height:.93!important}
  .analytics-v54-46-page .analytics-map-pane .analytics-compact-header p{margin:2px 0 4px!important;font-size:.59rem!important;line-height:1.15!important}
  .analytics-v54-46-page .analytics-map-pane .analytics-auth-inline{min-height:29px!important;padding:4px 7px!important;font-size:.59rem!important}
  .analytics-v54-46-page .analytics-map-pane .analytics-map-top:not(.has-country-focus){padding:7px!important;border-radius:20px!important}
  .analytics-v54-46-page .analytics-map-pane .analytics-map-top:not(.has-country-focus) .admin-card-title-row{margin-bottom:3px!important}
  .analytics-v54-46-page .analytics-map-pane .analytics-map-top:not(.has-country-focus) .eyeline{font-size:.56rem!important}
  .analytics-v54-46-page .analytics-map-pane .analytics-map-top:not(.has-country-focus) h2{font-size:1.55rem!important;line-height:.96!important;margin:3px 0!important}
  .analytics-v54-46-page .analytics-map-pane .analytics-map-top:not(.has-country-focus) p{font-size:.58rem!important;line-height:1.2!important;margin:0 0 4px!important}
  .analytics-v54-46-page .analytics-map-pane .analytics-map-top:not(.has-country-focus) .world-map-stage,
  .analytics-v54-46-page .analytics-map-pane .analytics-map-top:not(.has-country-focus) .world-map-canvas{aspect-ratio:3.7/1!important;min-height:0!important}
  .analytics-v54-46-page .analytics-map-pane .analytics-map-top:not(.has-country-focus) .world-country-list{gap:4px!important;margin-top:5px!important}
  .analytics-v54-46-page .analytics-map-pane .analytics-map-top:not(.has-country-focus) .world-country-button{min-height:29px!important;padding:3px 6px!important;border-radius:13px!important;font-size:.61rem!important}
  .analytics-v54-46-page .analytics-map-pane .analytics-map-top:not(.has-country-focus) .world-country-toggle{min-height:31px!important;padding:4px 8px!important;margin-top:4px!important;font-size:.62rem!important}
  .analytics-v54-46-page .analytics-map-pane .analytics-map-top:not(.has-country-focus) .country-growth-toggle{min-height:37px!important;margin-top:5px!important;padding:5px 9px!important;font-size:.71rem!important;line-height:1!important}
  .analytics-v54-46-page .analytics-map-pane .analytics-swipe-hint{margin-top:4px!important;font-size:.55rem!important}
}

/* Focus details: current week and comparison are forced into one row. */
.analytics-v54-46-page .analytics-map-pane .analytics-map-top.has-country-focus .country-weekly-gain{
  display:flex!important;
  flex-flow:row nowrap!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:8px!important;
  width:100%!important;
  white-space:nowrap!important;
}
.analytics-v54-46-page .analytics-map-pane .analytics-map-top.has-country-focus .country-weekly-current,
.analytics-v54-46-page .analytics-map-pane .analytics-map-top.has-country-focus .country-weekly-compare{
  display:block!important;
  flex:0 1 auto!important;
  white-space:nowrap!important;
  margin:0!important;
}
@media(max-width:390px){
  .analytics-v54-46-page .analytics-map-pane .analytics-map-top.has-country-focus .country-weekly-gain{gap:5px!important;font-size:.58rem!important}
  .map-focus-actions{right:6px!important;bottom:calc(98px + env(safe-area-inset-bottom))!important}
  .map-focus-action{min-width:104px!important}
}
