/* Mobile keeps its familiar floating controls and bottom sheets. */
.viewer-sidebar{display:contents}
@media(min-width:1024px){
  .column-viewer .full-viewer{--viewer-sidebar-width:clamp(300px,25vw,340px)}
  .column-viewer .stage{inset:0 var(--viewer-sidebar-width) 0 0}
  .column-viewer .viewer-sidebar{display:flex;flex-direction:column;position:absolute;z-index:1;top:calc(var(--header) + env(safe-area-inset-top));right:0;bottom:0;width:var(--viewer-sidebar-width);padding:24px 26px max(24px,env(safe-area-inset-bottom));gap:26px;overflow-y:auto;overscroll-behavior:contain;border:0;background:transparent}
  .column-viewer .viewer-sidebar>*{flex-shrink:0;min-width:0}
  .models-page .model-heading{position:static;inset:auto;display:flex;flex-direction:column;gap:14px;pointer-events:auto}
  .models-page .model-heading h1{font-size:34px;line-height:1.15;max-width:100%;overflow-wrap:anywhere}
  .models-page .variant-field{margin:0;max-width:100%;width:100%}
  .models-page .variant-field select{width:100%;max-width:100%;min-height:44px}
  .column-viewer .animation-bar{position:static;inset:auto;display:grid;grid-template-columns:1fr 1fr;gap:8px;max-width:none;width:100%}
  .column-viewer .animation-status{display:block;grid-column:1/-1;max-width:100%;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}
  .column-viewer #choose-animation{grid-column:1/-1}
  .column-viewer .animation-bar button{min-width:0;padding:9px 10px}
  .column-viewer .viewer-bar{position:static;inset:auto;display:flex;flex-direction:column;align-items:stretch;gap:16px;width:100%;margin-top:auto;pointer-events:auto}
  .column-viewer .browse-trigger{width:100%;padding:12px 14px}
  .column-viewer .view-controls{justify-content:center;flex-wrap:wrap}
  .knight-page.column-viewer .stage{--builder-framing-top-extra:16px;--builder-framing-bottom:16px}
  .knight-page .knight-heading{position:static;inset:auto;display:flex;flex-direction:column;align-items:stretch;gap:14px;pointer-events:auto}
  .knight-page .knight-heading h1{font-size:32px;margin:0}
  .knight-page .profile-controls{display:grid;grid-template-columns:1fr 1fr;gap:12px}
  .knight-page .profile-controls label{min-width:0}
  .knight-page .profile-controls label:last-child{grid-column:1/-1}
  .knight-page .profile-controls select{width:100%;max-width:100%;min-width:0}
  .knight-page .profile-note{position:static;inset:auto;text-align:left;margin:0}
  .knight-page #toggle-controls{grid-column:1/-1}
  .knight-page .touch-controls{position:static;inset:auto;width:100%;max-height:none;overflow:visible;padding:12px 10px}
}

/* Pointer focus must not resemble a separator between the two columns. */
.stage canvas[data-focus-intent="pointer"]:focus{outline:none}
.stage canvas[data-focus-intent="keyboard"]:focus{outline:2px solid #92722c;outline-offset:-5px}

/* Two compact facets share the existing single-scroll gallery sheet. */
#model-browser .sheet-head{min-width:0}
.model-filter-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;max-width:700px;margin-top:14px}
.model-filter-fields label{display:flex;flex-direction:column;gap:4px;min-width:0;font-size:14px;line-height:1.3;color:#655f50}
.model-filter-fields select{width:100%;min-width:0;min-height:44px;padding:9px 28px 9px 10px;border:1px solid #c9c0aa;background:#fdfbf5;color:#3e4036;font-size:16px;line-height:1.3}
.model-filter-summary{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 0}
.model-result-summary{display:flex;align-items:baseline;flex-wrap:wrap;gap:2px 12px;min-width:0;font-size:14px;line-height:1.4}
#result-count{color:#514d40}
#active-filters{color:#736b57;overflow-wrap:anywhere;max-width:100%}
#clear-filters{flex:none;border:0;background:none;color:#796022;text-decoration:underline;text-underline-offset:3px;min-height:44px;padding:8px 4px;font-size:14px}
#clear-filters[aria-disabled="true"]{color:#827e72;cursor:default;text-decoration:none}
#model-browser .asset-subtitle{overflow-wrap:anywhere}
@media(max-width:600px){
  .model-filter-fields{gap:10px;margin-top:12px}
  .model-filter-fields select{font-size:16px;padding-left:8px;padding-right:22px}
  .model-result-summary{display:block}
  #active-filters{display:block;font-size:13px}
  #model-browser .sheet-title{margin-bottom:10px}
}
/* On a short viewport or enlarged text, let the header scroll away so results
   remain reachable. There is still only one scrolling surface: the dialog. */
@media(max-height:560px){#model-browser .sheet-head{position:static}}

/* Isolated weapon effect controls never replace animation controls. */
.ib2-pulse-controls{position:fixed;z-index:4;right:max(18px,env(safe-area-inset-right));bottom:max(86px,calc(env(safe-area-inset-bottom) + 68px));display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px;max-width:min(72vw,480px)}
.ib2-pulse-controls[hidden]{display:none}.ib2-pulse-controls p{flex-basis:100%;margin:0;text-align:right;font-size:12px;color:#6c6553;line-height:1.3}.ib2-pulse-controls button{min-height:40px;padding:7px 12px;border:1px solid #aaa38eaa;background:#f7f5edeb;color:#5e5a4e;font-size:13px}.ib2-pulse-controls button:focus-visible{outline:2px solid #826a34;outline-offset:2px}
@media(max-width:700px){.ib2-pulse-controls{right:max(12px,env(safe-area-inset-right));bottom:max(60px,calc(env(safe-area-inset-bottom) + 48px));max-width:calc(100vw - 132px)}}

/* A uniform, stage-only display backdrop; the blade lighting stays unchanged. */
.models-page #stage.ib2-dark-backdrop{background:#212121}
.models-page #stage.ib2-dark-backdrop #model-name{visibility:hidden}
.ib2-backdrop-toggle{display:flex;align-items:center;gap:6px;min-height:40px;padding:7px 10px;border:1px solid #aaa38eaa;background:#f7f5edeb;color:#5e5a4e;font-size:13px;cursor:pointer}
.ib2-backdrop-toggle input{width:16px;height:16px;margin:0;accent-color:#826a34}
.ib2-pulse-controls[data-dark-backdrop="true"] p{color:#e4ddcb}
.ib2-pulse-controls button:disabled{opacity:.55;cursor:default}
