.mobile-library-controls, .mobile-card-info, .mobile-card-count, .mobile-cart-icon { display: none; }
@media (max-width:1023px) {
  body.mobile-library { --gutter: var(--mobile-gutter); padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  body.mobile-library :is(.gallery-heading,#bar,.seoc) { display: none; }
  body.mobile-library #filters { display: block; position: relative; inset: auto; width: 100%; max-width: none; height: auto; max-height: none; margin: 0; padding: 0 var(--mobile-gutter); border: 0; background: none; box-shadow: none; transform: none; overflow: visible; z-index: 8; }
  body.mobile-library #filters > :not(.mobile-library-controls) { display: none; }
  body.mobile-library #filters.open > :not(.mobile-library-controls) { display: flex; }
  body.mobile-library #filters.open > :is(.dh,.frow) { display: flex; }
  body.mobile-library #filters.open > .dh { padding-block: 12px; }
  body.mobile-library #filters.open .frow { margin-bottom: 12px; overflow-x: auto; }
  body.mobile-library #filters.open .frow .chip { flex: none; }
  body.mobile-library #drawerBg { display: none; }
  .mobile-library-controls { display: block; }
  .mobile-category-row { display: flex; align-items: center; gap: 10px; padding-top: clamp(14px,3.3vw,31px); }
  .mobile-categories { display: flex; flex: 1; min-width: 0; gap: clamp(7px,1.2vw,12px); overflow-x: auto; scrollbar-width: none; }
  .mobile-categories .mobile-chip { flex: none; min-height: 38px; padding: 8px clamp(14px,2.8vw,27px); border: 0; border-radius: 999px; background: var(--sf); color: var(--tx2); font-size: clamp(14px,2.5vw,24px); font-weight: 550; }
  .mobile-categories .mobile-chip.on { background: var(--ac); color: #fff; }
  .mobile-more { flex: none; width: 38px; height: 38px; padding: 0; border-radius: 50%; background: var(--sf); color: var(--tx); font-size: 26px; }
  .mobile-library-sort { display: flex; align-items: center; gap: 10px; min-width: 0; margin: 13px 0 14px; }
  .mobile-sorts, .mobile-facets { display: flex; align-items: center; min-width: 0; gap: 12px; }
  .mobile-sorts button { position: relative; min-height: 40px; padding: 5px 0; background: none; color: var(--mu); font-size: clamp(12px,2.5vw,24px); white-space: nowrap; }
  .mobile-sorts button.on { color: var(--ac); font-weight: 600; }
  .mobile-sorts button.on::before { content: ''; display: inline-block; width: 3px; height: 14px; margin-right: 7px; border-radius: 2px; background: var(--ac); vertical-align: -2px; }
  .mobile-facets { flex: 1; justify-content: flex-end; gap: 8px; }
  .mobile-facet { min-width: 0; }
  .mobile-facet summary { display: flex; align-items: center; gap: 4px; min-height: 40px; font-size: clamp(12px,2.5vw,24px); color: var(--tx2); cursor: pointer; list-style: none; white-space: nowrap; }
  .mobile-facet summary::-webkit-details-marker { display: none; }
  .mobile-facet > div { position: absolute; z-index: 12; left: 0; right: 0; display: flex; flex-wrap: wrap; gap: 8px; max-height: 45dvh; overflow-y: auto; margin: 4px var(--mobile-gutter); padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg2); box-shadow: var(--sh2); }
  .mobile-facet .mobile-chip { min-height: 36px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 20px; background: var(--sf); color: var(--tx2); font-size: 13px; }
  .mobile-facet .mobile-chip.on { color: var(--ac); border-color: var(--ac); }
  .mobile-grid-toggle { flex: none; display: grid; place-items: center; width: 30px; height: 40px; padding: 5px; background: none; color: var(--tx); }
  .mobile-grid-toggle svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; }
  body.mobile-library #grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: clamp(12px,2.8vw,27px); padding: 0 var(--mobile-gutter) 30px; margin: 0; }
  body.mobile-library[data-mobile-list=true] #grid { grid-template-columns: minmax(0,1fr); }
  body.mobile-library #grid .card { display: block; min-width: 0; margin: 0; border: 0; border-radius: clamp(12px,2.5vw,24px); background: var(--bg2); box-shadow: 0 4px 14px rgb(30 36 48 / .035); overflow: visible; }
  body.mobile-library #grid .card .ph { aspect-ratio: 1; height: auto; border-radius: clamp(12px,2.5vw,24px) clamp(12px,2.5vw,24px) 0 0; overflow: hidden; }
  body.mobile-library #grid .card .ph > img { width: 100%; height: 100%; max-height: none; object-fit: cover; }
  body.mobile-library #grid .card :is(.pose,.depth) > img { object-fit: contain; }
  body.mobile-library #grid .card :is(.info,.angs,.cbtns,.try,.portrait-pick,.badge:not(.age)) { display: none; }
  .mobile-card-count { position: absolute; top: 9px; right: 9px; z-index: 2; display: flex; align-items: center; gap: 4px; padding: 4px 7px; border-radius: 20px; background: rgb(35 40 48 / .4); color: #fff; font-size: clamp(11px,2vw,18px); pointer-events: none; }
  .mobile-card-count svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; }
  .mobile-card-info { display: block; padding: clamp(9px,1.8vw,17px); }
  .mobile-card-info h3 { margin: 0 0 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(14px,2.5vw,24px); font-weight: 550; line-height: 1.5; }
  .mobile-card-bottom { display: flex; align-items: center; gap: 3px; min-height: 30px; }
  .mobile-card-tags { display: flex; flex: 1; gap: 4px; min-width: 0; overflow: hidden; }
  .mobile-card-tags span { flex: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; padding: 2px 5px; border-radius: 14px; background: var(--sf); color: var(--mu); font-size: clamp(10px,2vw,18px); white-space: nowrap; }
  .mobile-card-favorite { flex: none; display: grid; place-items: center; width: 30px; height: 34px; padding: 6px; background: none; color: var(--mu); }
  .mobile-card-favorite svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; }
  .mobile-card-favorite.on { color: var(--ac); }
  .mobile-card-favorite.on svg { fill: var(--acs); }
  .mobile-card-menu { position: relative; flex: none; }
  .mobile-card-menu summary { display: grid; place-items: center; width: 23px; height: 34px; color: var(--tx2); font-size: 24px; cursor: pointer; list-style: none; }
  .mobile-card-menu summary::-webkit-details-marker { display: none; }
  .mobile-card-menu > div { position: absolute; z-index: 15; right: 0; bottom: 100%; width: 150px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); box-shadow: var(--sh2); }
  .mobile-card-menu button { justify-content: flex-start; width: 100%; min-height: 40px; padding: 8px; background: none; color: var(--tx); font-size: 13px; }
  body.mobile-library #workspaceDock:not(:has(#tray:not([hidden]))) { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; transform: none; width: 100%; padding: 12px var(--mobile-gutter) calc(12px + env(safe-area-inset-bottom)); gap: 14px; border: 0; border-radius: 22px 22px 0 0; background: color-mix(in srgb,var(--bg2) 96%,transparent); box-shadow: 0 -6px 24px rgb(30 36 48 / .04); }
  body.mobile-library #workspaceDock > #trayFab { display: flex; flex: 1; min-height: 48px; padding: 8px 10px; gap: 5px; border-radius: 28px; background: var(--sf); font-size: 13px; }
  body.mobile-library #trayFab .dock-mark { width: 24px; height: 24px; margin-right: 4px; background: none; color: var(--tx); }
  body.mobile-library #trayFab .dock-mark svg { width: 22px; height: 22px; }
  body.mobile-library #trayFab .dock-mark > svg:not(.mobile-cart-icon) { display: none; }
  body.mobile-library #trayFab .mobile-cart-icon { display: block; }
  body.mobile-library #trayFab .dock-launch-name { display: none; }
  body.mobile-library #trayFab::before { content: none; }
  body.mobile-library #trayFab #trayFabN { display: flex; flex-direction: row; align-items: center; width: auto; min-width: 0; height: auto; gap: 3px; padding: 0; border: 0; border-radius: 0; background: none; color: var(--tx); font-size: 14px; font-style: normal; white-space: nowrap; }
  body.mobile-library #trayFabN::before { content: attr(data-before); color: var(--mu); font-weight: 400; font-size: 12px; }
  body.mobile-library #trayFabN::after { content: attr(data-after); color: var(--mu); font-weight: 400; font-size: 12px; }
  body.mobile-library #trayFilm { display: none; }
  body.mobile-library #composeFab { flex: 1.1; min-height: 48px; padding: 10px 16px; border-radius: 16px; font-size: 17px; box-shadow: 0 4px 14px rgb(255 36 66 / .12); }
  body.mobile-library #toTop { display: none; }
}
@media (max-width:479px) {
  .mobile-facet:nth-child(n+3) { display: none; }
  .mobile-sorts, .mobile-facets { gap: 8px; }
  .mobile-library-sort { gap: 8px; }
}
@media (min-width:768px) and (max-width:1023px) {
  .mobile-categories .mobile-chip, .mobile-more { min-height: 60px; height: 60px; }
  .mobile-more { width: 60px; font-size: 34px; }
  .mobile-library-sort { margin-block: 26px 30px; }
  .mobile-sorts, .mobile-facets { gap: 32px; }
  .mobile-grid-toggle { width: 40px; }
  .mobile-grid-toggle svg { width: 28px; height: 28px; }
  .mobile-card-favorite { width: 38px; height: 42px; }
  .mobile-card-favorite svg { width: 25px; height: 25px; }
  .mobile-card-menu summary { width: 28px; height: 42px; font-size: 30px; }
  .mobile-card-count { top: 18px; right: 18px; padding: 7px 10px; font-size: 19px; }
  .mobile-card-count svg { width: 19px; height: 19px; }
  body.mobile-library #workspaceDock:not(:has(#tray:not([hidden]))) { padding: 28px var(--mobile-gutter) calc(28px + env(safe-area-inset-bottom)); gap: 28px; border-radius: 38px 38px 0 0; }
  body.mobile-library #workspaceDock > #trayFab, body.mobile-library #composeFab { min-height: 80px; font-size: 26px; }
  body.mobile-library #trayFabN, body.mobile-library #trayFabN::before, body.mobile-library #trayFabN::after { font-size: 23px; }
}
