.category-open { display:none; }
.category-dialog { width:min(100%, 560px); max-width:100%; max-height:85vh; max-height:85dvh; margin:auto auto 0; padding:18px 18px max(18px, env(safe-area-inset-bottom)); border:1px solid var(--line); border-radius:18px 18px 0 0; color:var(--text); }
.category-dialog::backdrop { background:#0006; }
.category-dialog-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:12px; }
.category-dialog-heading h2 { margin:0; font-size:18px; }
.category-dialog-heading button { background:white; color:var(--text); border:1px solid var(--line); border-radius:6px; padding:10px; cursor:pointer; }
.category-dialog .category-tree { max-height:calc(85vh - 110px); max-height:calc(85dvh - 110px); margin:0; }
html:has(.category-dialog[open]) { overflow:hidden; }
@media (max-width:760px) {
  .category-open { display:block; margin-bottom:12px; }
  #category-desktop-slot { display:none; }
  .category-dialog .category-tree a { min-height:44px; padding-top:12px; padding-bottom:12px; }
}
.category-tree { display:block; max-height:55vh; max-height:55dvh; overflow-y:auto; overscroll-behavior:contain; scrollbar-gutter:stable; margin-bottom:22px; padding:2px 8px 2px 2px; }
.category-tree ul { list-style:none; padding:0; margin:0; }
.category-tree ul ul { padding-left:16px; }
.category-tree a { display:block; padding:7px 0; color:var(--text); font-size:14px; line-height:1.4; border-radius:0; background:transparent; overflow-wrap:anywhere; }
.category-tree ul ul a { color:var(--muted); }
.category-tree > a, .category-tree > ul > li > a { font-weight:700; }
.category-tree a:hover, .category-tree a[aria-current="page"] { color:var(--brand); background:transparent; }
