dialog:has(#allUnits){
  width:min(97vw,1550px);max-width:98vw;max-height:97vh;
  padding:clamp(6px,1.2vw,22px);scrollbar-width:thin
}
#sheet:has(#allUnits){gap:3px}
#sheet:has(#allUnits)>.row:first-child{padding:0;background:none;position:static}
#sheet #rosterCrest{display:inline-block;vertical-align:middle;margin-right:.4em;height:1.25em;width:auto}
#allUnits{
  --unitcol:20%;--pricecol:9%;--pincol:6%;
  font:clamp(13px,min(1.17vw,2vh),18px)/1.23 'Segoe UI',sans-serif;
  min-width:0;font-variant-numeric:tabular-nums
}
#allUnits .rHint{margin-bottom:.7em;color:#d3e0e9}
#allUnits table{width:100%;border-collapse:collapse}
#allUnits tr{
  display:grid;align-items:center;cursor:pointer;
  grid-template-columns:var(--unitcol) repeat(7,minmax(0,1fr)) var(--pricecol) 26% var(--pincol);
  text-align:center
}
#allUnits td,#allUnits th{padding:0;min-width:0}
#allUnits thead tr{cursor:default;background:#122131;color:var(--gold);padding:.48em 0;border-bottom:1px solid #997c54}
#allUnits thead th:first-child{text-align:left;padding-left:1em}
#allUnits thead abbr{display:none}
#allUnits tbody tr{
  background:linear-gradient(98deg,color-mix(in srgb,var(--tint) 14%,#192c3d),#1a2a39 25%);
  border-bottom:1px solid #405463;min-height:min(9.3vh,94px);
}
#allUnits tbody tr:nth-child(even){background-color:#162536;background-image:linear-gradient(98deg,color-mix(in srgb,var(--tint) 10%,#192939),transparent 25%)}
#allUnits tbody tr:hover,#allUnits tbody tr:focus-within{box-shadow:inset 0 0 0 1px #79a0b6}
#allUnits tbody tr.refUnit{background:linear-gradient(105deg,#605039,#39372e 45%);box-shadow:inset 4px 0 var(--gold)}
#allUnits .rosterUnit button{
  font:700 1.13em/1.13 'Segoe UI',sans-serif;
  display:flex;align-items:center;gap:.32em;text-align:left;
  width:100%;padding:1px .34em;white-space:normal;background:transparent;border:none
}
#allUnits button:focus-visible{outline-offset:-2px}
#allUnits .rosterUnit small{display:block;color:#cad6dc;font-weight:400;font-size:.84em;margin-top:.25em}
#sheet #allUnits canvas{width:min(8.6vh,5vw,82px);height:auto}
#allUnits .rStat{font-weight:600;white-space:nowrap}
#allUnits .rStat span{color:#ffe09b}
#allUnits .rNeeds{color:#d8c393}
#allUnits .rSkill{text-align:left;padding:.2em .4em}
#allUnits td.rSkill{color:#e0e8ef}
#allUnits .rToggle button{font-size:inherit;padding:.4em .18em;width:85%;border-bottom-width:1px}
#allUnits .rToggle [aria-pressed=true]{color:#241c1f;background:var(--gold)}
#allUnits.guardians tr{grid-template-columns:25% repeat(5,minmax(0,1fr)) 33% 7%}
dialog:has(#allUnits.guardians){max-width:1100px}
@media(max-width:1130px) {
  #allUnits thead span{display:none}
  #allUnits thead abbr{display:inline}
}
@media(max-width:949px){
  #allUnits{--unitcol:26%;--pricecol:16%;--pincol:8%;font-size:clamp(12px,1.7vw,15px)}
  #allUnits tr{grid-template-columns:var(--unitcol) repeat(7,minmax(0,1fr)) var(--pricecol) var(--pincol)}
  #allUnits thead .rSkill{display:none}
  #allUnits tbody tr{padding:.25em 0}
  #allUnits .rosterUnit{grid-row:1/3;grid-column:1}
  #allUnits .rToggle{grid-row:1/3;grid-column:10}
  #allUnits td.rSkill{grid-column:2/10;padding:0 .35em}
  #allUnits.guardians tr{grid-template-columns:30% repeat(5,minmax(0,1fr)) 10%}
  #allUnits.guardians .rToggle{grid-column:7}
  #allUnits.guardians td.rSkill{grid-column:2/7}
  #allUnits .rNeeds{font-size:.98em}
  #allUnits .rosterUnit small{margin-top:1px}
  #sheet #allUnits canvas{width:min(7vh,6vw)}
}
@media(max-height:680px){
  dialog:has(#allUnits){padding:6px}
  #sheet:has(#allUnits)>.row:first-child h2{font-size:1.35rem;margin:0}
  #sheet:has(#allUnits)>.row:first-child button{padding:.21rem .5rem}
  #allUnits{font-size:12px;line-height:1.12}
  #allUnits .rHint{margin-bottom:.25em}
  #allUnits thead tr{padding:.25em 0}
  #allUnits tbody tr{min-height:9vh;padding:1px 0}
}
