/*
 * MarcoVPN Stage252
 * Mobile interaction, viewport and accessibility refinement.
 *
 * This layer continues Stage250 and Stage251. It uses real dimensions,
 * responsive layout rules and dynamic viewport measurements. It does not use
 * zoom, transform: scale() or any root-level visual shrinking technique.
 */

:root {
  --mv252-visual-height: 100dvh;
  --mv252-topbar-bottom: 62px;
  --mv252-drawer-gap: 8px;
  --mv252-focus-color: #66ccff;
}

.mv_skip_link {
  position: fixed;
  top: -80px;
  left: max(8px, env(safe-area-inset-left));
  z-index: 1600;
  padding: 9px 12px;
  border: 2px solid var(--mv252-focus-color);
  border-radius: 5px;
  color: #ffffff;
  background: #11151b;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}

.mv_skip_link:focus {
  top: max(8px, env(safe-area-inset-top));
}

.mv_public_main,
#mv_main_content {
  min-width: 0;
  max-width: 100%;
}

#mv_main_content {
  scroll-margin-top: calc(var(--mv252-topbar-bottom) + 12px);
}

#mv_main_content:focus {
  outline: none;
}

:where(
  a,
  button,
  input,
  select,
  textarea,
  summary,
  [tabindex]:not([tabindex="-1"])
):focus-visible {
  outline: 2px solid var(--mv252-focus-color) !important;
  outline-offset: 2px !important;
}

.mv_burger,
.mv_sidebar_toggle,
.mv_modal_close,
.mv_toast_close,
.mv_icon_btn,
.mv_scroll_top {
  -webkit-tap-highlight-color: transparent;
}

/* The page is locked by JavaScript without losing its current scroll offset. */
body.mv_scroll_locked {
  width: 100%;
  overflow: hidden !important;
}

@media (max-width: 1100px) {
  body.menu_open,
  body.sidebar_open,
  body.modal_open {
    overflow: hidden;
    touch-action: auto !important;
  }

  .mv_nav,
  body.mv_body_public .mv_nav,
  .mv_sidebar {
    top: calc(var(--mv252-topbar-bottom) + var(--mv252-drawer-gap)) !important;
    bottom: auto !important;
    max-height: calc(
      var(--mv252-visual-height) - var(--mv252-topbar-bottom) -
        var(--mv252-drawer-gap) - max(8px, env(safe-area-inset-bottom))
    ) !important;
    overflow-y: auto !important;
    touch-action: pan-y pinch-zoom;
    -webkit-overflow-scrolling: touch;
  }

  .mv_mobile_dashbar {
    top: calc(var(--mv252-topbar-bottom) + 4px) !important;
  }

  .mv_burger,
  .mv_sidebar_toggle {
    min-width: 42px !important;
    width: 42px !important;
    min-height: 42px !important;
    height: 42px !important;
  }

  .mv_topnav_link,
  .mv_nav_btn,
  .mv_lang_button,
  body.mv_body_public .mv_topnav_link,
  body.mv_body_public .mv_nav_btn,
  body.mv_body_public .mv_lang_button {
    min-height: 40px !important;
    padding: 7px 9px !important;
    font-size: 12px !important;
  }

  .mv_sidebar a {
    min-height: 38px;
    padding: 8px 9px;
    font-size: 12px;
  }

  .mv_nav,
  .mv_sidebar,
  .mv_lang_menu {
    scrollbar-width: thin;
  }
}

/* A focused input must not trigger automatic page zoom in mobile Safari. */
@media (max-width: 760px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  select,
  textarea {
    min-height: 44px;
    font-size: 16px !important;
    line-height: 1.35;
  }

  textarea {
    line-height: 1.5;
  }

  .mv_password_toggle {
    min-height: 40px;
    font-size: 12px !important;
  }

  .mv_table.mv_table_responsive_ready td {
    grid-template-columns: minmax(92px, 38%) minmax(0, 1fr);
    gap: 8px;
    font-size: 12px;
  }

  .mv_table.mv_table_responsive_ready td::before {
    font-size: 10px;
    line-height: 1.35;
  }

  .mv_mobile_dashboard_nav_link {
    min-height: 48px !important;
  }

  .mv_mobile_dashboard_nav_link b {
    max-height: 2.35em;
    overflow: hidden;
    font-size: 10px !important;
    line-height: 1.15;
    text-overflow: clip;
    white-space: normal;
  }

  .mv_footer_links_wrap {
    display: grid;
    gap: 8px;
    min-width: 0;
  }

  body.mv_ui_ready .mv_footer_links_wrap:not(.is_expanded) .mv_footer_links {
    position: relative;
    max-height: 176px !important;
    padding-right: 0;
    overflow: hidden !important;
  }

  body.mv_ui_ready .mv_footer_links_wrap:not(.is_expanded)::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 42px;
    left: 0;
    height: 54px;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(9, 11, 15, 0), rgba(9, 11, 15, 0.96));
  }

  body.mv_ui_ready .mv_footer_links_wrap.is_expanded .mv_footer_links {
    max-height: none !important;
    overflow: visible !important;
  }

  .mv_footer_links_toggle {
    display: none;
    position: relative;
    z-index: 1;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--mv-border);
    border-radius: 5px;
    color: var(--mv-text);
    background: #11151b;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
  }

  body.mv_ui_ready .mv_footer_links_toggle {
    display: inline-flex;
  }

  .mv_footer_links_toggle i {
    font-style: normal;
    line-height: 1;
  }

  .mv_footer_links_wrap.is_expanded .mv_footer_links_toggle i {
    rotate: 180deg;
  }
}

/* Short landscape viewports need denser drawers without losing scrolling. */
@media (max-width: 1100px) and (max-height: 560px) {
  .mv_nav,
  body.mv_body_public .mv_nav,
  .mv_sidebar {
    padding: 7px !important;
  }

  .mv_nav_primary,
  .mv_nav_actions,
  body.mv_body_public .mv_nav_primary,
  body.mv_body_public .mv_nav_actions {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-auto-rows: minmax(36px, auto);
  }

  .mv_topnav_link,
  .mv_nav_btn,
  .mv_lang_button,
  body.mv_body_public .mv_topnav_link,
  body.mv_body_public .mv_nav_btn,
  body.mv_body_public .mv_lang_button {
    min-height: 36px !important;
    padding-block: 5px !important;
  }

  .mv_lang_menu,
  body.mv_body_public .mv_lang_menu {
    max-height: 128px;
  }
}

/* Dialogs follow the visual viewport when the mobile keyboard is open. */
.mv_modal {
  max-height: var(--mv252-visual-height);
}

.mv_modal_card {
  max-height: calc(var(--mv252-visual-height) - 20px);
  touch-action: pan-y pinch-zoom;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
  .mv_modal_card {
    max-height: calc(var(--mv252-visual-height) - 12px);
  }
}

@media (prefers-contrast: more) {
  .mv_topbar,
  .mv_nav,
  .mv_sidebar,
  .mv_panel,
  .mv_card,
  .mv_feature_card,
  .mv_modal_card,
  .mv_footer_links_toggle {
    border-color: #707887 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mv_skip_link,
  .mv_footer_links_toggle i {
    transition: none !important;
  }
}
