/* Public mobile layout only. Cabinet layouts and desktop styles stay intact. */
.site-mobile-call,
.site-mobile-menu-account { display: none; }

@media (max-width: 760px) {
  html:root body:has(header.site-header--search) {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }
  html:root { scroll-padding-bottom: 96px; }
  html:root body header.site-header.site-header--search {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 44px 44px !important;
    grid-template-rows: 44px auto;
    gap: 6px 8px;
    min-height: 0;
    padding: 8px 12px;
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(23, 50, 74, .08);
  }
  html:root body header.site-header.site-header--search .site-brand {
    grid-area: 1 / 1;
    min-width: 0;
    gap: 7px;
  }
  html:root body header.site-header.site-header--search .site-brand img {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
  }
  html:root body header.site-header.site-header--search .site-brand > span {
    min-width: 0;
  }
  html:root body header.site-header.site-header--search .site-brand strong {
    font-size: 16px;
    letter-spacing: -.3px;
    white-space: nowrap;
  }
  html:root body header.site-header.site-header--search .site-global-search {
    grid-area: 1 / 2;
    width: 44px;
    min-width: 0;
  }
  html:root body header.site-header.site-header--search .site-search-toggle {
    width: 44px;
    height: 44px;
    border-radius: 10px;
  }
  html:root body header.site-header.site-header--search .site-header-actions {
    display: none;
  }
  html:root body header.site-header.site-header--search .site-mobile-menu {
    grid-area: 1 / 3;
  }
  html:root body header.site-header.site-header--search .site-mobile-menu > summary {
    border-radius: 10px;
  }
  html:root body header.site-header.site-header--search .site-mobile-call {
    grid-area: 2 / 1 / 3 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    min-height: 34px;
    margin-top: 1px;
    border-top: 1px solid #e6efef;
    color: #087f78;
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
  }
  .site-mobile-call svg { width: 16px; height: 16px; flex: 0 0 16px; }
  .site-mobile-call small {
    padding-left: 8px;
    border-left: 1px solid #cfe4e2;
    color: #617889;
    font-size: 11px;
    font-weight: 450;
  }
  html:root body header.site-header.site-header--search .site-mobile-menu-panel {
    max-height: calc(100dvh - 140px);
    border-radius: 14px;
  }
  html:root body header.site-header.site-header--search .site-mobile-menu-panel .site-mobile-menu-account {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    background: #edf8f6;
    color: #087f78;
  }

  /* News scroll with the page; a single slim contact dock uses the bottom edge. */
  html:root body .portal-home-v3 { padding-bottom: 0; }
  html:root body .ph-live-russia-news {
    position: relative;
    inset: auto;
    margin-top: 24px;
    box-shadow: none;
  }
  html:root body .contact-float {
    box-sizing: border-box;
    left: 12px !important;
    right: 12px !important;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    width: calc(100% - 24px) !important;
    max-width: none !important;
    height: 64px;
    min-height: 64px;
    gap: 4px !important;
    padding: 8px !important;
    border: 1px solid #d5e8e6;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 6px 28px rgba(16, 48, 65, .14);
  }
  html:root body .contact-float a {
    flex: 0 0 36px !important;
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    height: 44px;
    min-height: 44px;
    padding: 3px;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  html:root body .contact-float a > span { width: 30px; height: 30px; }
  html:root body .contact-float a b { display: none; }
  html:root body #po-legal-widget {
    right: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    width: clamp(148px, calc(100% - 164px), 220px);
  }
  html:root body #po-legal-widget .po-widget-launcher {
    width: 100%;
    min-width: 0;
    height: 48px;
    padding: 6px 9px;
    gap: 7px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(7, 119, 111, .14);
  }
  html:root body #po-legal-widget .po-widget-avatar,
  html:root body #po-legal-widget .po-widget-avatar img {
    width: 34px;
    height: 34px;
  }
  html:root body #po-legal-widget .po-widget-avatar { flex-basis: 34px; }
  html:root body #po-legal-widget .po-widget-avatar img { border-width: 2px; }
  html:root body #po-legal-widget .po-widget-launcher b { font-size: 12px; line-height: 1.2; }
  html:root body #po-legal-widget .po-widget-launcher small { font-size: 10px; line-height: 1.2; margin-top: 3px; }
  html:root body #po-legal-widget .po-widget-arrow { display: none; }
  html:root body #po-legal-widget .po-widget-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-height: calc(100dvh - 112px - env(safe-area-inset-bottom, 0px));
    overflow: auto;
    overscroll-behavior: contain;
    border-radius: 16px;
  }
  html:root body #po-legal-widget .po-widget-panel > header {
    grid-template-columns: 42px minmax(0, 1fr) 38px;
    gap: 9px;
    padding: 12px;
  }
  html:root body #po-legal-widget .po-widget-panel > header > img { width: 42px; height: 42px; }
  html:root body #po-legal-widget .po-widget-panel header strong { font-size: 15px; }
  html:root body #po-legal-widget .po-widget-dialog { padding: 12px; }
  html:root body #po-legal-widget .po-widget-typing { display: none; }
  html:root body #po-legal-widget .po-widget-panel form { gap: 10px; padding: 14px; }

  /* A focused intake form or an open menu gets the available screen space. */
  html:root body:has(form.lead-form:focus-within, form[data-portal-intake]:focus-within, form[data-callback-form]:focus-within, .site-global-search:focus-within, .site-mobile-menu[open]):not(:has(#po-widget-panel.is-open)) .contact-float,
  html:root body:has(form.lead-form:focus-within, form[data-portal-intake]:focus-within, form[data-callback-form]:focus-within, .site-global-search:focus-within, .site-mobile-menu[open]):not(:has(#po-widget-panel.is-open)) #po-legal-widget {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }
}

@media (max-width: 360px) {
  html:root body header.site-header.site-header--search { padding-inline: 9px; gap: 6px; }
  html:root body header.site-header.site-header--search .site-brand strong { font-size: 15px; }
  html:root body header.site-header.site-header--search .site-brand img { width: 27px; height: 27px; flex-basis: 27px; }
  .site-mobile-call small { font-size: 10px; padding-left: 6px; }
}
