/* Estiquote builder's estimate. Uses the tokens in site.css and the .calc-* classes in calculator.css. */
.be-calc { margin: 24px 0 36px; }
.be-grid { grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 20px; }
.be-inputs { gap: 2px; }
.be-row { display: grid; gap: 10px; }
.be-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.be-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.be-field { min-width: 0; }
.be-field-wide { grid-column: 1 / -1; }
.be-num { position: relative; }
.be-num input { padding-right: 44px !important; font-weight: 700; font-variant-numeric: tabular-nums; }
.be-num .calc-unit { right: 12px; font-size: 12.5px; }
.calc-options + .be-row, .calc-options + .calc-check, .calc-hint + .be-row { margin-top: 12px; }
.be-row + .calc-check { margin-top: 6px; }
.be-inputs .calc-hint { margin-top: 6px; }
.calc-option.is-disabled span { opacity: .45; cursor: not-allowed; }
.calc-option.is-disabled:hover span { border-color: var(--border); }
.be-quants-field { padding-bottom: 6px; }
.be-quants { display: grid; gap: 0; margin: 0; font-size: 12.5px; line-height: 1.45; }
.be-quants > div { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.be-quants > div:last-child { border-bottom: 0; }
.be-quants dt { color: var(--muted); }
.be-quants dd { margin: 0; color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* Result panel */
.be-result { padding: 22px; }
.be-headline { font-size: clamp(30px, 3.6vw, 40px); margin-bottom: 4px; }
.be-print-only { display: none; }
.be-planning { margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff; color: var(--text); font-size: 13px; line-height: 1.5; }
.be-planning strong { display: block; color: var(--teal); }
.be-planning-within { border-color: var(--teal); }
.be-planning-above, .be-planning-below { border-color: #b7791f; background: #fff8ea; }
.be-planning-above strong, .be-planning-below strong { color: #8a5a10; }
.be-table-wrap { overflow-x: auto; margin: 0 0 8px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.be-table-wrap:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.be-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13px; line-height: 1.35; }
.be-caption { padding: 10px 12px 8px; color: var(--muted); font-size: 12px; text-align: left; caption-side: top; }
.be-table th, .be-table td { padding: 7px 10px; border-top: 1px solid var(--border); text-align: left; vertical-align: middle; }
.be-table thead th { background: var(--navy-2); color: var(--teal); font-size: 11.5px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; }
.be-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.be-group th { padding: 12px 10px 6px; background: var(--navy); color: var(--text); font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
.be-name span { display: block; color: var(--text); }
.be-band { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.be-unit { color: var(--muted); white-space: nowrap; }
.be-rate-cell { width: 100px; }
.be-rate { width: 92px; min-height: 34px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--navy); color: var(--text); font: inherit; font-size: 13px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.be-rate:focus-visible { outline: 3px solid var(--teal); outline-offset: 1px; }
.be-rate.is-custom { border-color: var(--teal); background: #e3eeea; }
.be-rate.is-outside { border-color: #b7791f; background: #fff3dc; }
.be-rate-print { display: none; }
.be-subtotal td { background: #fbfaf6; color: var(--muted); font-weight: 700; }
.be-subtotal td:first-child { text-align: right; }
.be-table tfoot td { font-weight: 700; }
.be-table tfoot td:first-child { color: var(--muted); text-align: right; }
.be-net td { border-top: 2px solid var(--text); color: var(--text); }
.be-tender td { background: #f1f6f3; color: var(--teal); font-size: 14px; }
.be-total td { border-top: 2px solid var(--text); border-bottom: 2px solid var(--text); color: var(--text); font-size: 15px; font-weight: 850; }
.be-table-hint { display: none; }
.be-split { margin: 0 0 14px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.be-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.be-actions .be-action { width: auto; min-height: 40px; padding: 0 14px; background: #fff; font-size: 13px; cursor: pointer; }
.be-result .calc-note { margin-top: 14px; }
.be-assumptions h3 { margin: 12px 0 6px; color: var(--text); font-size: 13.5px; letter-spacing: -.2px; }
.be-assumptions p { margin: 0 0 6px; color: var(--muted); line-height: 1.5; }
.be-rules, .be-sources { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.5; }
.be-rules li, .be-sources li { margin: 4px 0; }
.be-sources a { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }
.be-offscreen { position: fixed; top: 0; left: -9999px; opacity: 0; }

/* Page sections */
.be-rates-table { min-width: 760px; }
.be-rates-table th, .be-rates-table td { padding: 12px 10px; }
.be-rates-table thead th { white-space: nowrap; }
.be-rates-table td { font-variant-numeric: tabular-nums; }
.be-rates-table td.be-rates-name { white-space: normal; }
.be-rates-table .cell-note { display: block; margin-top: 3px; }
.be-rates-table tbody th[scope="rowgroup"] { background: var(--navy); color: var(--text); font-size: 12px; letter-spacing: .5px; text-transform: uppercase; }

@media (min-width: 901px) {
  .be-result { top: 84px; max-height: calc(100vh - 100px); overflow: auto; }
}
@media (max-width: 900px) {
  .be-grid { grid-template-columns: minmax(0, 1fr); }
  .be-inputs, .be-result { min-width: 0; }
}
@media (max-width: 600px) {
  .be-row-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .be-row-3 > :last-child { grid-column: 1 / -1; }
  .be-quants > div { grid-template-columns: 1fr; gap: 2px; }
  .be-actions .be-action { flex: 1 1 45%; }
  .be-result { padding: 16px; }
  /* Two-line rows: element name on top, then quantity, unit, rate and total. */
  .be-table, .be-table tbody, .be-table tfoot, .be-table caption, .be-table tr, .be-table td, .be-table th { display: block; }
  .be-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .be-table { min-width: 0; }
  .be-table-wrap { overflow: visible; }
  .be-table tbody tr, .be-table tfoot tr { display: grid; grid-template-columns: auto minmax(0, 1fr) 84px 78px; gap: 2px 8px; align-items: center; padding: 8px 10px; border-top: 1px solid var(--border); }
  .be-table td, .be-table th { padding: 0; border: 0; background: none; }
  .be-table tbody tr:not(.be-subtotal) td.num:nth-child(2) { text-align: left; }
  .be-name { grid-column: 1 / -1; }
  .be-group { padding: 12px 10px 4px; background: var(--navy); }
  .be-group th { grid-column: 1 / -1; }
  .be-subtotal { background: #fbfaf6; }
  .be-subtotal td:first-child, .be-table tfoot td:first-child { grid-column: 1 / 4; }
  .be-tender { background: #f1f6f3; }
  .be-net { border-top: 2px solid var(--text) !important; }
  .be-total { border-top: 2px solid var(--text) !important; border-bottom: 2px solid var(--text); }
  .be-rate-cell { width: auto; }
  .be-rate { width: 84px; }
}

@media print {
  .site-header, .site-footer, .skip-link, .breadcrumbs, .guide-heading, .guide-body, .guide-related, .be-inputs, .be-actions, .calc-sticky, .be-caption, .calc-note a { display: none !important; }
  .be-grid { display: block; }
  .be-calc { margin: 0; }
  .be-result { position: static; max-height: none; padding: 0; overflow: visible; border: 0; background: none; }
  .be-print-only { display: block; margin: 0 0 8pt; color: #333; font-size: 10pt; }
  .be-headline, .calc-kicker, .calc-sub, .be-planning, .be-split, .calc-note, .be-assumptions { color: black; }
  .be-rate { display: none; }
  .be-rate-print { display: inline; font-weight: 700; }
  .be-table { min-width: 0; font-size: 10pt; }
  .be-table-wrap { border: 0; overflow: visible; border-radius: 0; }
  .be-table th, .be-table td { padding: 3pt 6pt; border-color: #999; }
  .be-table thead th, .be-group th, .be-subtotal td, .be-tender td { background: #eee; color: black; }
  .be-band { color: #555; }
  .be-planning { border-color: #999; background: none; }
  .be-planning strong { color: black; }
  .be-table tr { break-inside: avoid; }
  .be-assumptions summary { display: none; }
  .guide-shell .be-sources a { color: black; text-decoration: none; }
  .be-sources a::after { content: " (" attr(href) ")"; font-size: 8pt; color: #555; }
  @page { margin: 14mm; }
}
