:root {
  --sda-mnav-height: 72px;
  --sda-mnav-accent: var(--brand-red, #be0000);
  --sda-mnav-accent-soft: rgba(190, 0, 0, 0.10);
  --sda-mnav-bg: var(--surface, #ffffff);
  --sda-mnav-text: var(--text, #171717);
  --sda-mnav-muted: var(--muted, #696969);
  --sda-mnav-border: rgba(17, 17, 17, 0.12);
  --sda-mnav-shadow: 0 -8px 24px rgba(17, 17, 17, 0.10);
  --sda-mnav-focus: rgba(190, 0, 0, 0.42);
}

.sda-mnav-root {
  color: var(--sda-mnav-text);
  font: inherit;
}

.sda-mnav-root[hidden],
.sda-mnav-overlay[hidden] {
  display: none !important;
}

.sda-mnav-bar,
.sda-mnav-overlay {
  display: none;
}

.sda-mnav-icon {
  display: block;
  flex: 0 0 auto;
  color: currentColor;
  pointer-events: none;
}

.sda-mnav-label-measure {
  position: fixed;
  top: 0;
  left: -10000px;
  display: block;
  width: max-content;
  max-width: none;
  visibility: hidden;
  pointer-events: none;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
  -webkit-hyphens: none;
}

body.sda-mnav-sheet-open {
  overscroll-behavior: none;
}

@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
  body.sda-mnav-mounted .sda-mnav-root:not([hidden]) {
    display: block;
  }

  .sda-mnav-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(var(--sda-mnav-visible-count, 1), minmax(44px, 1fr));
    gap: 1px;
    width: 100%;
    max-width: 100vw;
    height: calc(var(--sda-mnav-height) + env(safe-area-inset-bottom));
    margin: 0;
    padding: 5px max(6px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(6px, env(safe-area-inset-left));
    overflow: hidden;
    border: 0;
    border-top: 1px solid var(--sda-mnav-border);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--sda-mnav-shadow);
    color: var(--sda-mnav-text);
    touch-action: manipulation;
  }

  .sda-mnav-item {
    position: relative;
    display: grid;
    min-width: 44px;
    min-height: 56px;
    place-items: center;
    align-content: center;
    gap: 2px;
    margin: 0;
    padding: 4px 2px;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--sda-mnav-muted);
    font: inherit;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .sda-mnav-item::after {
    position: absolute;
    bottom: 1px;
    left: 50%;
    width: 18px;
    height: 3px;
    border-radius: 999px;
    background: transparent;
    content: "";
    transform: translateX(-50%);
  }

  .sda-mnav-item-icon {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 10px;
    color: currentColor;
  }

  .sda-mnav-item-label {
    display: -webkit-box;
    width: 100%;
    max-width: 100%;
    max-height: 2.4em;
    overflow: hidden;
    color: currentColor;
    font-size: 10px;
    font-weight: 650;
    line-height: 1.2;
    text-overflow: clip;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
    -webkit-hyphens: none;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .sda-mnav-item-active,
  .sda-mnav-more-active {
    color: var(--sda-mnav-accent);
    font-weight: 800;
  }

  .sda-mnav-item-active .sda-mnav-item-icon,
  .sda-mnav-more-active .sda-mnav-item-icon {
    border-color: rgba(190, 0, 0, 0.18);
    background: var(--sda-mnav-accent-soft);
  }

  .sda-mnav-item-active::after,
  .sda-mnav-more-active::after {
    background: currentColor;
  }

  .sda-mnav-item[aria-disabled="true"],
  .sda-mnav-option[aria-disabled="true"] {
    opacity: 0.45;
    cursor: not-allowed;
  }

  .sda-mnav-overlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    width: 100%;
    max-width: 100vw;
    height: 100dvh;
    align-items: flex-end;
    justify-content: center;
    margin: 0;
    padding: 16px max(12px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    overflow: hidden;
    background: rgba(17, 17, 17, 0.52);
    overscroll-behavior: contain;
  }

  .sda-mnav-sheet {
    position: relative;
    z-index: 71;
    display: flex;
    width: min(100%, 520px);
    max-width: 100%;
    max-height: min(76dvh, 620px);
    flex-direction: column;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--sda-mnav-border);
    border-radius: 22px;
    background: var(--sda-mnav-bg);
    box-shadow: 0 20px 54px rgba(17, 17, 17, 0.24);
    color: var(--sda-mnav-text);
  }

  .sda-mnav-sheet-header {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    flex: 0 0 auto;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px 12px 18px;
    border-bottom: 1px solid var(--sda-mnav-border);
    background: var(--sda-mnav-bg);
  }

  .sda-mnav-sheet-title {
    margin: 0;
    color: var(--sda-mnav-text);
    font: inherit;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
  }

  .sda-mnav-close {
    display: grid;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    place-items: center;
    margin: 0;
    padding: 0;
    border: 1px solid var(--sda-mnav-border);
    border-radius: 12px;
    background: var(--sda-mnav-bg);
    color: var(--sda-mnav-text);
    font: inherit;
    cursor: pointer;
    touch-action: manipulation;
  }

  .sda-mnav-options {
    display: grid;
    min-height: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px 12px calc(18px + env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .sda-mnav-option {
    display: flex;
    min-width: 0;
    min-height: 52px;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 8px 10px;
    overflow: hidden;
    border: 1px solid var(--sda-mnav-border);
    border-radius: 14px;
    background: var(--sda-mnav-bg);
    color: var(--sda-mnav-text);
    font: inherit;
    line-height: 1.3;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
  }

  .sda-mnav-option .sda-mnav-item-icon {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    color: var(--sda-mnav-accent);
  }

  .sda-mnav-option .sda-mnav-item-label {
    display: block;
    max-height: none;
    overflow: visible;
    font-size: 14px;
    font-weight: 700;
    text-overflow: clip;
    white-space: normal;
    -webkit-line-clamp: unset;
  }

  .sda-mnav-option.sda-mnav-item-active {
    border-width: 2px;
    border-color: var(--sda-mnav-accent);
    background: var(--sda-mnav-accent-soft);
  }

  .sda-mnav-item:focus-visible,
  .sda-mnav-option:focus-visible,
  .sda-mnav-close:focus-visible,
  .sda-mnav-sheet:focus-visible {
    outline: 3px solid var(--sda-mnav-focus);
    outline-offset: 2px;
  }
}

@media (max-width: 480px) {
  .sda-mnav-options {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sda-mnav-root *,
  .sda-mnav-root *::before,
  .sda-mnav-root *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
