:root {
  --pfw-blue: #133568;
  --pfw-blue-dark: #263a4f;
  --pfw-gold: #c68a16;
  --pfw-title-row: #f9f4de;
  --pfw-data-row: #fffefa;
  --pfw-subtotal-row: #fbefc7;
  --pfw-line: #eee1c2;
  --pfw-text: #182b3d;
  --pfw-muted: #52677a;
  --pfw-danger: #9c1f24;
}

* { box-sizing: border-box; }
html { color: var(--pfw-text); background: #f3ebd5; font-family: Arial, Helvetica, sans-serif; }
body.financials-single-page { min-width: 0; margin: 0; background: #f3ebd5; color: var(--pfw-text); }
[hidden], #financials-worksheet [hidden], .financials-loading-state[hidden] { display: none; }

/* Titan shell only. */
.tt-header { background: #08294f; border-bottom: 0; }
.tt-header-inner { width: min(1200px, 100%); margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.tt-brand { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.tt-brand img { width: 52px; height: 52px; object-fit: contain; }
.tt-brand-title { color: #fff; font-size: 1.12rem; font-weight: 800; }
.tt-brand-tagline { color: #f3c95f; font-size: .76rem; font-weight: 700; }
.tt-nav { display: flex; justify-content: flex-end; min-width: 0; }
.tt-nav-grid, .tt-nav-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.tt-nav a { padding: 6px 9px; border-radius: 5px; color: #fff; font-size: .78rem; font-weight: 700; text-decoration: none; }
.tt-nav a:hover, .tt-nav a.active { background: rgba(255,255,255,.12); color: #f3c95f; }
.tt-nav-toggle { display: none; }
.tt-hero { padding: 20px; border-bottom: 3px solid #d6ac54; background: #0b3a75; color: #fff; text-align: center; }
.tt-hero h1 { margin: 0; font-size: 1.8rem; }
.tt-hero p { margin: 6px 0 0; color: #f3c95f; font-weight: 700; }
.tt-footer { margin-top: 14px; padding: 18px 20px; background: #08294f; color: #fff; text-align: center; font-size: .75rem; line-height: 1.5; }
.tt-footer .footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 7px; }
.tt-footer a { color: #fff; }

/* One isolated Financials worksheet. */
#financials-worksheet { width: min(1200px, calc(100% - 32px)); min-width: 0; margin: 12px auto 0; padding: 0; overflow: visible; }
#financials-worksheet, #financials-worksheet input, #financials-worksheet select, #financials-worksheet textarea, #financials-worksheet button { font-family: Arial, Helvetica, sans-serif; }
#financials-worksheet .financials-worksheet-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  padding: 14px;
  border: 0;
  border-radius: 12px;
  background: #fff;
}

#financials-worksheet .fin-card,
#financials-worksheet .financials-section {
  width: 100%; min-width: 0; margin: 0; padding: 11px 0 13px;
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
#financials-worksheet .financial-document-actions-card { padding: 0 0 8px; border: 0; border-radius: 0; background: transparent; }
#financials-worksheet h2 { margin: 0 0 8px; color: var(--pfw-blue); font-size: 1.08rem; font-weight: 900; line-height: 1.2; text-align: center; text-transform: none; }
#financials-worksheet h3 { margin: 8px 0 4px; color: var(--pfw-blue); font-size: .86rem; font-weight: 900; line-height: 1.2; text-align: left; }
#financials-worksheet p { margin: 4px 0; }
#financials-worksheet .subtext, #financials-worksheet .small, #financials-worksheet .micro { color: var(--pfw-muted); font-size: .71rem; }
#financials-worksheet .section-heading { display: block; }
#financials-worksheet .section-note-box,
#financials-worksheet .owner-financial-guidance,
#financials-worksheet .occupancy-toggle {
  margin: 5px 0 8px; padding: 10px 12px; border: 1px solid #d6ac54; border-radius: 14px;
  background: #f9eac1; color: #2f2719; font-size: .78rem; line-height: 1.35;
}
#financials-worksheet .owner-financial-guidance { text-align: center; }
#financials-worksheet .owner-financial-guidance > span { display: block; margin: 2px 0; }
#financials-worksheet #income-section > .section-note-box { text-align: center; }
#financials-worksheet .assets-disclaimer { text-align: center; }
#financials-worksheet .assets-disclaimer strong { display: block; margin-top: 5px; color: var(--pfw-danger); font-size: .76rem; font-weight: 900; text-align: center; }
#financials-worksheet .section-note-box.stacked span { display: block; }
#financials-worksheet .income-decrease-question { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 7px; margin: 2px 0 5px; font-size: .76rem; }
#financials-worksheet .income-decrease-question label { display: inline-flex; align-items: center; }
#financials-worksheet .income-decrease-proof { color: var(--pfw-danger); font-size: .75rem; font-weight: 850; text-align: center; }
#financials-worksheet .table-block { min-width: 0; margin: 6px 0 8px; }

/* All worksheet controls are owned here. */
#financials-worksheet label { min-width: 0; color: var(--pfw-blue-dark); font-size: .76rem; font-weight: 400; }
#financials-worksheet input:not([type=checkbox]):not([type=radio]),
#financials-worksheet select,
#financials-worksheet textarea {
  width: 100%; min-width: 0; max-width: 100%; min-height: 28px; margin: 0; padding: 4px 6px;
  border: 0; border-radius: 0; background: transparent; color: var(--pfw-blue-dark); box-shadow: none; font-size: .76rem;
}
#financials-worksheet textarea { min-height: 56px; resize: vertical; }
#financials-worksheet input[readonly] { background: transparent; color: #344b60; }
#financials-worksheet input[type=checkbox], #financials-worksheet input[type=radio] { width: 14px; height: 14px; margin: 0 3px 0 0; }
#financials-worksheet :is(input, select, textarea, button, summary):focus-visible { outline: 2px solid #2d70b5; outline-offset: 1px; }
#financials-worksheet button, #financials-worksheet a.financial-action-back {
  display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 4px 9px;
  border: 1px solid #d0d5da; border-radius: 6px; background: #e8edf0; color: #1f2731;
  font-size: .74rem; font-weight: 800; line-height: 1; text-decoration: none; cursor: pointer;
}
#financials-worksheet button:hover, #financials-worksheet a.financial-action-back:hover { background: #dfe6eb; }
#financials-worksheet :is(#save-button, .tt-save-btn) { border-color: #1554a5; background: #1f6fd1; color: #fff; }
#financials-worksheet :is(.tt-print-btn, .btn-gold, .irs-form-action) { border-color: #a8710f; background: #f3c95f; color: #2e230c; }
#financials-worksheet #financial-document-actions-card .tt-print-btn,
#financials-worksheet .print-report-action { border-color: #d0d5da; background: #e8edf0; color: #1f2731; }
#financials-worksheet #reset-inputs-button { border-color: #08294f; background: #08294f; color: #fff; }
#financials-worksheet .row-remove, #financials-worksheet .owner-record-remove, #financials-worksheet [data-financial-remove-dependent] {
  width: 22px; min-width: 22px; min-height: 22px; padding: 0; border-color: #b34b50; background: #fff; color: var(--pfw-danger); font-size: .9rem;
}
#financials-worksheet .financial-document-actions, #financials-worksheet .save-actions, #financials-worksheet .cta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
#financials-worksheet .financial-document-actions { padding-left: 0; }
#financials-worksheet .cta-row { margin-top: 5px; }

/* Client details. */
#financials-worksheet #household-card { margin-top: 7px; }
#financials-worksheet .import-person-section { margin-top: 8px; }
#financials-worksheet .import-person-grid, #financials-worksheet .import-address-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; }
#financials-worksheet .import-person-grid > label, #financials-worksheet .import-address-grid > label, #financials-worksheet .financial-dependent-row > label { display: grid; align-content: start; gap: 0; min-width: 0; border: 1px solid var(--pfw-line); background: var(--pfw-data-row); }
#financials-worksheet :is(.import-person-grid, .import-address-grid, .financial-dependent-row) > label > span:first-child { min-height: 29px; padding: 6px; background: var(--pfw-title-row); color: #403214; font-size: .76rem; font-weight: 850; line-height: 1.15; }
#financials-worksheet :is(.import-person-grid, .import-address-grid, .financial-dependent-row) > label > :is(input, select, .financial-ssn-entry) { border-radius: 0; }
#financials-worksheet .import-person-grid .prior-name { grid-column: 1 / -1; }
#financials-worksheet .import-client-details-subhead { display: flex; align-items: center; justify-content: space-between; }
#financials-worksheet #financial-dependents-list { display: grid; gap: 0; }
#financials-worksheet .financial-dependent-row { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0; padding: 0; background: var(--pfw-data-row); }
#financials-worksheet .financial-dependent-row > label:nth-of-type(1) { grid-column: span 3; }
#financials-worksheet .financial-dependent-row > label:nth-of-type(2) { grid-column: span 2; }
#financials-worksheet .financial-dependent-row > label:nth-of-type(3) { grid-column: span 3; }
#financials-worksheet .financial-dependent-row > label:nth-of-type(4) { grid-column: span 1; }
#financials-worksheet .financial-dependent-row > label:nth-of-type(5) { grid-column: span 3; padding-right: 28px; }
#financials-worksheet .financial-dependent-row > label:nth-of-type(n+6) { grid-column: span 4; }
#financials-worksheet .financial-dependent-row > [data-financial-remove-dependent] { position: absolute; top: 4px; right: 4px; }
#financials-worksheet .financial-ssn-entry { display: flex; align-items: stretch; min-width: 0; }
#financials-worksheet .financial-ssn-entry input { flex: 1 1 auto; }
#financials-worksheet .financial-ssn-reveal { width: 28px; min-width: 28px; padding: 4px; }
#financials-worksheet .financial-ssn-reveal svg { width: 14px; stroke: currentColor; }
#financials-worksheet [data-phase1-group="household"] .phase1-fields { grid-template-columns: 1fr; }
#financials-worksheet [data-phase1-group="household"] .phase1-fields > label:first-child { grid-column: 1 / -1; }
#financials-worksheet [data-phase1-group="household"] .phase1-record { margin: 0; padding: 0; border: 0; }
#financials-worksheet [data-phase1-group="household"] .phase1-fields { gap: 0; }
#financials-worksheet [data-phase1-group="household"] .phase1-fields > label { display: grid; grid-template-columns: 1fr; gap: 0; padding: 0; border: 1px solid var(--pfw-line); }
#financials-worksheet [data-phase1-group="household"] .phase1-fields > label > span { min-height: 30px; padding: 6px; background: var(--pfw-title-row); color: #403214; font-weight: 850; }
#financials-worksheet [data-phase1-group="household"] .phase1-fields > label > select { border-radius: 0; }
#financials-worksheet [data-phase1-group="sharedExpenses"] .phase1-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#financials-worksheet [data-phase1-group="cashOnHand"] .phase1-fields { grid-template-columns: 1fr; }
#financials-worksheet [data-phase1-group="cashOnHand"] .phase1-record { padding-right: 0; }
#financials-worksheet [data-phase1-group="cashOnHand"] .phase1-fields > label { display: grid; grid-template-columns: 1fr; padding: 0; }
#financials-worksheet [data-phase1-group="cashOnHand"] .phase1-fields > label > span { min-height: 35px; padding: 6px; background: var(--pfw-title-row); color: #403214; font-weight: 850; }
#financials-worksheet [data-phase1-group="cashOnHand"] .phase1-fields > label > input { min-height: 35px; padding: 5px 6px; }

/* Compact, fixed worksheet tables. */
#financials-worksheet .fin-table { width: 100%; max-width: 100%; margin: 0; border-collapse: collapse; table-layout: fixed; background: #fff; }
#financials-worksheet .fin-table th, #financials-worksheet .fin-table td { min-width: 0; height: 35px; padding: 5px 6px; border: 1px solid var(--pfw-line); vertical-align: middle; overflow-wrap: anywhere; }
#financials-worksheet .fin-table th, #financials-worksheet .fin-table thead td, #financials-worksheet .record-head th { background: var(--pfw-title-row); color: #403214; font-size: .8rem; font-weight: 850; line-height: 1.15; text-align: left; }
#financials-worksheet .fin-table td { background: var(--pfw-data-row); color: var(--pfw-blue-dark); font-size: .8rem; }
#financials-worksheet .fin-table td:has(> input), #financials-worksheet .fin-table td:has(> select), #financials-worksheet .fin-table td:has(> textarea) { padding: 2px 3px; }
#financials-worksheet .fin-table td > :is(input, select, textarea) { max-width: 100%; }
#financials-worksheet .fin-table td:has(> .row-remove) { position: relative; padding-right: 27px; }
#financials-worksheet .fin-table td > .row-remove { position: absolute; top: 50%; right: 2px; transform: translateY(-50%); }
#financials-worksheet .single-col :is(th, td):first-child { width: 72%; }
#financials-worksheet .single-col :is(th, td):last-child { width: 28%; }
#financials-worksheet .table-scroll { width: 100%; max-width: 100%; overflow: visible; }
#financials-worksheet .asset-total-summary { margin-top: 6px; text-align: right; font-size: .76rem; }
#financials-worksheet .occupancy-toggle { display: flex; align-items: center; justify-content: center; gap: 10px; }
#financials-worksheet .occupancy-toggle label { display: inline-flex; align-items: center; }
#financials-worksheet #tbl-primary-res .residence-five-column > tr > :is(th, td) { padding: 0; }
#financials-worksheet #tbl-primary-res .residence-five-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; }
#financials-worksheet #tbl-primary-res .residence-five-grid > span { min-width: 0; min-height: 35px; padding: 5px 6px; border-right: 1px solid var(--pfw-line); }
#financials-worksheet #tbl-primary-res .residence-five-grid > span:last-child { border-right: 0; }
#financials-worksheet #tbl-primary-res .residence-five-head > span { background: var(--pfw-title-row); color: #403214; font-size: .8rem; font-weight: 850; line-height: 1.15; text-align: left; }
#financials-worksheet #tbl-primary-res .residence-five-fields > span { display: flex; align-items: center; padding: 2px 3px; background: var(--pfw-data-row); }

/* Native details are the only accordion structure. */
#financials-worksheet details { margin: 6px 0; border: 0; border-radius: 0; background: transparent; }
#financials-worksheet details > summary { padding: 5px 0; border: 0; background: transparent; color: var(--pfw-blue); font-size: .82rem; font-weight: 850; cursor: pointer; }
#financials-worksheet .income-section > details > summary, #financials-worksheet #business-trigger-card > #business-section > details > summary { background: transparent; border: 0; text-align: left; font-size: .9rem; }
#financials-worksheet :is(.business-pl-tree, .self-pl-tree) { margin: 5px 0 6px 14px; }
#financials-worksheet :is(.business-pl-tree, .self-pl-tree) > h3 { margin: 4px 0; font-size: .8rem; }
#financials-worksheet :is(.business-pl-tree, .self-pl-tree) > details { margin-left: 14px; border: 0; }
#financials-worksheet :is(.business-pl-tree, .self-pl-tree) > details > summary,
#financials-worksheet .simplified-top-level > summary { padding: 4px 0; border: 0; background: transparent; color: var(--pfw-blue); font-size: .75rem; font-weight: 850; }
#financials-worksheet details.financials-reference { margin: 4px 0; padding: 0; border: 0; }
#financials-worksheet details.financials-reference > summary { padding: 4px 0; border: 0; background: transparent; font-size: .88rem; text-transform: none; }

/* Static functional records; +Add clones this same grammar. */
#financials-worksheet .phase1-group { width: 100%; min-width: 0; margin: 0; }
#financials-worksheet .phase1-record { position: relative; margin: 0; padding: 0 26px 0 0; border: 0; background: var(--pfw-data-row); }
#financials-worksheet .phase1-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
#financials-worksheet .phase1-fields > label { display: grid; align-content: start; gap: 0; min-width: 0; min-height: 35px; padding: 5px 6px; border: 1px solid var(--pfw-line); background: var(--pfw-data-row); }
#financials-worksheet .phase1-record > .owner-record-remove { position: absolute; top: 4px; right: 4px; }
#financials-worksheet .health-paired-row > td:first-child { padding: 0; }
#financials-worksheet .health-paired-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
#financials-worksheet .health-paired-fields > label { display: grid; grid-template-columns: minmax(0, 1fr) minmax(115px, .55fr); align-items: center; gap: 5px; min-height: 32px; padding: 3px 5px; }
#financials-worksheet .health-paired-fields > label + label { border-left: 1px solid var(--pfw-line); }
#financials-worksheet .transport-qualification { display: grid; gap: 3px; margin-top: 3px; }
#financials-worksheet .transport-qualification label { grid-template-columns: minmax(0, 1fr) minmax(110px, .35fr); align-items: center; gap: 5px; }
#financials-worksheet [data-phase1-group="workExpenses"] .phase1-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#financials-worksheet [data-phase1-group="delinquentTaxes"] .phase1-fields,
#financials-worksheet [data-phase1-group="studentLoans"] .phase1-fields,
#financials-worksheet [data-phase1-group="securedDebts"] .phase1-fields,
#financials-worksheet [data-phase1-group="representationFees"] .phase1-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#financials-worksheet [data-phase1-group="additionalCourtPayments"] .phase1-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#financials-worksheet [data-phase1-group="retirementLoans"] .phase1-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#financials-worksheet .additional-expense-record { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
#financials-worksheet .additional-expense-record > label { display: grid; grid-template-rows: minmax(29px, auto) minmax(35px, auto); gap: 0; min-width: 0; padding: 0; border: 0; border-right: 1px solid var(--pfw-line); background: var(--pfw-data-row); }
#financials-worksheet .additional-expense-record > label:last-child { border-right: 0; }
#financials-worksheet .additional-expense-record > label > span { padding: 6px; background: var(--pfw-title-row); color: #403214; font-weight: 850; line-height: 1.15; }
#financials-worksheet .additional-expense-record > label > input { min-height: 35px; }
#financials-worksheet .financials-expense-detail-groups { border: 0; }
#financials-worksheet .financials-expense-detail-groups > .phase1-group > h3 { margin: 0; padding: 6px; background: var(--pfw-title-row); border-top: 1px solid var(--pfw-line); border-bottom: 1px solid var(--pfw-line); color: #403214; font-size: .78rem; }
#financials-worksheet .financials-expense-detail-groups > .phase1-group > button { margin: 5px 6px; }
#financials-worksheet .financials-expense-detail-groups .phase1-record { padding-right: 0; border-left: 1px solid var(--pfw-line); border-top: 0; }
#financials-worksheet .financials-expense-detail-groups .phase1-fields > label { display: grid; grid-template-columns: 1fr; grid-template-rows: minmax(29px, auto) minmax(35px, auto); align-items: stretch; gap: 0; padding: 0; border: 0; border-right: 1px solid var(--pfw-line); border-bottom: 1px solid var(--pfw-line); }
#financials-worksheet .financials-expense-detail-groups .phase1-fields > label > span { padding: 6px; background: var(--pfw-title-row); color: #403214; font-weight: 850; line-height: 1.2; }
#financials-worksheet .financials-expense-detail-groups .phase1-fields > label > :is(input, select) { min-height: 35px; }
#financials-worksheet .financials-expense-detail-groups .phase1-fields > label:last-child > :is(input, select) { padding-right: 28px; }
#financials-worksheet .financials-expense-detail-groups .phase1-record > .owner-record-remove { top: auto; right: 4px; bottom: 6px; }
#financials-worksheet [data-phase1-group="delinquentTaxes"] .phase1-fields { grid-template-columns: repeat(6, minmax(0, 1fr)); }
#financials-worksheet [data-phase1-group="delinquentTaxes"] .phase1-fields > label:nth-child(-n+3) { grid-column: span 2; }
#financials-worksheet [data-phase1-group="delinquentTaxes"] .phase1-fields > label:nth-child(n+4) { grid-column: span 3; }

/* Expenses Continued: keep section headings gold, but present field titles inline like Union Dues. */
#financials-worksheet .financials-expense-detail-groups > section:is(
  [data-phase1-group="workExpenses"],
  [data-phase1-group="delinquentTaxes"],
  [data-phase1-group="studentLoans"],
  [data-phase1-group="additionalCourtPayments"],
  [data-phase1-group="securedDebts"],
  [data-phase1-group="representationFees"]
) .phase1-fields > label {
  grid-template-columns: minmax(0, 1fr) minmax(90px, .75fr);
  grid-template-rows: minmax(35px, auto);
  align-items: center;
  gap: 5px;
  min-height: 35px;
  padding: 3px 5px;
  background: var(--pfw-data-row);
}
#financials-worksheet .financials-expense-detail-groups > section:is(
  [data-phase1-group="workExpenses"],
  [data-phase1-group="delinquentTaxes"],
  [data-phase1-group="studentLoans"],
  [data-phase1-group="additionalCourtPayments"],
  [data-phase1-group="securedDebts"],
  [data-phase1-group="representationFees"]
) .phase1-fields > label > span {
  padding: 0;
  background: transparent;
  color: var(--pfw-blue-dark);
  font-weight: 400;
  line-height: 1.2;
}
#financials-worksheet .financials-expense-detail-groups > section:is(
  [data-phase1-group="workExpenses"],
  [data-phase1-group="delinquentTaxes"],
  [data-phase1-group="studentLoans"],
  [data-phase1-group="additionalCourtPayments"],
  [data-phase1-group="securedDebts"],
  [data-phase1-group="representationFees"]
) .phase1-record > .owner-record-remove {
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
}

#financials-worksheet #tbl-expenses-2 > tbody > tr > td {
  width: 100%;
  padding: 0 27px 0 0;
}
#financials-worksheet #tbl-expenses-2 .additional-expense-record > label > span {
  background: var(--pfw-data-row);
  color: var(--pfw-blue-dark);
  font-weight: 400;
}
#financials-worksheet #tbl-expenses-2 .additional-expense-record > label > input {
  width: 100%;
  min-width: 0;
}
#financials-worksheet .two-column-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#financials-worksheet .three-column-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#financials-worksheet .life-loan-row > td { padding: 0; }
#financials-worksheet .life-loan-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
#financials-worksheet .life-loan-fields > label { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, .65fr); align-items: center; gap: 4px; min-height: 34px; padding: 3px 5px; }
#financials-worksheet .life-loan-fields > label + label { border-left: 1px solid var(--pfw-line); }
#financials-worksheet .financials-expense-allocation { display: grid; grid-template-columns: auto minmax(120px, 220px); align-items: center; gap: 5px; margin-top: 3px; }
#financials-worksheet .pl-table :is(th, td):nth-child(1) { width: 31%; }
#financials-worksheet .pl-table :is(th, td):nth-child(2) { width: 21%; }
#financials-worksheet .pl-table :is(th, td):nth-child(3) { width: 28%; }
#financials-worksheet .pl-table :is(th, td):nth-child(4) { width: 20%; }
#financials-worksheet .pl-custom-range:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 3px; margin-top: 3px; }
#financials-worksheet .pl-custom-range .small { text-align: center; }
#financials-worksheet .self-employed-identity-cell { display: grid; grid-template-columns: 1.25fr 1fr .85fr; align-items: center; }
#financials-worksheet .self-employed-identity-cell > input + input { border-left: 1px solid var(--pfw-line); }
#financials-worksheet .simplified-business-table :is(th, td) { width: 25%; }

/* Four-column comparison; no nested cards or tall stacks. */
#financials-worksheet #tbl-expense-comparison :is(th, td):nth-child(1) { width: 40%; text-align: left; }
#financials-worksheet #tbl-expense-comparison :is(th, td):nth-child(n+2) { width: 20%; text-align: center; }
#financials-worksheet #tbl-expense-comparison :is(input, select) { min-height: 25px; padding: 2px 4px; text-align: center; }
#financials-worksheet #tbl-expense-comparison tbody tr { height: 34px; }
#financials-worksheet #tbl-expense-comparison tfoot :is(th, td) { background: var(--pfw-title-row); font-weight: 850; }
#financials-worksheet #tbl-expense-comparison tr[data-expense-row="foodPersonalCare"] td,
#financials-worksheet #tbl-expense-comparison tr[data-expense-row="housingLivingTotal"] td { background: var(--pfw-subtotal-row); font-weight: 850; }
#financials-worksheet #tbl-expense-comparison tr[data-expense-row="foodPersonalCare"] .read-value,
#financials-worksheet #tbl-expense-comparison tr[data-expense-row="housingLivingTotal"] .read-value { font-weight: 900; }
#financials-worksheet .financials-verified-inline,
#financials-worksheet [data-financials-dual] { display: flex; align-items: center; justify-content: center; gap: 5px; margin: 0; padding: 0; border: 0; background: transparent; }
#financials-worksheet [data-financials-tax-pro-totals] { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 0; padding: 0; border: 0; background: transparent; }
#financials-worksheet [data-financials-tax-pro-totals] > :is(label, div) { display: flex; align-items: center; justify-content: center; flex: 1 1 0; gap: 4px; margin: 0; white-space: nowrap; }
#financials-worksheet :is(.financials-verified-inline, [data-financials-dual], [data-financials-tax-pro-totals]) label { display: flex; align-items: center; flex: 1 1 0; gap: 3px; margin: 0; color: var(--pfw-blue-dark); font-size: .7rem; font-weight: 800; white-space: nowrap; }
#financials-worksheet :is(.financials-verified-inline, [data-financials-dual], [data-financials-tax-pro-totals]) label input { min-width: 0; }
#financials-worksheet :is(.financials-verified-inline, [data-financials-dual]) details { margin: 0; border: 0; background: transparent; }
#financials-worksheet :is(.financials-verified-inline, [data-financials-dual]) summary { padding: 1px 0; border: 0; background: transparent; font-size: .68rem; text-align: center; }
#financials-worksheet .standard-include-control { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 5px; }
#financials-worksheet .standard-include-option { display: inline-flex; align-items: center; font-size: .66rem; font-weight: 850; }
#financials-worksheet .expense-substantiation-warning, #financials-worksheet .financials-oic-only-label { display: block; color: var(--pfw-danger); font-size: .66rem; font-style: italic; font-weight: 800; }
#financials-worksheet .line-note { display: block; margin-top: 2px; font-size: .66rem; font-style: italic; font-weight: 700; line-height: 1.2; }
#financials-worksheet #tbl-totals :is(th, td):first-child { width: 28%; text-align: left; }
#financials-worksheet #tbl-totals :is(th, td):not(:first-child) { text-align: center; }
#financials-worksheet #tbl-totals .total-row td { background: var(--pfw-title-row); font-weight: 900; }
#financials-worksheet #tbl-totals td :is(.read-value, input) { text-align: center; }

#financials-worksheet :is(#financials-substantiation-list, #financials-authority-content) { display: grid; grid-template-columns: 1fr; margin: 0; padding: 0; }
#financials-worksheet :is(#financials-substantiation-list, #financials-authority-content) article { margin: 0; padding: 0 8px 6px; border: 1px solid var(--pfw-line); border-top: 0; }
#financials-worksheet :is(#financials-substantiation-list, #financials-authority-content) article:first-child { border-top: 1px solid var(--pfw-line); }
#financials-worksheet :is(#financials-substantiation-list, #financials-authority-content) article h3 { margin: 0 -8px 5px; padding: 6px 8px; background: var(--pfw-title-row); color: var(--pfw-blue); font-size: .86rem; }
#financials-worksheet :is(#financials-substantiation-list, #financials-authority-content) article p { margin: 4px 0; color: var(--pfw-blue-dark); font-size: .76rem; }

#financials-worksheet #save-profile-card, #financials-worksheet #irs-financial-forms { padding: 8px 0; border: 0; background: transparent; }
#financials-worksheet #save-profile-card .save-actions { justify-content: center; }
#financials-worksheet .save-fields { display: grid; gap: 6px; margin-top: 0; }
#financials-worksheet .case-row { display: grid; grid-template-columns: minmax(120px, 180px) minmax(0, 1fr); align-items: center; gap: 5px; }
#financials-worksheet .case-search-shell { position: relative; }
#financials-worksheet #case-search-results { position: absolute; z-index: 20; width: 100%; max-height: 220px; margin: 0; padding: 0; overflow-y: auto; background: #fff; border: 1px solid var(--pfw-line); list-style: none; }
#financials-worksheet #case-search-results:not(.visible) { display: none; }
#financials-worksheet #case-search-results li { padding: 6px 8px; cursor: pointer; }
#financials-worksheet .status-banner { min-height: 18px; margin-top: 6px; color: var(--pfw-blue); font-size: .74rem; font-weight: 700; }
#financials-worksheet .irs-form-options { display: flex; align-items: center; justify-content: center; gap: 10px; }
#financials-worksheet .financial-page-back { display: inline-flex; margin: 6px 0 0; padding: 5px 9px; border: 1px solid #d0d5da; border-radius: 6px; background: #e8edf0; color: #1f2731; font-size: .74rem; font-weight: 800; text-decoration: none; }

/* The shared Save/Assign component is appended directly to body on this page. */
.financials-single-page > .tt-modal { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; }
.financials-single-page > .tt-modal[hidden] { display: none; }
.financials-single-page > .tt-modal .tt-modal-backdrop { position: absolute; inset: 0; background: rgba(10, 20, 40, .55); }
.financials-single-page > .tt-modal .tt-modal-card { position: relative; z-index: 1; width: min(620px, 92vw); max-height: min(680px, 90vh); padding: 20px 22px; overflow-y: auto; border-radius: 16px; background: #fff; box-shadow: 0 22px 60px rgba(0,0,0,.25); }
.financials-single-page > .tt-modal .tt-modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.financials-single-page > .tt-modal .tt-modal-header h3 { margin: 0; color: var(--pfw-blue); font-size: 1.2rem; }
.financials-single-page > .tt-modal .tt-modal-close { border: 0; background: transparent; font-size: 1.35rem; cursor: pointer; }
.financials-single-page > .tt-modal .tt-save-name-row,
.financials-single-page > .tt-modal .tt-tab-panel { display: grid; gap: 8px; }
.financials-single-page > .tt-modal .tt-save-name-row { margin-bottom: 12px; }
.financials-single-page > .tt-modal .tt-save-name-label,
.financials-single-page > .tt-modal .tt-tab-panel > label { color: var(--pfw-blue); font-size: .82rem; font-weight: 800; }
.financials-single-page > .tt-modal .tt-input { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid #c8d1dc; border-radius: 8px; background: #fff; color: var(--pfw-text); font-size: .86rem; }
.financials-single-page > .tt-modal .tt-modal-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.financials-single-page > .tt-modal .tt-tab,
.financials-single-page > .tt-modal .tt-btn { min-height: 36px; padding: 8px 12px; border: 1px solid #d0d5da; border-radius: 8px; background: #e8edf0; color: #1f2731; font-weight: 800; cursor: pointer; }
.financials-single-page > .tt-modal .tt-tab.active,
.financials-single-page > .tt-modal .tt-btn-blue { border-color: #1554a5; background: #1f6fd1; color: #fff; }
.financials-single-page > .tt-modal .tt-btn-gold { border-color: #a8710f; background: #f3c95f; color: #2e230c; }
.financials-single-page > .tt-modal .tt-btn-outline { background: #fff; color: var(--pfw-blue); }
.financials-single-page > .tt-modal .tt-tab-panel { display: none; }
.financials-single-page > .tt-modal .tt-tab-panel.active { display: grid; }
.financials-single-page > .tt-modal .tt-case-list { max-height: 220px; padding: 8px; overflow: auto; border: 1px solid #e2e2e2; border-radius: 10px; }
.financials-single-page > .tt-modal .tt-case-row { width: 100%; margin-bottom: 6px; padding: 8px 10px; border: 1px solid transparent; border-radius: 8px; background: #f7f8fa; color: var(--pfw-text); text-align: left; cursor: pointer; }
.financials-single-page > .tt-modal .tt-case-row.active { border-color: var(--pfw-blue); background: #e8f0fb; }
.financials-single-page > .tt-modal .tt-create-checkbox { display: flex; align-items: center; gap: 6px; }
.financials-single-page > .tt-modal .tt-create-error { min-height: 1.2em; color: var(--pfw-danger); font-size: .78rem; }
.financials-single-page > .tt-modal .tt-modal-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.financials-single-page > .tt-modal .tt-modal-actions { display: flex; gap: 8px; }
.financials-single-page > .tt-modal .tt-btn:disabled { opacity: .55; cursor: not-allowed; }
.financials-single-page > .tt-toast { position: fixed; right: 18px; bottom: 18px; z-index: 10001; padding: 12px 16px; border-radius: 10px; background: var(--pfw-blue); color: #fff; box-shadow: 0 12px 30px rgba(0,0,0,.2); opacity: 0; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease; }
.financials-single-page > .tt-toast[hidden] { display: none; }
.financials-single-page > .tt-toast.show { opacity: 1; transform: translateY(0); }

#financials-worksheet [data-detailed-record-list] { display: grid; gap: 12px; }
#financials-worksheet .detailed-parent-record { position: relative; margin: 0; }
#financials-worksheet .detailed-parent-record + .detailed-parent-record { border-top: 2px solid var(--pfw-gold); }
#financials-worksheet .record-delete-actions { justify-content: flex-end; padding: 6px; }
#financials-worksheet .detailed-record-remove { border-color: #b44; color: #8f1f26; }
#financials-worksheet [data-encumbered-assets-table] textarea { min-height: 48px; resize: vertical; }
#financials-worksheet [data-encumbered-assets-table] th:nth-child(1) { width: 18%; }
#financials-worksheet [data-encumbered-assets-table] th:nth-child(2) { width: 57%; }
#financials-worksheet [data-encumbered-assets-table] th:nth-child(3) { width: 25%; }

/* Keep semantic conditional content hidden after all higher-specificity layout rules. */
body.financials-single-page #financials-worksheet [hidden] { display: none; }

.financials-loading-state { position: fixed; inset: 0; z-index: 20000; display: grid; place-items: center; background: rgba(255,255,255,.9); color: var(--pfw-blue); font-size: 1rem; font-weight: 850; }
#financials-worksheet .fdi-panel, #financials-worksheet .fdi-status, #financials-worksheet .fdi-error { margin: 8px 0; padding: 8px; border: 1px solid var(--pfw-line); border-radius: 3px; background: #fff; }
#financials-worksheet .fdi-error { border-color: #c8878a; color: var(--pfw-danger); }
#financials-worksheet .fdi-head, #financials-worksheet .fdi-actions { display: flex; justify-content: space-between; align-items: center; gap: 7px; }
#financials-worksheet .fdi-table-wrap { max-width: 100%; overflow: hidden; }
#financials-worksheet .fdi-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
#financials-worksheet .fdi-table :is(th, td) { padding: 4px; border: 1px solid var(--pfw-line); overflow-wrap: anywhere; }
#financials-worksheet .import-financial-review { margin-left: 4px; color: var(--pfw-danger); font-size: .66rem; font-style: italic; }
.financial-print-brand-header, .financial-print-brand-footer, .print-report-header, .print-report-footer, .financials-print-facts, .print-substantiation { display: none; }

@media (max-width: 900px) {
  .tt-header-inner { align-items: flex-start; }
  .tt-nav-toggle { display: inline-flex; }
  .tt-nav { display: none; }
  body.nav-open .tt-nav { display: flex; }
  #financials-worksheet .import-person-grid, #financials-worksheet .import-address-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #financials-worksheet .financial-dependent-row { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  #financials-worksheet .financial-dependent-row > label { grid-column: span 2; }
  #financials-worksheet .phase1-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  #financials-worksheet { width: calc(100% - 8px); }
  #financials-worksheet .fin-card, #financials-worksheet .financials-section { padding: 8px 5px; }
  #financials-worksheet .import-person-grid, #financials-worksheet .import-address-grid, #financials-worksheet .financial-dependent-row, #financials-worksheet .phase1-fields, #financials-worksheet .irs-form-options, #financials-worksheet .case-row { grid-template-columns: 1fr; }
  #financials-worksheet .import-address-grid > label:first-child, #financials-worksheet .financial-dependent-row > label { grid-column: 1; }
  #financials-worksheet .fin-table :is(th, td) { padding: 3px 2px; font-size: .62rem; }
  #financials-worksheet input:not([type=checkbox]):not([type=radio]), #financials-worksheet select { padding-inline: 3px; font-size: .66rem; }
  #financials-worksheet button { padding-inline: 6px; }
  #financials-worksheet .health-paired-fields { grid-template-columns: 1fr; }
  #financials-worksheet .health-paired-fields > label { grid-template-columns: 1fr; }
  #financials-worksheet .health-paired-fields > label + label { border-top: 1px solid var(--pfw-line); border-left: 0; }
  #financials-worksheet .life-loan-fields { grid-template-columns: 1fr; }
  #financials-worksheet .life-loan-fields > label + label { border-top: 1px solid var(--pfw-line); border-left: 0; }
}

@media print {
  body.financials-single-page { background: #fff; }
  .tt-header, .tt-hero, .tt-footer, #financial-document-actions-card, #save-profile-card, #irs-financial-forms, .cta-row, .row-remove, .owner-record-remove { display: none; }
  #financials-worksheet { width: 100%; margin: 0; overflow: visible; }
  #financials-worksheet .fin-card { break-inside: avoid; box-shadow: none; }
  body.has-financial-print-branding > .financial-print-brand-header, body.has-financial-print-branding > .financial-print-brand-footer { display: grid; }
  .financial-print-brand-header { grid-template-columns: 1fr auto; align-items: center; gap: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--financial-brand-secondary, #f6cc6d); }
  .financial-print-brand-identity { display: flex; align-items: center; gap: 10px; }
  .financial-print-brand-logo { max-width: 120px; max-height: 45px; }
  .financial-print-brand-copy { display: grid; }
  .financial-print-document-title { color: var(--financial-brand-primary, #0b3a6e); font-size: 18px; }
  .financial-print-brand-footer { margin-top: 12px; padding-top: 6px; border-top: 2px solid var(--financial-brand-accent, #1f4b99); font-size: 7px; }
}

/* Marked Expenses Continued rows only. Match the existing 72% / 28% worksheet. */
#financials-worksheet #expenses-continued-section .financials-expense-heading {
  display: grid; grid-template-columns: 72% 28%; margin: 0; padding: 0;
  border: 1px solid var(--pfw-line); background: var(--pfw-title-row);
  color: #403214; font-size: .78rem;
}
#financials-worksheet #expenses-continued-section .phase1-record {
  padding: 0; border: 0;
}
#financials-worksheet #expenses-continued-section .financials-expense-heading > span { padding: 6px; }
#financials-worksheet #expenses-continued-section :is(.phase1-fields, .additional-expense-record) {
  grid-template-columns: 36% 36% 28%;
}
#financials-worksheet #expenses-continued-section :is(.phase1-fields, .additional-expense-record) > label {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto; align-items: center; align-content: center;
  gap: 4px; min-height: 35px; padding: 0 6px; grid-column: auto;
  border: 1px solid var(--pfw-line);
}
#financials-worksheet #expenses-continued-section :is(.phase1-fields, .additional-expense-record) > label > span {
  padding: 0; background: transparent; color: var(--pfw-blue-dark); font-weight: 400; line-height: 1.2;
}
#financials-worksheet #expenses-continued-section :is(.phase1-fields, .additional-expense-record) > label > :is(input, select) {
  min-height: 28px; padding: 4px 6px;
}
#financials-worksheet #expenses-continued-section :is([data-phase1-group="workExpenses"], [data-record-kind="workExpenses"]) .phase1-fields { grid-template-columns: 72% 28%; }
#financials-worksheet #expenses-continued-section :is([data-phase1-group="delinquentTaxes"], [data-record-kind="delinquentTaxes"], [data-phase1-group="additionalCourtPayments"], [data-record-kind="courtPayments"]) .phase1-fields { grid-template-columns: repeat(100, minmax(0, 1fr)); }
#financials-worksheet #expenses-continued-section :is([data-phase1-group="delinquentTaxes"], [data-record-kind="delinquentTaxes"]) .phase1-fields > label { grid-column: span 36; }
#financials-worksheet #expenses-continued-section :is([data-phase1-group="delinquentTaxes"], [data-record-kind="delinquentTaxes"]) .phase1-fields > label:nth-child(3) { grid-column: span 28; }
#financials-worksheet #expenses-continued-section :is([data-phase1-group="delinquentTaxes"], [data-record-kind="delinquentTaxes"]) .phase1-fields > label:nth-child(n+4),
#financials-worksheet #expenses-continued-section :is([data-phase1-group="additionalCourtPayments"], [data-record-kind="courtPayments"]) .phase1-fields > label { grid-column: span 50; }
#financials-worksheet #expenses-continued-section :is([data-phase1-group="additionalCourtPayments"], [data-record-kind="courtPayments"]) .phase1-fields > label:first-child { grid-column: span 72; }
#financials-worksheet #expenses-continued-section :is([data-phase1-group="additionalCourtPayments"], [data-record-kind="courtPayments"]) .phase1-fields > label:nth-child(2) { grid-column: span 28; }
#financials-worksheet #expenses-continued-section .phase1-fields > .financials-payment-field,
#financials-worksheet #expenses-continued-section .additional-expense-record > label:last-child { grid-template-columns: minmax(0, 1fr); padding-right: 28px; }
#financials-worksheet #expenses-continued-section .financials-payment-field > span,
#financials-worksheet #expenses-continued-section .additional-expense-record > label:last-child > span {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
#financials-worksheet #expenses-continued-section :is([data-phase1-group="retirementLoans"], [data-record-kind="retirementLoans"]) .phase1-fields > label { grid-template-columns: minmax(0, 1fr); padding: 0; }
#financials-worksheet #expenses-continued-section :is([data-phase1-group="retirementLoans"], [data-record-kind="retirementLoans"]) .phase1-fields > label > span { position: static; width: auto; height: auto; clip-path: none; padding: 6px; background: var(--pfw-title-row); font-weight: 850; }
#financials-worksheet #expenses-continued-section :is([data-phase1-group="retirementLoans"], [data-record-kind="retirementLoans"]) .phase1-fields > label > :is(input, select) { min-height: 35px; }
#financials-worksheet #expenses-continued-section :is([data-phase1-group="retirementLoans"], [data-record-kind="retirementLoans"]) .financials-payment-field > input { padding-right: 28px; }
#financials-worksheet #expenses-continued-section .phase1-record > .owner-record-remove { top: 7px; right: 4px; bottom: auto; transform: none; }
#financials-worksheet #expenses-continued-section :is([data-phase1-group="retirementLoans"], [data-record-kind="retirementLoans"]) .owner-record-remove { top: 35px; }
#financials-worksheet #expenses-continued-section #tbl-expenses-2 > tbody > tr > td { padding: 0; }
#financials-worksheet #expenses-continued-section .required-work-base td { height: 35px; }
@media screen and (max-width: 640px) {
  #financials-worksheet #expenses-continued-section :is(.phase1-fields, .additional-expense-record) { display: flex; flex-direction: column; }
  #financials-worksheet #expenses-continued-section :is(.phase1-fields, .additional-expense-record) > label { grid-template-columns: minmax(0, auto) minmax(80px, 1fr); }
  #financials-worksheet #expenses-continued-section .phase1-fields > .financials-payment-field,
  #financials-worksheet #expenses-continued-section .additional-expense-record > label:last-child { grid-template-columns: auto minmax(0, 1fr); }
  #financials-worksheet #expenses-continued-section .financials-payment-field > span,
  #financials-worksheet #expenses-continued-section .additional-expense-record > label:last-child > span { position: static; width: auto; height: auto; clip-path: none; white-space: normal; }
  #financials-worksheet #expenses-continued-section .phase1-record .phase1-fields > label:first-child { padding-right: 28px; }
  #financials-worksheet #expenses-continued-section .financials-expense-heading { grid-template-columns: 1fr; }
  #financials-worksheet #expenses-continued-section .financials-expense-heading > span:last-child { display: none; }
}
