/* Shenzhen multilingual layer: language switcher, guide typography, overflow safeguards. */
:root{--lang-btn:#0d3b2f}
html{hanging-punctuation:first last}
body{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans","Noto Sans SC","Noto Sans JP","Noto Sans KR","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif}
:focus-visible{outline:2px solid var(--g);outline-offset:3px}
.header-tools{display:flex;align-items:center;gap:10px;flex-shrink:0}
header.nav .wrap{gap:10px}
.lang-switch{position:relative;flex-shrink:0}
.lang-switch-btn{
  font:inherit;font-weight:700;font-size:.875rem;line-height:1.2;
  color:var(--g);background:#fff;border:1.5px solid var(--g);
  border-radius:999px;padding:.45rem .85rem;cursor:pointer;
  white-space:nowrap;anchor-name:--lang-btn;
}
.lang-switch-btn:hover{background:var(--tint);text-decoration:none}
#lang-menu{
  inset:auto;
  margin:0;
  padding:.35rem 0;
  list-style:none;
  min-inline-size:13rem;
  max-inline-size:min(18rem, calc(100dvw - 2rem));
  max-block-size:min(70dvh, calc(100dvh - 6rem));
  overflow:auto;
  background:#fff;
  border:1.5px solid var(--g);
  border-radius:14px;
  box-shadow:0 12px 32px rgba(13,59,47,.16);
  z-index:40;
}
@supports (position-anchor: --lang-btn){
  #lang-menu[popover]{
    position:fixed;
    position-anchor:--lang-btn;
    inset:auto;
    position-area:block-end span-inline-end;
    position-try-fallbacks:flip-inline,flip-block;
    margin-block-start:.4rem;
  }
}
@supports not (position-anchor: --lang-btn){
  #lang-menu[popover],#lang-menu.is-open{
    position:absolute;
    inset-block-start:calc(100% + .4rem);
    inset-inline-end:0;
  }
  .lang-switch{position:relative}
  #lang-menu[popover]{/* containing block from .lang-switch */}
}
#lang-menu.is-open{
  display:block;
  position:absolute;
  inset-block-start:calc(100% + .4rem);
  inset-inline-end:0;
}
#lang-menu a{
  display:block;padding:.45rem 1rem;color:var(--ink);text-decoration:none;font-weight:500;
}
#lang-menu a:hover,#lang-menu a:focus-visible{background:var(--tint);color:var(--g);text-decoration:none}
#lang-menu a[aria-current="true"]{font-weight:800;color:var(--g)}
.nav-cta{flex-shrink:0}
.article-main{padding:40px 0 72px}
.article{
  max-width:46rem;
  margin:0 auto;
}
.article .eyebrow{margin-bottom:10px}
.article h1{
  font-size:clamp(1.7rem, 1rem + 2.6vw, 2.6rem);
  line-height:1.22;font-weight:800;letter-spacing:-.02em;margin-bottom:1rem;
  text-wrap:balance;
}
.article .lead{font-size:1.125rem;color:var(--ink);margin-bottom:1.4rem}
.article h2{
  font-size:clamp(1.25rem, .9rem + 1.4vw, 1.7rem);
  margin:2rem 0 .7rem;max-width:none;
}
.article h3{font-size:1.05rem;margin:1.3rem 0 .4rem}
.article p,.article li{color:var(--ink);font-size:1.0625rem}
.article p{margin:0 0 1rem}
.article ul,.article ol{margin:0 0 1rem 1.2rem}
.article li{margin:0 0 .4rem}
.article .notice{
  background:var(--card);
  border:1px solid var(--line);
  border-inline-start:4px solid var(--g);
  border-radius:16px;
  padding:1rem 1.1rem;
  margin:0 0 1.2rem;
}
.article .notice p:last-child{margin-bottom:0}
.article .sources{margin-top:2rem;padding-top:1rem;border-top:1px solid var(--line)}
.article .sources li{overflow-wrap:anywhere}
.crumb{font-size:.9rem;color:var(--ink2);margin-bottom:1.1rem}
.crumb a{color:var(--g)}
.related{margin-top:2.2rem}
.office-note{font-size:.95rem;color:var(--ink2)}
.hero-docs a[aria-current="page"],.doc-list a[aria-current="page"]{font-weight:800}
@media (max-width: 720px){
  .header-tools .btn-s .btn-extra{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
}
.article .service-note{margin:1.6rem 0 0;padding-top:1rem;border-top:1px solid var(--line)}
img.pic,.hero-slide img,.cs-dock img,#wechat-pop img{max-width:100%;height:auto}

/* Narrow/collapsed header: prevent the logo image from painting over the menu.
   The logo flex item was allowed to shrink to 0 while the image kept its intrinsic
   width (max-width:161px/145px, overflow visible). Long CTA labels such as
   "Запросить расчёт" made this happen on phone widths. */
header.nav .logo img{
  max-width:100%;
  width:auto;
  height:auto;
  max-height:40px;
  min-width:0;
}
header.nav:not(.is-wide) .logo{
  flex:0 1 auto;
  min-inline-size:6rem;
}

/* Match the existing 640px callbar breakpoint: take the long header quote button
   out of the compact row so logo, menu and language switcher can sit on one line.
   Contact remains in the bottom callbar, footer, and (on foreign pages) the menu.
   Do not clip or overflow-hide the header to mask overlap. */
@media (max-width:640px){
  header.nav .wrap{gap:8px}
  header.nav .logo img{max-height:36px}
  header.nav:not(.is-wide) .header-tools > a.btn{
    display:none;
  }
}

/* The teaser tile reuses .wide (a horizontal flex). On phones the long Russian
   paragraph sat in a ~110px column and extended the page past the viewport.
   Stack it on the same 640px breakpoint as the rest of the bento grid. */
@media (max-width:640px){
  .fabohui-teaser .wide{
    flex-direction:column;
    align-items:stretch;
    gap:0;
  }
  .fabohui-teaser .wide > *{
    min-inline-size:0;
    max-inline-size:100%;
  }
}
