/* Match the category picker's desktop proportions to Knowtorious, in RTL. */
html:root.ar-preview body #categorySelect .stage-bg{
  box-sizing:border-box;width:100%;max-width:1512px;margin-inline:auto;
  padding:env(safe-area-inset-top,0px) max(40px,env(safe-area-inset-right)) calc(var(--ar-dock-height,160px) + 36px) max(40px,env(safe-area-inset-left))!important;
}
html:root.ar-preview body #categorySelect .ar-page-bar{min-height:66px;margin-bottom:14px;border-bottom:1px solid #d6cab8;gap:10px}
html:root.ar-preview body #categorySelect .ar-category-hero{box-sizing:border-box;min-height:132px;padding:18px 24px;margin-bottom:24px;gap:24px}
html:root.ar-preview body #categorySelect .ar-category-hero h2{font-size:32px;line-height:1.3;margin:5px 0 8px}
html:root.ar-preview body #categorySelect .ar-category-hero p{font-size:14px;line-height:1.65}
html:root.ar-preview body #categorySelect .ar-category-hero span{font-size:12px}
html:root.ar-preview body #categorySelect .ar-category-hero img{width:140px;height:96px}
html:root.ar-preview body #categorySelect .ar-category-layout{grid-template-columns:216px minmax(0,1fr);gap:36px}
html:root.ar-preview body #categorySelect .ar-category-browser{min-width:0}
html:root.ar-preview body #categorySelect .ar-category-sidebar{top:20px;max-height:calc(100svh - var(--ar-dock-height,160px) - 40px)}
html:root.ar-preview body #categorySelect .ar-category-sidebar h3{font-size:14px;margin-bottom:12px}
html:root.ar-preview body #categorySelect .ar-category-sidebar button{font-size:13px;min-height:44px;padding:10px}
html:root.ar-preview body #categorySelect .cat-actions{grid-template-columns:150px auto minmax(0,1fr)!important;gap:12px!important;padding-bottom:14px!important}
html:root.ar-preview body #categorySelect .ar-search-field{grid-column:1/-1!important;grid-row:1!important}
html:root.ar-preview body #categorySelect .ar-size-field{grid-column:1!important;grid-row:2!important}
html:root.ar-preview body #categorySelect .cat-actions .ar-surprise{grid-column:2!important;grid-row:2!important;font-size:14px!important;padding-inline:16px!important}
html:root.ar-preview body #categorySelect #pickTitle{font-size:23px!important;line-height:1.5!important;margin:0 0 8px!important}
html:root.ar-preview body #categorySelect #catPool{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:20px 16px!important}
html:root.ar-preview body #categorySelect .cat-group-head{font:700 16px/1.5 'Thmanyah Text',serif!important;padding:16px 0 10px!important;scroll-margin-top:24px}
html:root.ar-preview body #categorySelect .cat-group-head:first-child{padding-top:4px!important}
html:root.ar-preview body #categorySelect .cat-card{position:relative;border:0!important;background:transparent!important;border-radius:0!important;overflow:visible}
html:root.ar-preview body #categorySelect .cat-cover{aspect-ratio:1!important;height:auto!important;border:2px solid transparent;border-radius:8px!important;box-sizing:border-box;overflow:hidden}
html:root.ar-preview body #categorySelect .cat-card.selected .cat-cover{border-color:var(--cat-accent)}
html:root.ar-preview body #categorySelect .cat-meta{position:static;min-height:42px;padding:8px 0 0!important;border:0!important;justify-content:flex-start;gap:4px;background:transparent!important}
html:root.ar-preview body #categorySelect .cat-name{font-size:14px!important;line-height:1.5!important;padding:0!important}
html:root.ar-preview body #categorySelect .cat-info{inset:6px auto auto 6px!important;width:40px!important;height:40px!important;min-width:40px!important;min-height:40px!important;border-radius:50%!important;background:#fffaf2ed!important;z-index:4}
html:root.ar-preview body #categorySelect .ar-category-empty{grid-column:auto}
html:root.ar-preview body #categorySelect .ar-category-dock{padding:16px max(40px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(40px,env(safe-area-inset-left))}
html:root.ar-preview body #categorySelect .ar-dock-inner{max-width:1432px!important;grid-template-columns:minmax(0,1fr) 180px!important;gap:24px!important;align-items:end}
html:root.ar-preview body #categorySelect #catTrayChips{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:8px!important;overflow:visible!important;padding:2px 2px 7px!important}
html:root.ar-preview body #categorySelect #catTrayChips:has(>.cat-slot:nth-child(3):last-child){grid-template-columns:repeat(3,minmax(0,1fr))!important}
html:root.ar-preview body #categorySelect .cat-slot{width:100%!important;min-width:0!important;max-width:none!important;height:60px!important;box-sizing:border-box}
html:root.ar-preview body #categorySelect .cat-slot__nm{min-width:0;display:-webkit-box!important;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden!important}
html:root.ar-preview body #categorySelect .ar-dock-actions{padding-bottom:7px;gap:6px}
html:root.ar-preview body #categorySelect .ar-dock-actions #buildBtn{min-height:54px!important}
@media(min-width:1450px){html:root.ar-preview body #categorySelect #catPool{grid-template-columns:repeat(5,minmax(0,1fr))!important}}
@media(max-width:1100px){
  html:root.ar-preview body #categorySelect .stage-bg{padding-inline:max(24px,env(safe-area-inset-left)) max(24px,env(safe-area-inset-right))!important}
  html:root.ar-preview body #categorySelect .ar-category-layout{grid-template-columns:185px minmax(0,1fr);gap:24px}
  html:root.ar-preview body #categorySelect #catPool{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:18px 12px!important}
  html:root.ar-preview body #categorySelect .ar-category-dock{padding-inline:24px}
  html:root.ar-preview body #categorySelect .ar-dock-inner{grid-template-columns:minmax(0,1fr) 160px!important;gap:16px!important}
}
@media(max-width:800px){
  html:root.ar-preview body #categorySelect .stage-bg{padding-top:env(safe-area-inset-top,0px)!important;padding-inline:max(16px,env(safe-area-inset-left)) max(16px,env(safe-area-inset-right))!important}
  html:root.ar-preview body #categorySelect .ar-page-bar{min-height:62px;margin-bottom:12px}
  html:root.ar-preview body #categorySelect .ar-category-hero{min-height:116px;padding:16px;gap:14px;margin-bottom:18px}
  html:root.ar-preview body #categorySelect .ar-category-hero h2{font-size:26px}
  html:root.ar-preview body #categorySelect .ar-category-hero p{font-size:13px}
  html:root.ar-preview body #categorySelect .ar-category-hero img{width:84px;height:88px}
  html:root.ar-preview body #categorySelect .ar-category-layout{display:block}
  html:root.ar-preview body #categorySelect .cat-actions{grid-template-columns:minmax(0,1fr) 110px!important;gap:10px!important;padding-bottom:10px!important}
  html:root.ar-preview body #categorySelect .ar-search-field{grid-column:1!important;grid-row:1!important}
  html:root.ar-preview body #categorySelect .cat-actions .ar-surprise{grid-column:2!important;grid-row:1!important;font-size:13px!important;padding-inline:8px!important}
  html:root.ar-preview body #categorySelect .ar-group-field{grid-column:1!important;grid-row:2!important}
  html:root.ar-preview body #categorySelect .ar-size-field{grid-column:2!important;grid-row:2!important}
  html:root.ar-preview body #categorySelect .cat-header{top:env(safe-area-inset-top,0px)!important}
  html:root.ar-preview body #categorySelect .ar-category-dock{padding:10px max(16px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))}
  html:root.ar-preview body #categorySelect .ar-dock-inner{display:block!important}
  html:root.ar-preview body #categorySelect .cat-slot{height:46px!important;padding:3px!important}
  html:root.ar-preview body #categorySelect .cat-slot.filled{justify-content:center}
  html:root.ar-preview body #categorySelect .cat-slot img{width:100%!important;height:100%!important;object-fit:contain}
  html:root.ar-preview body #categorySelect .cat-slot__nm{display:none!important}
  html:root.ar-preview body #categorySelect .ar-dock-actions{padding-bottom:0;margin-top:6px!important}
  html:root.ar-preview body #categorySelect .ar-dock-actions #buildBtn{min-height:44px!important}
}
@media(max-width:600px){
  html:root.ar-preview body #categorySelect #catPool{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:16px 12px!important}
  html:root.ar-preview body #categorySelect .cat-name{font-size:13px!important}
}
@media(orientation:landscape) and (max-height:550px){
  html:root.ar-preview body #categorySelect .ar-page-bar{min-height:50px;margin-bottom:8px}
  html:root.ar-preview body #categorySelect .ar-category-hero{min-height:54px;padding:8px 16px;margin-bottom:10px}
  html:root.ar-preview body #categorySelect .ar-category-hero h2{font-size:23px;margin:0}
  html:root.ar-preview body #categorySelect .ar-category-hero p,html:root.ar-preview body #categorySelect .ar-category-hero img{display:none}
  html:root.ar-preview body #categorySelect .ar-category-layout{display:block}
  html:root.ar-preview body #categorySelect .ar-category-sidebar{display:none}
  html:root.ar-preview body #categorySelect .cat-header{position:static!important}
  html:root.ar-preview body #categorySelect #pickTitle{display:none!important}
  html:root.ar-preview body #categorySelect .cat-actions{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 100px auto!important;padding-bottom:8px!important}
  html:root.ar-preview body #categorySelect .cat-actions .ar-cat-field,html:root.ar-preview body #categorySelect .cat-actions .ar-surprise{display:grid!important;grid-column:auto!important;grid-row:1!important}
  html:root.ar-preview body #categorySelect #catPool{grid-template-columns:repeat(5,minmax(0,1fr))!important}
  html:root.ar-preview body #categorySelect .ar-category-dock{padding-block:8px}
  html:root.ar-preview body #categorySelect .ar-dock-inner{display:grid!important;grid-template-columns:minmax(0,1fr) 160px!important;gap:14px!important}
  html:root.ar-preview body #categorySelect .ar-dock-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:2px!important;margin:0!important;padding:0}
  html:root.ar-preview body #categorySelect .ar-dock-actions .btn{min-height:28px!important}
  html:root.ar-preview body #categorySelect .ar-dock-actions #buildBtn{min-height:40px!important}
  html:root.ar-preview body #categorySelect .cat-slot{height:42px!important}
}
