/*
 Root-cause correction:
 the portal has a generic `table { min-width:920px }` rule.
 That was still forcing Form A wider than its A4 content area even when
 all 13 column percentages totalled 100%.
*/
#formAPrint table.fa98-grid{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  table-layout:fixed!important;
  border-collapse:collapse!important;
  box-sizing:border-box!important;
  margin-left:0!important;
  margin-right:0!important;
}
#formAPrint .fa98-table-wrap{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}
#formAPrint .fa98-sheet{
  width:210mm!important;
  max-width:210mm!important;
  min-width:0!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
}

/* Synced 13-column geometry = exactly 100%.
   Close to the blank statutory template, but adjusted for real data. */
#formAPrint .fa98-grid col:nth-child(1){width:4.2%!important}
#formAPrint .fa98-grid col:nth-child(2){width:10.5%!important}
#formAPrint .fa98-grid col:nth-child(3){width:9.8%!important}
#formAPrint .fa98-grid col:nth-child(4){width:13.0%!important}
#formAPrint .fa98-grid col:nth-child(5){width:4.5%!important}
#formAPrint .fa98-grid col:nth-child(6){width:7.5%!important}
#formAPrint .fa98-grid col:nth-child(7){width:6.5%!important}
#formAPrint .fa98-grid col:nth-child(8){width:8.0%!important}
#formAPrint .fa98-grid col:nth-child(9){width:7.5%!important}
#formAPrint .fa98-grid col:nth-child(10){width:6.3%!important}
#formAPrint .fa98-grid col:nth-child(11){width:6.0%!important}
#formAPrint .fa98-grid col:nth-child(12){width:6.5%!important}
#formAPrint .fa98-grid col:nth-child(13){width:9.7%!important}

/* Keep readable type. Content may wrap to 2–3 lines instead of shrinking excessively. */
#formAPrint .fa98-grid th{
  font-size:5.8px!important;
  line-height:1.08!important;
  padding:1.4px .9px!important;
  height:31px!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
}
#formAPrint .fa98-grid td{
  font-size:6.1px!important;
  line-height:1.1!important;
  padding:1.5px 1.1px!important;
  min-width:0!important;
  max-width:100%!important;
  white-space:normal!important;
  overflow:hidden!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  vertical-align:middle!important;
  height:28px!important;
}
#formAPrint .fa98-grid td:nth-child(2),
#formAPrint .fa98-grid td:nth-child(3),
#formAPrint .fa98-grid td:nth-child(4),
#formAPrint .fa98-grid td:nth-child(8),
#formAPrint .fa98-grid td:nth-child(13){
  font-size:6.0px!important;
}
#formAPrint .fa98-grid td:nth-child(5),
#formAPrint .fa98-grid td:nth-child(6),
#formAPrint .fa98-grid td:nth-child(7){
  font-size:5.8px!important;
  text-align:center!important;
}
#formAPrint .fa98-grid td.money{
  font-size:5.9px!important;
  white-space:nowrap!important;
  padding-left:.5px!important;
  padding-right:.5px!important;
}

/* If a very long token occurs, wrap it without widening the table. */
#formAPrint .fa98-grid td *{
  max-width:100%!important;
  min-width:0!important;
}

/* Preview should show the whole A4 sheet rather than a 920px forced table. */
#formAPrint{
  overflow-x:auto!important;
}
@media print{
  #formAPrint .fa98-sheet{
    width:210mm!important;
    max-width:210mm!important;
    min-width:210mm!important;
  }
  #formAPrint table.fa98-grid{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }
}
