.bal { --navy:#0B2343; --gold:#c8a46a; --peach:#EACFAD; --cream:#F7EFE2; font:16px/1.5 Arial,sans-serif; color:var(--navy); background:var(--cream); padding:24px; max-width:1200px; margin:auto; }
.bal *, .bal *::before, .bal *::after { box-sizing:border-box; }
.bal h2,.bal h3,.bal p { color:inherit; margin:0 0 16px; padding:0; line-height:1.4; }
.bal h2 { font-size:30px; } .bal h3 { font-size:20px; border-bottom:2px solid var(--gold); padding-bottom:10px; }
.bal .bal-hero:not(.tba-tool-header){ background:var(--navy); color:var(--cream); padding:32px; border-radius:12px; margin-bottom:22px; }
/* Normal tool header; no theme, form, document or restriction-panel rules. */
.bal > .tba-tool-header { background:#0B2343; color:#F7EFE2; padding:30px; border-radius:16px; margin:0 0 24px; font-family:Arial,sans-serif; box-sizing:border-box; overflow-wrap:anywhere; }
.bal > .tba-tool-header > p:first-of-type { color:#F7EFE2; font:400 12px/1.6 Arial,sans-serif; letter-spacing:2px; margin:0 0 12px; padding:0; }
.bal > .tba-tool-header > h2 { color:#F7EFE2; font:700 clamp(28px,4vw,40px)/1.3 Arial,sans-serif; letter-spacing:normal; margin:0 0 12px; padding:0; }
.bal > .tba-tool-header > p:last-of-type { color:#F7EFE2; font:400 16px/1.6 Arial,sans-serif; letter-spacing:normal; margin:0; padding:0; }
@media(max-width:600px) { .bal > .tba-tool-header { padding:20px; } }

.bal .bal-hero:not(.tba-tool-header) p{ color:var(--peach); font-size:12px; letter-spacing:2px; }
.bal .bal-card { background:#fff; padding:24px; border:1px solid var(--peach); border-radius:12px; margin:18px 0; }
.bal .bal-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr)); gap:16px; }
.bal .bal-row { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(150px,100%),1fr)); gap:12px; margin-bottom:12px; }
.bal .bal-item { background:var(--cream); padding:16px; border-radius:9px; border:1px solid var(--peach); }
.bal label { display:flex; flex-direction:column; gap:6px; color:var(--navy); font-size:14px; font-weight:600; margin-bottom:12px; }
.bal input,.bal select,.bal textarea { color:var(--navy); background:#fff; border:1px solid #8a7350; border-radius:6px; width:100%; min-height:44px; font:inherit; padding:10px; }
.bal textarea { min-height:88px; resize:vertical; }
.bal input[type=file] { padding:8px; }
.bal button,.bal .bal-link { display:inline-block; font:600 14px/1.4 Arial,sans-serif; min-height:44px; border:2px solid var(--navy); border-radius:7px; background:var(--navy); color:var(--cream); padding:11px 16px; cursor:pointer; text-decoration:none; }
.bal button:hover,.bal .bal-link:hover { background:var(--gold); color:var(--navy); }
.bal button.bal-secondary { background:var(--cream); color:var(--navy); border-color:var(--gold); }
.bal button:disabled { opacity:.5; cursor:not-allowed; }
.bal :focus-visible { outline:3px solid var(--navy); outline-offset:3px; }
.bal .bal-actions { display:flex; flex-wrap:wrap; gap:10px; margin:16px 0; }
.bal .bal-notice { padding:14px 18px; background:var(--peach); color:var(--navy); border-radius:8px; margin:12px 0; white-space:pre-wrap; }
.bal .bal-error { border-left:5px solid #a32222; }
.bal .bal-help { font-size:13px; margin:8px 0 16px; }
.bal .bal-total { background:var(--navy); color:var(--cream); padding:24px; border-radius:10px; }
.bal .bal-total strong { color:var(--peach); font-size:34px; display:block; overflow-wrap:anywhere; }
.bal dl { margin:0; } .bal dl div { display:flex; justify-content:space-between; gap:16px; padding:9px 0; border-bottom:1px solid var(--peach); }
.bal dd { margin:0; text-align:right; font-weight:bold; }
.bal .bal-scroll { overflow:auto; }
.bal table { width:100%; border-collapse:collapse; text-align:left; font-size:14px; }
.bal th { background:var(--navy); color:var(--cream); padding:12px; }
/* Keep document column labels readable when the theme overrides table headings. */
.bal .bal-doc table thead th { background:#0B2343 !important; color:#F7EFE2 !important; -webkit-text-fill-color:#F7EFE2 !important; font-weight:700; }
.bal td { padding:12px; border-bottom:1px solid var(--peach); overflow-wrap:anywhere; }
.bal .bal-doc { padding:24px; border:1px solid var(--gold); margin:20px 0; background:#fff; white-space:normal; }
.bal .bal-doc p { white-space:pre-wrap; }
.bal .bal-acceptance { border:2px solid var(--gold); background:var(--cream); }
.bal .bal-acceptance button { background:var(--gold); color:var(--navy); }
.bal .bal-doc { overflow-wrap:anywhere; }
.bal .bal-doc-header { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:24px; border-bottom:3px solid var(--gold); padding-bottom:20px; margin-bottom:24px; }
.bal .bal-doc-header h2 { font-size:26px; color:var(--navy); }
.bal .bal-doc-meta { text-align:right; }
.bal .bal-doc-meta p { font-size:13px; }
.bal .bal-doc-status { display:inline-block; border:1px solid var(--gold); padding:4px 10px; font-size:12px; font-weight:700; color:var(--navy); }
.bal .bal-doc-client { margin-bottom:24px; }
.bal .bal-doc-client h3 { font-size:14px; text-transform:uppercase; border:0; padding:0; }
.bal .bal-doc-project { font-weight:700; }
.bal .bal-doc-footer { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:28px; margin-top:24px; }
.bal .bal-doc-footer h3 { font-size:15px; }
.bal .bal-doc-footer p { font-size:13px; }
.bal .bal-doc .bal-doc-totals { width:100%; max-width:400px; margin:0 0 0 auto; padding:0; justify-self:end; text-align:right; }
.bal .bal-doc .bal-doc-totals div { display:grid; grid-template-columns:minmax(0,1fr) minmax(9ch,max-content); gap:16px; align-items:baseline; }
.bal .bal-doc .bal-doc-totals dt { text-align:right !important; margin:0; padding:0; }
.bal .bal-doc .bal-doc-totals dd { text-align:right !important; margin:0; padding:0; white-space:nowrap; font-variant-numeric:tabular-nums; }
.bal .bal-doc-totals .bal-doc-emphasis { font-weight:700; border-bottom:2px solid var(--gold); padding:12px 0; }
.bal .bal-doc-closing { border-top:1px solid var(--gold); padding-top:18px; margin-top:28px; font-size:12px; }
@media(max-width:600px) { .bal .bal-doc-header,.bal .bal-doc-footer { grid-template-columns:minmax(0,1fr); gap:16px; } .bal .bal-doc-meta { text-align:left; } }
@media print { .bal .bal-doc-header,.bal .bal-doc-footer { grid-template-columns:minmax(0,1fr) minmax(0,1fr); } .bal .bal-doc-meta { text-align:right; } .bal .bal-doc-totals { break-inside:avoid; } .bal .bal-doc .bal-scroll { overflow:visible; } }
.bal .bal-logo { max-width:180px; max-height:100px; object-fit:contain; }
.bal .bal-doc .bal-grid { grid-template-columns:1fr 1fr; }
.bal [hidden] { display:none !important; }
.bal .bal-fold > summary,.bal .bal-preview-toggle > summary { cursor:pointer; min-height:44px; padding:10px 4px; font-weight:700; color:var(--navy); overflow-wrap:anywhere; }
.bal .bal-fold[open] > summary { border-bottom:1px solid var(--gold); margin-bottom:16px; }
.bal .bal-fold > summary:focus-visible,.bal .bal-preview-toggle > summary:focus-visible { outline:3px solid var(--navy); outline-offset:3px; }
.bal .bal-preview-toggle { border:1px solid var(--gold); padding:12px; border-radius:8px; margin-top:20px; }
.bal .bal-mobile-save { display:none; }
@media(max-width:600px) {
  .bal .bal-mobile-save { display:none; }
  body.admin-bar .bal .bal-mobile-save { top:46px; }
  .bal .bal-mobile-save strong { font-size:15px; overflow-wrap:anywhere; }
  .bal .bal-card:has(> .bal-fold) { padding:12px; }
  .bal .bal-item { padding:10px; }
}
@media print { .bal .bal-mobile-save { display:none; } }
@media(max-width:600px) { .bal { padding:12px; } .bal .bal-hero:not(.tba-tool-header),.bal .bal-card,.bal .bal-doc{ padding:18px; } .bal .bal-doc .bal-grid { grid-template-columns:1fr; } .bal .bal-actions > * { flex:1 1 160px; } .bal h2 { font-size:25px; } }
@media print { .bal { padding:0; max-width:none; background:white; } .bal .bal-doc { border:0; padding:0; } .bal .bal-doc tr { break-inside:avoid; } .bal .bal-doc { print-color-adjust:exact; -webkit-print-color-adjust:exact; } }
/* Print labels remain legible even when background graphics are disabled. */
.bal .bal-nav-mobile,.bal .bal-view-switch { display:none; }
/* App chrome is opt-in only on registered private test pages, at phone widths. */
@media screen and (max-width:600px) {
  .bal .bal-view-switch { display:inline-block; margin-top:10px; min-height:44px; }
  body.bal-mobile-app #main-header,body.bal-mobile-app #top-header,body.bal-mobile-app #main-footer,
  body.bal-mobile-app .et-l--header,body.bal-mobile-app .et-l--footer,body.bal-mobile-app #sidebar,
  body.bal-mobile-app #main-content .container::before,body.bal-mobile-app #main-content .entry-title { display:none !important; }
  body.bal-mobile-app #page-container { padding-top:0 !important; overflow:visible !important; }
  body.bal-mobile-app #main-content .container { width:100% !important; max-width:none !important; padding:0 !important; }
  body.bal-mobile-app #left-area { float:none !important; width:100% !important; padding:0 !important; }
  body.bal-mobile-app #main-content .et_pb_post { margin-bottom:0; }
  body.bal-mobile-app .bal { width:100%; max-width:100%; padding:12px 12px calc(100px + env(safe-area-inset-bottom)); background:#F7EFE2; min-height:100dvh; }
  body.bal-mobile-app .bal .bal-hero:not(.tba-tool-header){ margin:-12px -12px 14px; border-radius:0 0 22px 22px; padding:18px; }
  body.bal-mobile-app .bal .bal-hero:not(.tba-tool-header) h2{ font-size:23px; }
  body.bal-mobile-app .bal .bal-hero:not(.tba-tool-header) p{ font-size:10px; margin-bottom:8px; letter-spacing:1px; }
  body.bal-mobile-app .bal > .bal-notice { font-size:12px; padding:10px 12px; }
  body.bal-mobile-app .bal .bal-card { margin:12px 0; border-radius:16px; box-shadow:0 3px 12px #0b234308; }
  body.bal-mobile-app .bal input,body.bal-mobile-app .bal select,body.bal-mobile-app .bal textarea { font-size:16px; }
  body.bal-mobile-app .bal .bal-grid,body.bal-mobile-app .bal .bal-row { min-width:0; }
  body.bal-mobile-app .bal .bal-grid > *,body.bal-mobile-app .bal .bal-row > * { min-width:0; }
  body.bal-mobile-app .bal .bal-nav { position:fixed; bottom:calc(8px + env(safe-area-inset-bottom)); left:72px; right:8px; z-index:1000; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:2px; margin:0; padding:6px; background:#0B2343; border:1px solid #c8a46a; border-radius:16px; box-shadow:0 -3px 18px #0b234322; }
  body.bal-mobile-app .bal .bal-nav .bal-link { display:flex; align-items:center; justify-content:center; padding:10px 2px; min-width:0; min-height:48px; font-size:12px; border:0; border-radius:9px; color:#F7EFE2 !important; background:transparent; }
  body.bal-mobile-app .bal .bal-nav .bal-link[aria-current=page] { color:#0B2343 !important; background:#EACFAD; }
  body.bal-mobile-app .bal .bal-nav .bal-link:focus-visible { outline:2px solid #F7EFE2; outline-offset:2px; }
  body.bal-mobile-app .bal .bal-nav-desktop { display:none; }
  body.bal-mobile-app .bal .bal-nav-mobile { display:inline; }
  body.bal-mobile-app .bal .bal-mobile-save { box-shadow:0 3px 12px #0b234314; border-radius:12px; }
  body.bal-mobile-app .bal input,body.bal-mobile-app .bal summary { scroll-margin-top:60px; scroll-margin-bottom:110px; }
}
.bal .bal-more-actions { display:contents; }
.bal .bal-short-quantity { display:none; }
@media screen and (max-width:600px) {
  .bal .bal-doc .bal-full-quantity { display:none; }
  .bal .bal-doc .bal-short-quantity { display:inline; }
  .bal .bal-doc .bal-document-table { max-width:100%; overflow-x:auto; }
  .bal .bal-doc .bal-document-table table { min-width:280px; width:100%; table-layout:auto; font-size:13px; }
  .bal .bal-doc .bal-document-table th { padding:10px 5px !important; white-space:nowrap; word-break:normal; overflow-wrap:normal; font-size:12px; }
  .bal .bal-doc .bal-document-table td { padding:10px 5px !important; }
  .bal .bal-doc .bal-document-table td:first-child { overflow-wrap:anywhere; }
  .bal .bal-doc .bal-document-table td:not(:first-child) { white-space:nowrap; overflow-wrap:normal; font-variant-numeric:tabular-nums; }
  .bal .bal-doc .bal-document-table th:nth-child(n+3),.bal .bal-doc .bal-document-table td:nth-child(n+3) { text-align:right; }
}
.bal .bal-more-actions > summary { display:none; }
@media screen and (max-width:600px) {
  .bal .bal-editor-actions { display:grid; grid-template-columns:minmax(0,1fr); gap:10px; }
  .bal .bal-editor-actions > .bal-link { background:transparent; color:var(--navy); border-color:var(--peach); }
  .bal .bal-more-actions { display:block; border:1px solid var(--gold); border-radius:10px; padding:0 12px; }
  .bal .bal-more-actions > summary { display:list-item; cursor:pointer; color:var(--navy); font-weight:600; padding:14px 4px; min-height:48px; }
  .bal .bal-more-actions > button { width:100%; margin-bottom:10px; }
  .bal .bal-more-actions > summary:focus-visible { outline:3px solid var(--navy); }
}
@media screen and (max-width:360px) { body.bal-mobile-app .bal .bal-nav .bal-link { font-size:11px; } }
@media print { .bal .bal-view-switch,.bal .bal-nav { display:none !important; } }
@media print { .bal .bal-doc table thead th { background:#fff !important; color:#0B2343 !important; -webkit-text-fill-color:#0B2343 !important; border-bottom:2px solid #0B2343; } }

/* Dashboard: evenly space the Other business tools links. */
.bal .bal-card:has(> .bal-link[href*="/my-health-check-history/"]) {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
}

.bal .bal-card:has(> .bal-link[href*="/my-health-check-history/"]) > h3 {
  flex: 0 0 100%;
}

.bal .bal-card:has(> .bal-link[href*="/my-health-check-history/"]) > .bal-link {
  margin: 0;
}

/* Dashboard categories only; other tool and document layouts are unchanged. */
.bal[data-bal-view="dashboard"] .bal-dashboard-category { width:100%; }
.bal .bal-dashboard-category .bal-dashboard-label { color:var(--navy); font-family: Arial, sans-serif; font-size:16px; margin:22px 0 12px; }
.bal .bal-dashboard-category .bal-dashboard-grid { grid-template-columns:repeat(auto-fit,minmax(min(220px,100%),1fr)); }
.bal .bal-dashboard-category .bal-dashboard-tool { min-width:0; }
.bal .bal-dashboard-category .bal-dashboard-tool > .bal-link { display:flex; align-items:center; justify-content:center; width:100%; text-align:center; overflow-wrap:anywhere; }
.bal .bal-dashboard-category .bal-dashboard-tool > p { font-size:13px; margin:12px 0 0; }
.bal .bal-dashboard-category .bal-dashboard-records .bal-link { background:var(--cream); color:var(--navy); border-color:var(--gold); }
.bal .bal-dashboard-category .bal-dashboard-records .bal-link:hover { background:var(--gold); }

/* Scoped financial heading font inheritance correction. */
.bal[data-bal-view="quotes"] > .bal-hero > h2,
.bal[data-bal-view="invoices"] > .bal-hero > h2 {
    font-family: Arial, sans-serif;
    font-weight: 700;
}
.bal[data-bal-view="pricing"] .bal-card > h3,
.bal[data-bal-view="quote"] .bal-card > h3,
.bal[data-bal-view="invoice"] .bal-card > h3 {
    font-family: Arial, sans-serif;
}

/* Financial interface headings only; preserve document/export typography. */
.bal > .bal-hero > h2 { font-family: Arial, sans-serif; font-weight: 700; }
.bal .bal-card > h3 { font-family: Arial, sans-serif; }
