/* Keep the phone available at the top and the four frequent destinations at thumb reach. */
#au-mobile-actions { display: none; }

@media screen and (max-width: 860px) {
  .sd-header .sd-desktop-nav { display: none; }
  .sd-header .sd-mobile-menu { display: block; }
  .sd-header .sd-phone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin-inline-start: auto;
    color: var(--accent);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.025em;
  }
  .sd-site .sd-header-inner {
    flex-wrap: wrap;
    min-height: 3.75rem;
    column-gap: clamp(.3rem, 2vw, 1rem);
    row-gap: 0;
  }
  .sd-mobile-menu nav {
    z-index: 3;
    max-height: min(31rem, calc(100dvh - 5rem));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .sd-mobile-menu nav a { min-height: 44px; }
  .sd-mobile-menu summary { justify-content: center; min-width: 44px; }
  .sd-site { padding-bottom: calc(3.75rem + env(safe-area-inset-bottom, 0px)); }
  html:has(#au-mobile-actions) { scroll-padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px)); }
  #au-mobile-actions {
    position: fixed;
    z-index: 6;
    inset-inline: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    padding: .18rem max(.5rem, env(safe-area-inset-right, 0px)) calc(.18rem + env(safe-area-inset-bottom, 0px)) max(.5rem, env(safe-area-inset-left, 0px));
    border-block-start: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink);
    box-shadow: 0 -3px 14px rgb(34 16 24 / 5%);
  }
  #au-mobile-actions a {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .16rem;
    min-height: max(44px, 3.2rem);
    padding: .25rem .1rem;
    color: var(--ink);
    text-decoration: none;
    font: 600 .75rem/1.2 var(--font-sans, sans-serif);
    text-align: center;
    overflow-wrap: anywhere;
    border-radius: .4rem;
  }
  #au-mobile-actions a[aria-current] { color: var(--accent); background: var(--surface); }
  #au-mobile-actions a[aria-current]::before {
    content: "";
    position: absolute;
    top: -.18rem;
    width: 1.65rem;
    border-block-start: 2px solid currentColor;
  }
  #au-mobile-actions svg { width: 1.22rem; height: 1.22rem; flex: none; }
  #au-mobile-actions .au-action-telegram::after {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 24%;
    bottom: 24%;
    border-inline-start: 1px solid var(--line);
  }
  #au-mobile-actions a:hover,
  #au-mobile-actions a:active { color: var(--accent); }
  #au-mobile-actions a:focus-visible,
  .sd-header .sd-phone:focus-visible,
  .sd-mobile-menu summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  body:has(.sd-mobile-menu[open], .t-popup_show, .ac-options:not([hidden]), dialog[open]) #au-mobile-actions,
  body:has(input:focus, textarea:focus, [contenteditable="true"]:focus) #au-mobile-actions { display: none; }
}
@media screen and (min-width: 540px) and (max-width: 860px) {
  #au-mobile-actions {
    padding-inline: max(calc((100vw - 33rem) / 2), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  }
}
@media screen and (max-width: 499px) {
  .sd-site .sd-header-inner { width: calc(100% - 1.25rem); column-gap: .35rem; }
  .sd-header .sd-brand { font-size: 1.04rem; }
  .sd-header .sd-brand::before { width: 1.42rem; height: 1.42rem; margin-inline-end: .26rem; }
  .sd-header .sd-phone { font-size: .865rem; }
  .sd-mobile-menu summary { padding-inline: .5rem; gap: 0; }
  .sd-mobile-menu .au-menu-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
@media screen and (max-width: 359px) {
  .sd-header .sd-brand { font-size: .92rem; }
  .sd-header .sd-brand span { display: none; }
  .sd-header .sd-brand::before { width: 1.25rem; height: 1.25rem; }
  .sd-site .sd-header-inner { column-gap: .22rem; }
}
@media screen and (max-height: 420px) and (orientation: landscape) {
  #au-mobile-actions { position: static; }
  .sd-site { padding-bottom: 0; }
}

.au-theme {
  position: relative;
  align-items: center;
  color: var(--ink);
  font: inherit;
}

.au-theme select {
  font-family: inherit;
  color-scheme: inherit;
  cursor: pointer;
}

.au-theme-disc {
  box-sizing: border-box;
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
  border: 1.6px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}

.au-theme-desktop {
  display: inline-flex;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  justify-content: center;
  border: 1px solid var(--strong-line);
  border-radius: 50%;
  color: var(--accent);
  background: var(--paper);
}

.au-theme-desktop select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.au-theme-desktop .au-theme-name {
  display: none;
}

.au-theme:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.au-theme-mobile { display: none; }

@media (max-width: 860px) {
  .au-theme-desktop { display: none; }

  .au-theme-mobile {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .5rem;
    padding-block: .6rem .15rem;
    margin-block-start: .35rem;
    border-block-start: 1px solid var(--line);
    font-size: .875rem;
  }

  .au-theme-mobile .au-theme-disc { width: .9rem; height: .9rem; }
  .au-theme-mobile .au-theme-name { flex: 1 1 auto; }
  .au-theme-mobile select {
    max-width: 100%;
    min-height: 2.75rem;
    padding: .3rem .28rem;
    color: var(--ink);
    background-color: var(--surface);
    border: 1px solid var(--strong-line);
    border-radius: .5rem;
    font-size: 1rem;
  }
}

@media (hover: hover) {
  .au-theme-desktop:hover { border-color: var(--accent); background: var(--accent-bg); }
}

:root:not([data-theme]) .au-theme { display: none; }

@media (forced-colors: active) {
  .au-theme-disc { forced-color-adjust: none; color: ButtonText; }
}

@media print {
  .au-theme { display: none; }
}

.au-journey .ep-intro { max-width: 46ch; }

.au-choices {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .5rem;
  margin-block-start: 1.1rem;
}

.au-choices a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  max-width: 100%;
  padding: .4rem .85rem;
  border: 1px solid var(--accent-line);
  border-radius: .65rem;
  color: var(--accent);
  background: var(--paper);
  font-size: .9375rem;
  font-weight: 620;
  line-height: 1.25;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.au-choices a:hover { background: var(--accent-bg); border-color: var(--accent); }
.au-choices a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.au-choices a[href="#temy-statey"], .au-choices a[href="#vybor-uslugi"] {
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: .2em;
}
.au-choices a[href="#temy-statey"] { padding-inline-start: .1rem; }
.au-journey[data-au-catalogue="stati"] .au-choices { margin-block-start: .15rem; }

.sd-site :is(#vybor-uslugi, #temy-statey, #moskva, #peterburg, #krasnodar, #drugoy-region) {
  scroll-margin-block-start: 5.2rem;
}

@media (max-width: 670px) {
  .ep-mast.au-journey {
    padding-block: 1rem 1.35rem;
    gap: .95rem;
  }
  .ep-mast.au-journey .ep-cover {
    width: 100%;
    height: clamp(5.5rem, 23vw, 8rem);
    object-fit: cover;
    object-position: center 52%;
    border-radius: .6rem 1.35rem .6rem .6rem;
  }
  .ep-mast.au-journey .ep-intro { margin-block-start: .65rem; }
  .au-journey .au-choices { gap: .3rem; margin-block-start: .65rem; }
  .au-choices a { padding-inline: .66rem; }
  .au-journey + .ep-shelf { padding-block-start: 1.25rem; }
  .au-journey .ax-search { margin-block-start: .8rem; }
}

@media print {
  .au-choices { display: none; }
}

/* Preserve the reading column when visitors enlarge text rather than the viewport. */
@media (max-width: 670px) {
  .sd-site main, .sd-footer { overflow-wrap: anywhere; }
  .sd-site :is(.ep-mast, .ep-index-grid, .ep-read, .ep-stories, .process-inner, .questions, .service-list) {
    grid-template-columns: minmax(0, 1fr);
  }
  .steps li { grid-template-columns: min(2.5rem, 16vw) minmax(0, 1fr); }
  .ep-index-grid > *, .ep-mast > *, .ep-service > div, .sd-footer-inner > *,
  .sd-contact-inner > *, .hero-copy { min-width: 0; max-width: 100%; }
  .ax-tags a, .ep-toc a, .actions .service-button {
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .sd-footer-contact a { white-space: normal; max-width: 100%; }
  .sd-footer .sd-brand {
    display: inline-block;
    white-space: normal;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .sd-footer .sd-brand::before { display: inline-block; vertical-align: -.3em; }
}
