.ha-mobile-nav { display: none; }

@media (max-width: 768px) {
  body { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  .ha-mobile-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 100;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding-bottom: env(safe-area-inset-bottom);
    background: #fff;
    color: #004097;
    box-shadow: 0 -4px 18px #152c4520;
    font: 600 12px var(--ha-copy-font, Arial, sans-serif);
  }
  .ha-mobile-nav__item {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    color: inherit;
    cursor: pointer;
    list-style: none;
  }
  .ha-mobile-nav summary::-webkit-details-marker { display: none; }
  .ha-mobile-nav__item svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .ha-mobile-nav details[open] > summary { background: #edf4ff; }
  .ha-mobile-nav__submenu {
    position: absolute;
    inset: auto 12px calc(68px + env(safe-area-inset-bottom));
    max-height: 55vh;
    overflow: auto;
    background: #fff;
    border: 1px solid #dce5f2;
    border-radius: 8px;
    box-shadow: 0 8px 24px #152c4530;
    color: #25354b;
  }
  .ha-mobile-nav__submenu a {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid #edf1f6;
    font-size: 14px;
  }
  .ha-mobile-nav__submenu li:last-child a { border-bottom: 0; }
}
