.topbar-toggle { display: none; }
.topbar-menu { display: contents; }
.topbar-site { order: 1; text-decoration: none; }
.topbar-logo { order: 2; }
.topbar-controls { order: 3; display: flex; align-items: center; gap: .5rem; }
@media (max-width: 767.98px) {
  .topbar .container-fluid { padding-inline: 0; }
  .topbar-logo { order: 1; min-width: 0; max-width: calc(100% - 60px); }
  .topbar .topbar-logo .header-logo { max-width: min(100%, 240px); }
  .topbar-toggle {
    order: 2; display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; padding: 0; cursor: pointer;
    border: 1px solid var(--line, #aaa); border-radius: 10px;
    background: var(--paper, #fff); color: var(--ink, #222);
  }
  .topbar-toggle:focus-visible { outline: 3px solid var(--brand, #805135); outline-offset: 2px; }
  .topbar-toggle-bars, .topbar-toggle-bars::before, .topbar-toggle-bars::after {
    display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor; content: "";
  }
  .topbar-toggle-bars { position: relative; }
  .topbar-toggle-bars::before { position: absolute; top: -6px; }
  .topbar-toggle-bars::after { position: absolute; top: 6px; }
  .topbar-menu {
    display: none; position: absolute; top: calc(100% + 8px); right: 0; z-index: 1050;
    width: min(100%, 320px); max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px);
    overflow-y: auto; flex-direction: column; gap: 12px; padding: 14px;
    border: 1px solid var(--line, #aaa); border-radius: 12px;
    background: var(--paper, #fff); box-shadow: 0 10px 28px rgba(0,0,0,.18);
  }
  .topbar-menu.is-open { display: flex; }
  .topbar-site, .topbar-controls { order: 0; }
  .topbar-controls { flex-direction: column; align-items: stretch; gap: 12px; }
  .topbar-menu .outline-nav {
    display: flex; align-items: center; justify-content: center; width: 100%;
    min-height: 44px; padding-inline: 12px; font-size: 14px;
  }
  .topbar-menu .theme-switcher select { width: 100%; min-height: 44px; font-size: 14px; padding: 0 10px; }
  .topbar-menu .booksys-language-switcher { width: 100%; }
  .topbar-menu .booksys-language-switcher summary { min-height: 44px; display: flex; align-items: center; justify-content: center; }
  .topbar-menu .booksys-language-options { position: static; width: 100%; margin-top: 6px; box-shadow: none; }
  .topbar-menu .booksys-language-options a { display: flex; align-items: center; min-height: 44px; }
}
