#mobile-category-toggle { display: none; }

@media (max-width: 800px), (pointer: coarse) {
  .fitting-room {
    --tool-size: 36px;
    --tool-gap: 7px;
    --rail-left: max(12px, var(--fit-safe-left));
    --rail-right: max(14px, var(--fit-safe-right));
    --rail-bottom: calc(12px + var(--fit-safe-bottom));
    --tools-width: calc(5 * var(--tool-size) + 4 * var(--tool-gap));
  }
  .fitting-room:not([data-scene-only]) .scene-tools {
    top: auto; right: var(--rail-right); bottom: var(--rail-bottom);
    flex-direction: row; gap: var(--tool-gap);
  }
  .fitting-room:not([data-scene-only]) .scene-tools > :is(.icon-button,.language-switch) {
    width: var(--tool-size); height: var(--tool-size); margin: 0;
  }
  .fitting-room .bottom-ui { bottom: calc(var(--rail-bottom) + var(--tool-size) + 12px); }
  .wardrobe {
    top: auto; bottom: var(--rail-bottom); left: var(--rail-left); right: auto;
    width: max-content;
    max-width: calc(100% - var(--rail-left) - var(--rail-right) - var(--tools-width) - var(--tool-gap));
    height: var(--tool-size);
    border-radius: 999px; padding: 0;
  }
  .wardrobe-heading, .wardrobe-divider, .wardrobe > .add-item { display: none; }
  .wardrobe:has(#mobile-category-toggle[aria-expanded="true"]) { z-index: 9; }
  #mobile-category-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%; height: 100%; min-height: 0;
    padding: 0 9px;
    border-radius: inherit;
    font-size: 13px;
    font-weight: 500;
  }
  #mobile-category-toggle .mobile-category-icon { width: 16px; height: 16px; flex: none; }
  #mobile-category-toggle .mobile-category-chevron {
    width: 10px; height: 10px; flex: none;
    transform: rotate(-90deg);
  }
  #mobile-category-toggle[aria-expanded="true"] .mobile-category-chevron { transform: rotate(90deg); }
  #wardrobe-categories { display: none; }
  #mobile-category-toggle[aria-expanded="true"] + #wardrobe-categories {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    position: absolute;
    bottom: calc(100% + 7px);
    left: 0;
    width: max-content;
    min-width: 100%;
    max-height: calc(100vh - 130px);
    max-height: calc(100dvh - 130px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 4px;
    border: 1px solid rgba(222, 239, 255, .32);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(224, 240, 255, .13), rgba(224, 240, 255, .025)), rgba(13, 24, 41, .82);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
  }
  @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    #mobile-category-toggle[aria-expanded="true"] + #wardrobe-categories {
      background-color: rgba(13, 24, 41, .62);
      -webkit-backdrop-filter: blur(15px) saturate(1.1);
      backdrop-filter: blur(15px) saturate(1.1);
    }
  }
  @media (prefers-reduced-transparency: reduce) {
    #mobile-category-toggle[aria-expanded="true"] + #wardrobe-categories {
      background: #1d2b3d;
      -webkit-backdrop-filter: none;
      backdrop-filter: none;
    }
  }
  #wardrobe-categories .category {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 6px 12px;
    border-radius: 11px;
  }
  #wardrobe-categories .category > span { display: block; font-size: 14px; }
  #wardrobe-categories .category .icon { width: 18px; height: 18px; }
}

@media (max-width: 374px) {
  .fitting-room { --tool-size: 32px; --tool-gap: 4px; }
  #mobile-category-toggle { padding-inline: 8px; }
}
@media (max-width: 349px) {
  #mobile-category-toggle .mobile-category-icon { display: none; }
}
