
.ha-mobile-menu-button,
.ha-mobile-drawer,
.ha-mobile-overlay,
.ha-mobile-bottom-nav {
  display: none;
}

/* The drawer has an explicit flex display on mobile; keep the semantic
   hidden state authoritative so closed drawers are removed from rendering. */
.ha-mobile-drawer[hidden] {
  display: none !important;
}

@media (max-width: 760px) {

  .ha-sidebar {
    display: none;
  }

  .ha-stage {
    margin-left: 0;
  }

  .ha-topbar {
    height: 60px;

    padding-left:
      max(10px, env(safe-area-inset-left));

    padding-right:
      max(10px, env(safe-area-inset-right));

    gap: 8px;
  }

  .ha-mobile-menu-button {
    display: grid;
    place-items: center;

    flex: 0 0 auto;
  }

  .ha-page-context {
    flex: 1;
  }

  .ha-topbar-actions {
    gap: 5px;
  }

  .ha-search-trigger {
    width: 42px;
    min-width: 42px;
    padding: 0;

    justify-content: center;
  }

  .ha-search-trigger > span:nth-child(2),
  .ha-search-trigger kbd {
    display: none;
  }

  .ha-avatar {
    width: 38px;
    height: 38px;
  }

  .ha-workspace {
    padding: 13px 11px 20px;
  }

  .ha-mobile-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;

    display: block;

    background:
      rgba(0,0,0,.58);

    backdrop-filter:
      blur(5px);
  }

  .ha-mobile-overlay[hidden] {
    display: none;
  }

  .ha-mobile-drawer {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 310;

    width: min(84vw, 320px);

    padding:
      max(14px, env(safe-area-inset-top))
      12px
      max(14px, env(safe-area-inset-bottom));

    display: flex;
    flex-direction: column;

    transform:
      translateX(-105%);

    transition:
      transform
      var(--ha-normal)
      var(--ha-ease);

    background:
      linear-gradient(
        180deg,
        rgba(15,24,40,.985),
        rgba(7,12,23,.985)
      );

    border-right:
      1px solid var(--ha-border-strong);

    box-shadow:
      30px 0 70px rgba(0,0,0,.34);
  }

  .ha-mobile-drawer.open {
    transform: translateX(0);
  }

  .ha-mobile-drawer-header {
    min-height: 58px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    padding: 4px 3px 14px;
  }

  .ha-mobile-drawer-nav {
    flex: 1;

    display: grid;
    align-content: start;
    gap: 4px;

    overflow-y: auto;
  }

  .ha-mobile-drawer-footer {
    padding-top: 14px;

    border-top:
      1px solid var(--ha-border);
  }

  .ha-mobile-bottom-nav {
    position: fixed;

    left:
      max(9px, env(safe-area-inset-left));

    right:
      max(9px, env(safe-area-inset-right));

    bottom:
      max(8px, env(safe-area-inset-bottom));

    z-index: 220;

    min-height: 62px;
    padding: 6px;

    display: grid;

    grid-template-columns:
      repeat(5, minmax(0, 1fr));

    gap: 3px;

    border:
      1px solid var(--ha-border-strong);

    border-radius: 19px;

    background:
      rgba(10,16,29,.92);

    backdrop-filter:
      blur(22px);

    box-shadow:
      0 20px 60px rgba(0,0,0,.36);
  }

  html[data-theme="light"]
  .ha-mobile-bottom-nav {
    background:
      rgba(255,255,255,.92);
  }

  .ha-mobile-bottom-item {
    min-width: 0;
    min-height: 49px;

    padding: 4px 2px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 2px;

    border: 0;
    border-radius: 13px;

    background: transparent;

    color: var(--ha-text-3);

    cursor: pointer;

    font-size: 9px;
  }

  .ha-mobile-bottom-item
  .ha-mobile-nav-icon {
    font-size: 16px;
    line-height: 1;
  }

  .ha-mobile-bottom-item.active {
    color: var(--ha-text-1);

    background:
      var(--ha-primary-soft);
  }

  .ha-mobile-bottom-item.active
  .ha-mobile-nav-icon {
    color: var(--ha-primary);
  }

  .ha-mobile-bottom-label {
    width: 100%;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    text-align: center;
  }
}

@media (max-width: 390px) {

  .ha-topbar {
    padding-left: 8px;
    padding-right: 8px;
  }

  .ha-page-context strong {
    max-width: 120px;
  }

  .ha-mobile-bottom-nav {
    left: 6px;
    right: 6px;
  }

  .ha-mobile-bottom-label {
    font-size: 8px;
  }
}

/* Bottom navigation removed; use the mobile drawer. */
.ha-mobile-bottom-nav, .ha-fixed-capabilities { display:none !important; }
