.mobile-header-toggle {
  display: none;
}

.mobile-header-menu {
  position: fixed;
  inset: auto 14px auto auto;
  width: min(320px, calc(100vw - 28px));
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 12px 32px rgba(31, 42, 36, 0.18);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mobile-header-menu:popover-open {
  display: grid;
  gap: 8px;
}

.mobile-header-menu .hidden {
  display: none !important;
}

.mobile-header-menu #statusSub {
  padding: 8px;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.mobile-header-menu :is(.city-nav-back, .support-link, .logout-button, .status-action) {
  width: 100%;
  min-height: 44px;
  height: auto;
  margin: 0;
  padding: 10px 12px;
  justify-content: flex-start;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: none;
  transform: none;
}

.mobile-header-menu #cityLabel {
  font-size: 0;
}

.mobile-header-menu #cityLabel::before {
  content: 'К выбору режима';
  font-size: 14px;
  color: inherit;
}

.mobile-header-menu :is(.language-switch, .country-control) {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  justify-content: space-between;
}

.mobile-header-menu select {
  width: auto;
  min-width: 0;
  min-height: 44px;
  font-size: 16px;
}

.mobile-header-menu .logout-button {
  color: #b91c1c;
}

@media (max-width: 768px) {
  body.mobile-header-ready .header-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    margin-left: 0;
  }

  body.mobile-header-ready .connection-support {
    display: flex;
    flex-direction: row;
    flex: 1 1 0;
    width: auto;
    min-width: 0;
  }

  body.mobile-header-ready .status-pill {
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 44px;
    align-items: center;
    flex-wrap: nowrap;
    white-space: normal;
  }

  body.mobile-header-ready .status-pill > span {
    flex: 0 0 8px;
  }

  body.mobile-header-ready .status-pill > div {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  body.mobile-header-ready .mobile-header-toggle {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--card);
    color: var(--ink);
    cursor: pointer;
    touch-action: manipulation;
  }

  .mobile-header-toggle:active,
  .mobile-header-toggle[aria-expanded='true'] {
    background: var(--bg);
  }

  .mobile-header-toggle:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
  }
}
