.atlias-mobile-global-header,
.atlias-mobile-drawer,
.atlias-mobile-drawer-backdrop {
  display: none;
}

@media (max-width: 760px) {
  .atlias-mobile-global-header,
  .atlias-mobile-global-header *,
  .atlias-mobile-drawer,
  .atlias-mobile-drawer * {
    box-sizing: border-box;
  }

  .atlias-mobile-global-header,
  .atlias-mobile-drawer {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }

  .home-desktop-header {
    display: none !important;
  }

  .atlias-mobile-global-header {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr) 78px;
    align-items: center;
    column-gap: 0;

    /* Global mobile nav owns its viewport geometry.
       Parent shells may use different page gutters. */
    width: calc(100vw - 24px);
    margin-left: calc(50% - 50vw + 12px);

    min-height: 44px;
    margin-bottom: 8px;
    position: relative;
    z-index: 110;
  }

  .atlias-mobile-menu-toggle {
    justify-self: start;
    width: 44px;
    height: 44px;
    padding: 0;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-subtle, #ddd6cc);
    border-radius: 12px;
    background: var(--bg-panel, #fffdfa);
    color: var(--text-primary, #111827);
    cursor: pointer;
  }

  .atlias-mobile-menu-toggle-icon {
    position: relative;
    width: 20px;
    height: 16px;
    display: block;
  }

  .atlias-mobile-menu-toggle-icon span {
    position: absolute;
    left: 0;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 160ms ease, opacity 160ms ease, top 160ms ease;
  }

  .atlias-mobile-menu-toggle-icon span:nth-child(1) { top: 1px; }
  .atlias-mobile-menu-toggle-icon span:nth-child(2) { top: 7px; }
  .atlias-mobile-menu-toggle-icon span:nth-child(3) { top: 13px; }

  .atlias-mobile-menu-toggle[aria-expanded="true"] .atlias-mobile-menu-toggle-icon span:nth-child(1) {
    top: 7px;
    transform: rotate(45deg);
  }

  .atlias-mobile-menu-toggle[aria-expanded="true"] .atlias-mobile-menu-toggle-icon span:nth-child(2) {
    opacity: 0;
  }

  .atlias-mobile-menu-toggle[aria-expanded="true"] .atlias-mobile-menu-toggle-icon span:nth-child(3) {
    top: 7px;
    transform: rotate(-45deg);
  }

  .atlias-mobile-brand {
    justify-self: center;
    min-width: 0;
    text-align: center;
    font-size: 14px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: .08em;
    color: var(--text-primary, #111827);
  }


  .atlias-mobile-header-actions {
    justify-self: end;
    width: 78px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
  }

  .atlias-mobile-locale-current {
    min-width: 36px;
    min-height: 34px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-subtle, #ddd6cc);
    border-radius: 999px;
    background: var(--bg-panel, #fffdfa);
    color: var(--text-primary, #111827);
    text-decoration: none;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    text-transform: uppercase;
  }

  .atlias-mobile-theme-toggle {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--border-subtle, #ddd6cc);
    border-radius: 10px;
    background: var(--bg-panel, #fffdfa);
    color: var(--text-primary, #111827);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .atlias-mobile-theme-icon {
    width: 16px;
    height: 16px;
    display: block;
  }

  .atlias-mobile-theme-toggle .theme-toggle-label {
    display: none;
  }

  .atlias-mobile-drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(20, 24, 32, .34);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 160ms ease, visibility 160ms ease;
  }

  .atlias-mobile-drawer-backdrop.is-open,
  .atlias-mobile-drawer-backdrop[data-open="true"] {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .atlias-mobile-drawer {
    display: block;
    position: fixed;
    top: 16px;
    left: 64px;
    width: min(320px, calc(100vw - 78px));
    max-height: calc(100vh - 32px);
    overflow: auto;
    z-index: 1001;
    padding: 12px 16px 14px;
    border: 1px solid #e3d9cc;
    border-radius: 18px;
    background: #f7f2e9;
    color: var(--text-primary, #111827);
    box-shadow: 0 18px 50px rgba(15, 23, 42, .16);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-8px);
    transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
  }

  :root[data-theme="dark"] .atlias-mobile-drawer {
    background: var(--bg-panel, #171a20);
    border-color: var(--border-subtle, #333842);
  }

  .atlias-mobile-drawer.is-open,
  .atlias-mobile-drawer[data-open="true"] {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
  }

  .atlias-mobile-drawer-close {
    display: none;
  }

  .atlias-mobile-drawer-section-label {
    margin: 2px 0 6px;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-secondary, #536174);
  }

  .atlias-mobile-drawer-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0;
  }

  .atlias-mobile-drawer-links li {
    margin: 0;
    padding: 0;
  }

  .atlias-mobile-drawer-link {
    width: 100%;
    min-height: 40px;
    padding: 7px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    color: var(--text-primary, #111827);
    text-decoration: none;
    text-align: left;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.25;
    font-weight: 600;
    cursor: pointer;
  }

  .atlias-mobile-drawer-divider {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle, #ddd6cc);
  }

  .atlias-mobile-drawer-utility {
    min-height: 40px;
    padding: 7px 2px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
  }

  .atlias-mobile-drawer-utility-label {
    font-size: 13px;
    line-height: 1.25;
    font-weight: 600;
  }

  .atlias-mobile-drawer-locale {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .atlias-mobile-drawer-locale-option,
  .atlias-mobile-drawer-theme-state {
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    text-transform: uppercase;
  }

  .atlias-mobile-drawer-locale-option {
    color: var(--text-primary, #111827);
    text-decoration: none;
  }

  .atlias-mobile-drawer-locale-option.is-active,
  .atlias-mobile-drawer-theme-state,
  .atlias-mobile-drawer-locale-sep {
    color: var(--text-secondary, #536174);
  }

  .atlias-mobile-drawer-theme-state {
    text-transform: uppercase;
  }

  body.atlias-mobile-drawer-open .atlias-mobile-brand,
  body.atlias-mobile-drawer-open .atlias-mobile-locale-current,
  body.atlias-mobile-drawer-open .atlias-mobile-theme-toggle {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}
