/* Only the appearance dialog; fixed equipment preview and body controls above independently scrolling panels. */
#appearance[open] { box-sizing:border-box; width:min(715px, calc(100dvw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right))); max-width:none; display:flex; flex-direction:column; min-height:0; height:min(94dvh, 760px); max-height:94dvh; overflow:hidden; }
#appearance .appearance-layout { display:flex; flex:1 1 auto; flex-direction:column; gap:8px; min-height:0; overflow:hidden; }
#appearance .appearance-fixed {
  display:grid; grid-template-columns:minmax(98px,.70fr) minmax(0,1.8fr);
  flex:0 0 auto; gap:9px; align-items:start; border-bottom:1px solid var(--line); padding-block:2px 7px;
}
#appearance .appearance-stage { position:static; display:grid; grid-template-columns:1fr; padding:4px 5px; gap:3px; }
#appearance .appearance-stage canvas { width:min(100%, 117px, 18dvh); }
#appearance .appearance-stage:has(.weapon-skin-preview-name:not([hidden])) canvas { width:min(100%, 117px, 18dvh); }
#appearance .appearance-stage-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:4px; }
#appearance .appearance-stage-actions .workbench-open { min-height:30px; padding:3px 7px; white-space:nowrap; font-size:11px; }
#appearance .weapon-skin-preview-name { min-width:0; max-width:100%; overflow-wrap:anywhere; font-size:10px; }
#appearance .appearance-base { min-width:0; }
#appearance .appearance-base .appearance-group { margin:0; padding:5px; }
#appearance .appearance-base .appearance-option label { min-height:44px; gap:1px; padding:4px 1px; }
#appearance .appearance-base .appearance-option canvas { width:min(100%, 40px, 6.5dvh); height:auto; }
#appearance .appearance-base .appearance-purchase { width:100%; min-height:33px; margin-top:4px; }
#appearance .appearance-base .appearance-help { margin:5px 0 0; line-height:1.33; }
#appearance .appearance-tabs { display:grid; flex:0 0 auto; grid-template-columns:repeat(5,minmax(0,1fr)); gap:4px; }
#appearance .appearance-tabs button { padding:3px 2px; min-width:0; min-height:32px; font-size:12px; line-height:1.15; white-space:normal; border-radius:3px; }
#appearance .appearance-tabs button[aria-selected="true"] { background:#294237; color:var(--ink); border-color:#92bfa6; box-shadow:inset 0 -2px #92bfa6; }
#appearance .appearance-panel { flex:1 1 auto; min-height:0; overflow:auto; overscroll-behavior:contain; padding:3px 3px 7px 0; scrollbar-gutter:stable; }
#appearance .appearance-panel .appearance-group { margin-top:0; min-width:0; }
#appearance .appearance-panel .appearance-group:not([hidden]) { min-inline-size:0; }
#appearance .appearance-summary { position:static; }
@media (min-width:500px) and (max-height:550px) {
  #appearance[open] { height:96dvh; max-height:96dvh; padding-block:5px; }
  #appearance .appearance-fixed { grid-template-columns:minmax(170px,1fr) minmax(0,1.5fr); gap:6px; padding-block:0 4px; }
  #appearance .appearance-stage { grid-template-columns:auto 1fr; justify-content:start; min-height:61px; }
  #appearance .appearance-stage canvas, #appearance .appearance-stage:has(.weapon-skin-preview-name:not([hidden])) canvas { width:min(67px,16dvh); }
  #appearance .appearance-base .appearance-option label { min-height:34px; display:flex; flex-flow:row nowrap; align-items:center; justify-content:center; gap:2px; }
  #appearance .appearance-base .appearance-option canvas { width:24px; }
  #appearance .appearance-base .appearance-help { font-size:10px; }
  #appearance .appearance-tabs { grid-template-columns:repeat(10,minmax(0,1fr)); }
  #appearance .appearance-tabs button { min-height:34px; font-size:11px; }
}
@media (max-width:499px), (max-width:649px) and (min-height:551px) {
  #appearance[open] { padding-block:8px; }
  #appearance .appearance-fixed { grid-template-columns:minmax(96px,.77fr) minmax(0,1.65fr); gap:6px; }
  #appearance .appearance-stage canvas, #appearance .appearance-stage:has(.weapon-skin-preview-name:not([hidden])) canvas { width:min(100%,92px,15dvh); }
  #appearance .appearance-stage-actions .workbench-open { min-height:32px; padding-inline:4px; }
  #appearance .appearance-base .appearance-help { font-size:10px; }
  #appearance .appearance-tabs button { min-height:36px; font-size:11px; }
}

@media (min-width:500px) and (max-height:550px) {
  #appearance > .dialog-heading { margin:0 0 4px; padding:0; }
  #appearance > .dialog-heading h2 { font-size:16px; margin:0; }
  #appearance > .dialog-heading .icon-button { min-width:36px; min-height:34px; width:36px; height:34px; }
  #appearance .appearance-layout { gap:5px; }
  #appearance .appearance-base .appearance-group { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:5px; padding:2px 0 0; }
  #appearance .appearance-base .appearance-purchase { min-height:30px; width:auto; padding:3px 7px; }
  #appearance .appearance-base .appearance-help { margin:3px 0 0; line-height:1.2; }
  #appearance .appearance-summary { padding:3px 0 0; }
  #appearance .appearance-summary p { margin:0; font-size:11px; line-height:15px; }
  #appearance .appearance-tabs button { min-height:30px; }
}
