#summaryNotice:empty,#summaryMeta:empty {display:none}
#summaryPanel .card {margin-bottom:16px}
#summaryControls .form-grid {margin:0;max-width:720px}
#summaryMeta {margin:14px 0 0;color:#40594e}
.account-section h2 {display:flex;align-items:center;justify-content:space-between;gap:12px}
.account-section h2 small {font-size:.85rem;font-weight:normal;color:#395846}
.account-grid {overflow-x:auto}
.account-grid table {width:100%;border-collapse:collapse;text-align:left}
.account-grid th {background:#edf3ee;color:#365447;font-size:.89rem}
.account-grid td,.account-grid th {padding:12px 9px;border-bottom:1px solid #dde5df;vertical-align:top}
.account-grid th:nth-child(4),.account-amount {text-align:right;font-variant-numeric:tabular-nums}
.account-grid td:nth-child(n+3),.account-grid td:first-child {white-space:nowrap}
.account-amount {color:#175b47;font-weight:bold}
.account-grid details {margin-top:5px;color:#416151;font-size:.85rem}
.account-grid summary {cursor:pointer}
.account-grid details ul {padding-inline-start:1.25em}
.account-conditions,.account-missing span {display:block;color:#4b6255;font-size:.9rem}
.account-missing {list-style:none;padding:0;margin:0}
.account-missing li {padding:9px 0;border-top:1px solid #dde5df}
#summaryActions:not([hidden]) {display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.summary-download {display:inline-block;padding:9px 16px;border-radius:8px;background:#176752;color:white;text-decoration:none}
.account-print-only {display:none}
#summaryActions .account-print-option:not([hidden]) {display:inline-flex;align-items:center;gap:.5em;margin:0}
#summaryActions input[type=checkbox] {width:auto;margin:0}
@media(max-width:700px) {
  #summaryPanel .account-section {padding:14px}
  .account-grid th,.account-grid td {padding:8px 5px}
  .account-grid td:nth-child(2) {min-width:145px}
}
.account-grid td:first-child,.account-grid th:first-child {min-width:0;width:3.2rem}
.account-grid td:nth-child(2) {width:45%}
.account-grid details {padding:0;border:0}
.account-missing li {display:grid;grid-template-columns:1fr auto;align-items:center;column-gap:12px}
.account-missing li span {grid-column:1}
.account-missing li button {grid-column:2;grid-row:1 / span 2}


/* Match the bound estimate book. A named page keeps other reports independent. */
@page unitRateAccount {
  size:A4 portrait;
  margin:25mm 20mm 20mm 30mm;
  @bottom-right {
    content:"หน้า " counter(page) " / " counter(pages);
    font:400 16pt "TH Sarabun New",Sarabun,sans-serif; color:#000;
  }
}
@media print {
  body:has(#summaryPanel:not([hidden])) {page:unitRateAccount;background:white;color:black}
  body:has(#summaryPanel:not([hidden])) > :not(.app-layout),
  body:has(#summaryPanel:not([hidden])) .app-layout > :not(main),
  body:has(#summaryPanel:not([hidden])) main > :not(#summaryPanel),
  #summaryPanel :is(.summary-context,#summaryActions,details,button) {display:none!important}
  body:has(#summaryPanel:not([hidden])) :is(.app-layout,#workspace,#summaryPanel) {
    display:block!important;width:auto;max-width:none;min-width:0;min-height:0;
    padding:0;margin:0;border:0;box-shadow:none;overflow:visible;background:white;
  }
  #summaryPanel {font:400 16pt/1.3 "TH Sarabun New",Sarabun,sans-serif;color:black}
  #summaryPanel .account-print-only {display:block}
  #summaryPanel .account-screen-conditions {display:none!important}
  #summaryPanel .account-paper-head {text-align:center;margin:0 0 6mm;break-inside:avoid;break-after:avoid}
  #summaryPanel h1 {color:black;font:bold 18pt/1.25 "TH Sarabun New",Sarabun,sans-serif;margin:0 0 3mm}
  #summaryPanel .account-paper-head p {color:black;font-size:16pt;margin:1mm 0}
  #summaryPanel .account-paper-head .account-project-name {font-size:16pt;font-weight:bold}
  #summaryPanel .card {padding:0;margin:0 0 5mm;background:white;border:0;border-radius:0;box-shadow:none}
  #summaryPanel h2 {display:block;color:black;font:bold 16pt/1.3 "TH Sarabun New",Sarabun,sans-serif;margin:3mm 0 2mm;break-after:avoid}
  #summaryPanel h2 small {color:black;font:400 16pt "TH Sarabun New",Sarabun,sans-serif;margin-left:3mm}
  #summaryPanel .account-grid {overflow:visible}
  #summaryPanel table {width:100%;min-width:0;table-layout:fixed;border-collapse:collapse;font:400 16pt/1.3 "TH Sarabun New",Sarabun,sans-serif}
  #summaryPanel thead {display:table-header-group}
  #summaryPanel tr {break-inside:avoid}
  #summaryPanel :is(td,th) {font:inherit;color:black;background:white;padding:1.5mm 2mm;border:0.25mm solid #333;min-width:0;white-space:normal;overflow-wrap:anywhere}
  #summaryPanel th {font-weight:bold;text-align:center;vertical-align:middle}
  #summaryPanel th:first-child {width:13%}
  #summaryPanel th:nth-child(2) {width:36%}
  #summaryPanel th:nth-child(3) {width:17%}
  #summaryPanel th:nth-child(4) {width:19%}
  #summaryPanel th:nth-child(5) {width:15%}
  #summaryPanel td:last-child {white-space:nowrap}
  #summaryPanel .account-amount {color:black;text-align:right;font-weight:bold;font-variant-numeric:tabular-nums}
  #summaryPanel .account-conditions,#summaryPanel .account-missing span {color:black;font-size:16pt}
  #summaryPanel .account-missing li {display:block;font-size:16pt;border:0;margin:0;padding:1mm 0;break-inside:avoid}
  #summaryPanel .account-missing span {display:inline;margin-left:3mm}
  #summaryPanel .account-signatures {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3mm;break-inside:avoid;margin:8mm 0 0;text-align:center;font-size:16pt}
  #summaryPanel .account-signatures strong {display:block;margin-bottom:6mm}
  #summaryPanel .account-signatures p {font-size:16pt;color:black;margin:1.5mm 0;overflow-wrap:anywhere}
  #summaryPanel .account-basis {display:none;break-before:page}
  #summaryPanel:has(#summaryIncludeBasis:checked) .account-basis {display:block}
  #summaryPanel .account-basis h3 {font-size:16pt;color:black;margin:4mm 0 1mm;break-after:avoid}
  #summaryPanel .account-basis :is(p,li) {font-size:16pt;line-height:1.4;color:black;margin:1mm 0;overflow-wrap:anywhere}
  #summaryPanel .account-basis ul {margin:0;padding-left:6mm}
}
