.xboox-mobile-modal-root[hidden] {
  display: none;
}

@media (max-width: 767px) {
  .xboox-mobile-modal-root {
    position: fixed;
    z-index: var(--xb-z-mobile-modal-overlay);
    inset: 0;
    display: grid;
    align-items: end;
    pointer-events: none;
  }

  .xboox-mobile-modal-root[data-state="open"] {
    pointer-events: auto;
  }

  .xb-mobile-surface-backdrop {
    display: grid;
    min-width: 0;
    min-height: 100%;
    align-items: end;
    background: color-mix(in srgb, var(--xb-color-scrim) 42%, transparent);
    color: var(--xb-color-on-surface);
    animation: xb-mobile-surface-scrim-in var(--xb-motion-duration-short-2, 180ms) ease-out both;
  }

  .xb-mobile-bottom-sheet {
    box-sizing: border-box;
    display: grid;
    width: 100%;
    max-height: 78dvh;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    padding: 0 0 env(safe-area-inset-bottom);
    overflow: hidden;
    border-radius: 28px 28px 0 0;
    background: var(--xb-color-surface-container-high);
    color: var(--xb-color-on-surface);
    box-shadow: var(--xb-elevation-2);
    animation: xb-mobile-surface-sheet-in var(--xb-motion-duration-medium-1, 220ms) cubic-bezier(0.2, 0, 0, 1) both;
  }

  .xb-mobile-bottom-sheet__handle {
    width: 36px;
    height: 4px;
    margin: 14px auto 8px;
    border-radius: 4px;
    background: var(--xb-color-outline);
  }

  .xb-mobile-bottom-sheet__header {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 20px 10px;
  }

  .xb-mobile-bottom-sheet__header h2 {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    font-size: 22px;
    font-weight: 700;
    line-height: 28px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .xb-mobile-bottom-sheet__close {
    display: grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--xb-color-primary);
  }

  .xb-mobile-bottom-sheet__close svg {
    width: 26px;
    height: 26px;
    stroke-width: 2;
  }

  .xb-mobile-bottom-sheet__body {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 8px 12px 16px;
    -webkit-overflow-scrolling: touch;
  }

  .xb-mobile-bottom-sheet__footer {
    padding: 8px 20px 16px;
    border-top: 1px solid var(--xb-color-outline-variant);
    background: var(--xb-color-surface-container-high);
    color: var(--xb-color-on-surface);
  }

  body.xboox-mobile-surface-open .xboox-mobile-navigation {
    visibility: hidden;
    pointer-events: none;
  }

  @media (prefers-reduced-motion: reduce) {
    .xb-mobile-surface-backdrop,
    .xb-mobile-bottom-sheet {
      animation: none;
    }
  }
}

@keyframes xb-mobile-surface-scrim-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes xb-mobile-surface-sheet-in {
  from {
    opacity: 0;
    transform: translateY(32px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

