/* Keep the loan workspace scoped to the creation page. */
.loan-workspace { --workspace-field-height: 37px; --workspace-ink: #182c43; --workspace-muted: #52657a; --workspace-border: #dce4ec; --workspace-accent: #116b65; background: #f2f5f8; color: var(--workspace-ink); }
.loan-workspace .main-content { background: transparent; }
.loan-workspace .main-content main { max-width: 1760px; margin: 0 auto; padding: 0 28px 24px; background: transparent; box-shadow: none; }
.loan-workspace .page-header { display: flex; justify-content: space-between; align-items: center; max-width: 1760px; margin: 0 auto; padding: 22px 28px 18px; background: transparent; border: 0; box-shadow: none; }
.loan-workspace .workspace-eyebrow { margin: 0 0 4px; font-size: 10px; font-weight: 750; letter-spacing: .15em; color: var(--workspace-accent); }
.loan-workspace .page-header h1 { margin: 0; color: var(--workspace-ink); font-size: 27px; line-height: 1.25; font-weight: 750; letter-spacing: -.035em; }
.loan-workspace .workspace-intro { margin: 5px 0 0; color: var(--workspace-muted); font-size: 13px; }
.loan-workspace .workspace-records { padding: 9px 13px; border: 1px solid var(--workspace-border); border-radius: 7px; background: #fff; color: var(--workspace-ink); font-size: 12px; text-decoration: none; }
.loan-workspace #loanForm { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 14px 18px; margin: 0; padding: 0; background: transparent; box-shadow: none; border: 0; }
.loan-workspace #loanForm > input[type=hidden] { display: none; }
.loan-workspace .form-section { min-width: 0; margin: 0; padding: 15px 18px 17px; background: #fff; border: 1px solid var(--workspace-border); border-radius: 10px; box-shadow: 0 2px 4px #172b4003; transition: none; }
.loan-workspace .form-section:hover { box-shadow: 0 2px 4px #172b4003; }
.loan-workspace .form-section legend { float: left; width: 100%; margin: 0 0 12px; padding: 0; font-size: 13px; line-height: 1.4; letter-spacing: .015em; font-weight: 750; color: var(--workspace-ink); }
.loan-workspace .form-section legend + * { clear: both; }
.loan-workspace .form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin: 0 0 12px; }
.loan-workspace .form-row:last-child { margin-bottom: 0; }
.loan-workspace .form-group { min-width: 0; margin: 0; padding: 0; }
.loan-workspace .form-group label { display: block; margin: 0 0 5px; font-size: 12px; font-weight: 600; line-height: 1.4; color: var(--workspace-muted); }
.loan-workspace .form-group input:not([type=checkbox]), .loan-workspace .form-group select { width: 100%; min-height: 37px; height: var(--workspace-field-height); box-sizing: border-box; padding: 7px 10px; border: 1px solid #cbd6e1; border-radius: 6px; background: #fff; color: var(--workspace-ink); font-size: 14px; box-shadow: none; }
.loan-workspace .form-group input[readonly] { border-color: #e5ebf0; background: #f5f8fa; font-variant-numeric: tabular-nums; }
.loan-workspace input:focus-visible, .loan-workspace select:focus-visible, .loan-workspace button:focus-visible, .loan-workspace summary:focus-visible, .loan-workspace a:focus-visible { outline: 3px solid #19958c; outline-offset: 2px; }
.loan-workspace .workspace-client .form-row { grid-template-columns: 1fr; margin-bottom: 0; }
.loan-workspace .workspace-client .client-selection-section { padding: 0; margin: 0; border: 0; background: transparent; box-shadow: none; }
.loan-workspace .workspace-client #clientSearchInput { padding-right: 36px; }
.loan-workspace .workspace-client .form-group > p { margin: 6px 0 0 !important; font-size: 11px !important; color: var(--workspace-muted) !important; }
.loan-workspace .workspace-client-facts { margin-top: 10px; padding-top: 9px; border-top: 1px solid #edf1f5; font-size: 11px; color: var(--workspace-muted); display: flex; gap: 8px 16px; flex-wrap: wrap; }
.loan-workspace .workspace-client-facts b { color: var(--workspace-ink); font-weight: 650; }
.loan-workspace .workspace-client-context { display: grid; gap: 4px; margin-top: 8px; font-size: 12px; line-height: 1.5; color: var(--workspace-muted); overflow-wrap: anywhere; }
.loan-workspace .workspace-client-context[hidden] { display: none; }
.loan-workspace .workspace-client-context b { color: var(--workspace-ink); font-weight: 650; white-space: pre-line; }
.loan-workspace .workspace-client-metadata { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.loan-workspace .workspace-application .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin: 0; }
.loan-workspace .workspace-application .form-group:has(#clientNameDisplay) { display: none; }
.loan-workspace .workspace-application .form-group:has(#cvNumber) { grid-column: 1 / -1; }
.loan-workspace .workspace-profile { grid-column: 1 / -1; margin: -3px 0; }
.loan-workspace .workspace-profile > summary { width: fit-content; cursor: pointer; color: var(--workspace-accent); font-size: 11px; padding: 5px 0; font-weight: 650; }
.loan-workspace .workspace-profile > summary span { margin-left: 12px; font-weight: 400; color: var(--workspace-muted); }
.loan-workspace .workspace-personal { margin-top: 7px; }
.loan-workspace .workspace-personal legend { display: none; }
.loan-workspace .workspace-personal .client-info-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.loan-workspace .workspace-personal .info-group { margin: 0; padding: 0; }
.loan-workspace .workspace-personal .info-value { font-size: 12px; overflow-wrap: anywhere; }
.loan-workspace .workspace-personal label { font-size: 10px; color: var(--workspace-muted); }
.loan-workspace #historicalExtensionEntry:not([hidden]) { grid-column: 1 / -1; margin: 0; padding: 7px 12px; font-size: 11px; }
.loan-workspace .workspace-loan, .loan-workspace .workspace-accounting { align-self: start; }
.loan-workspace .workspace-loan > .form-row:has(#startDate) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.loan-workspace .form-checkbox-container { padding: 7px 0; margin: 0; border: 0; background: transparent; }
.loan-workspace .form-checkbox-container label { font-size: 11px; line-height: 1.4; }
.loan-workspace #considerNextMonth { flex-shrink: 0; }
.loan-workspace #startDateSuggestion, .loan-workspace .form-helper-text, .loan-workspace .form-help { font-size: 11px; line-height: 1.45; }
.loan-workspace .form-section--subsection { margin: 8px 0; padding: 12px; }
.loan-workspace .form-section--subsection h3 { margin: 0 0 5px; font-size: 12px; }
.loan-workspace .workspace-accounting > .form-row:nth-last-child(1) { padding-top: 10px; border-top: 1px solid #e8edf2; }
.loan-workspace #netLoanProceeds { color: #116b61 !important; background: #edf8f4; border-color: #b9ddcf; }
.loan-workspace .workspace-review-bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; position: sticky; bottom: 12px; z-index: 50; padding: 14px 18px; border: 1px solid #cddcd9; border-radius: 10px; background: #fff; box-shadow: 0 5px 22px #172b4012; }
.loan-workspace .workspace-financial-summary { display: flex; align-items: center; flex: 1; gap: 24px; }
.loan-workspace .workspace-financial-summary > div { display: flex; flex-direction: column; gap: 3px; }
.loan-workspace .workspace-financial-summary span { font-size: 10px; color: var(--workspace-muted); }
.loan-workspace .workspace-financial-summary output { font-size: 15px; color: var(--workspace-ink); font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.loan-workspace .workspace-net { padding-right: 24px; border-right: 1px solid var(--workspace-border); }
.loan-workspace .workspace-net output { font-size: 22px; color: var(--workspace-accent); letter-spacing: -.035em; }
.loan-workspace .form-actions { display: flex; flex-direction: row-reverse; flex-shrink: 0; gap: 8px; margin: 0; padding: 0; background: none; border: 0; box-shadow: none; }
.loan-workspace .form-actions button { min-width: 0; margin: 0; padding: 10px 15px; border-radius: 6px; font-size: 12px; font-weight: 650; box-shadow: none; transform: none; white-space: nowrap; }
.loan-workspace .form-actions button[type=submit] { background: var(--workspace-accent); color: #fff; border: 1px solid var(--workspace-accent); }
.loan-workspace .form-actions button[type=reset] { background: #fff; color: var(--workspace-muted); border: 1px solid var(--workspace-border); }
.loan-workspace .dropdown-list { z-index: 100; border: 1px solid #cbd6e1; border-radius: 7px; box-shadow: 0 12px 25px #172b401c; }
.loan-workspace .dropdown-item { font-size: 12px; }
html[data-theme=dark] .loan-workspace, body.dark-mode.loan-workspace, html.dark-mode .loan-workspace { --workspace-ink: #e6edf5; --workspace-muted: #acbac9; --workspace-border: #3b4b5b; --workspace-accent: #66d4bd; background: #18232f; }
html[data-theme=dark] .loan-workspace .form-section, body.dark-mode.loan-workspace .form-section, html.dark-mode .loan-workspace .form-section { background: #223141; }
@media (min-width: 1800px) { .loan-workspace #loanForm { gap: 18px 24px; } .loan-workspace .form-section { padding: 20px 24px; } .loan-workspace .form-row { gap: 16px 20px; margin-bottom: 18px; } .loan-workspace .form-group input:not([type=checkbox]), .loan-workspace .form-group select { height: var(--workspace-field-height); } .loan-workspace .form-group label { font-size: 12px; } .loan-workspace .workspace-financial-summary { gap: 40px; } }
@media (max-width: 1400px) and (min-width: 901px) { .loan-workspace .main-content main { padding: 0 18px 18px; } .loan-workspace .page-header { padding: 14px 18px; } .loan-workspace #loanForm { gap: 10px 14px; } .loan-workspace .form-section { padding: 12px 14px; } .loan-workspace .workspace-financial-summary { gap: 16px; } .loan-workspace .workspace-financial-summary > div:last-child { display: none; } .loan-workspace .workspace-net { padding-right: 16px; } .loan-workspace .workspace-intro { font-size: 12px; } }
@media (max-width: 900px) { .loan-workspace #loanForm { grid-template-columns: 1fr; } .loan-workspace .workspace-review-bar { flex-wrap: wrap; bottom: 0; gap: 12px; } .loan-workspace .workspace-financial-summary { gap: 16px; flex-wrap: wrap; } .loan-workspace .form-actions { width: 100%; } .loan-workspace .workspace-profile > summary span { display: none; } .loan-workspace .workspace-personal .client-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .loan-workspace .workspace-records { display: none; } }
@media (prefers-reduced-motion: reduce) { .loan-workspace * { scroll-behavior: auto; } }
/* Explicit placement keeps conditional historical tools from splitting the opening row. */
.loan-workspace #loanForm { grid-template-areas: 'client application' 'profile profile' 'history history' 'terms accounting' 'review review'; }
.loan-workspace .workspace-client { grid-area: client; }
.loan-workspace .workspace-application { grid-area: application; }
.loan-workspace .workspace-profile { grid-area: profile; }
.loan-workspace #historicalExtensionEntry { grid-area: history; }
.loan-workspace .workspace-loan { grid-area: terms; }
.loan-workspace .workspace-accounting { grid-area: accounting; }
.loan-workspace .workspace-review-bar { grid-area: review; }
.loan-workspace .main-content { overflow: visible; box-shadow: none; border-radius: 0; }
.loan-workspace .page-header { width: 100%; box-sizing: border-box; text-align: left; flex-shrink: 0; }
.loan-workspace .page-header .header-content { text-align: left; }
.loan-workspace .form-section legend::before, .loan-workspace .form-section legend::after { display: none; }
.loan-workspace #historicalExtensionEntry:not([hidden]) { padding: 0; margin: -3px 0; border: 0; background: none; gap: 10px; }
.loan-workspace #historicalExtensionEntry .hx-entry-button { padding: 4px 0; background: transparent; color: #866130; font-size: 10px; border: 0; text-decoration: underline; }
.loan-workspace #historicalExtensionEntry > span { font-size: 10px; color: var(--workspace-muted); }
.loan-workspace .workspace-application .form-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.loan-workspace .workspace-application .form-group:has(#cvNumber) { grid-column: auto; }
/* The Rainbow booklet checkbox sits on its own row beneath Branch and CV#. */
.loan-workspace .workspace-application #cvSourceGroup { grid-column: 2 / -1; grid-row: 2; }
@media (min-width: 901px) { .loan-workspace > .container { margin-top: 74px !important; padding: 8px 18px 16px 240px !important; } .loan-workspace .modern-sidebar { width: 210px; left: 14px; top: 88px !important; height: calc(100vh - 100px); } .loan-workspace .modern-sidebar .sidebar-link, .loan-workspace .modern-sidebar .dropdown-toggle { padding: 10px 12px; font-size: 12px; } .loan-workspace .main-content { margin: 0 !important; } .loan-workspace .main-content main { width: 100%; box-sizing: border-box; } }
@media (max-width: 1400px) and (min-width: 901px) { .loan-workspace .workspace-intro { margin-top: 3px; } .loan-workspace .page-header { padding-top: 12px; padding-bottom: 12px; } .loan-workspace .form-section legend { margin-bottom: 9px; margin-top: 0; } .loan-workspace .form-row { gap: 9px 12px; margin-bottom: 10px; } .loan-workspace .workspace-review-bar { padding: 10px 14px; } .loan-workspace .workspace-client { padding-bottom: 10px; } }
@media (max-width: 900px) { .loan-workspace #loanForm { grid-template-areas: 'client' 'application' 'profile' 'history' 'terms' 'accounting' 'review'; } }
.loan-workspace .page-header .header-content { display: block; width: auto; max-width: none; flex: 1; }
.loan-workspace .workspace-accounting > .form-row:has(#unearnedInterest) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.loan-workspace .loan-preview-banner { min-height: 30px; box-sizing: border-box; padding-top: 4px; padding-bottom: 4px; }
.loan-workspace .loan-preview-banner select { width: auto; min-height: 22px; height: 22px; padding: 1px 5px; font-size: 11px; }
@media (min-width: 901px) { .loan-workspace > .container { margin: 74px 0 0 !important; width: 100% !important; max-width: none !important; display: block; } .loan-workspace .modern-sidebar { width: 210px !important; left: 14px !important; } }
@media (max-width: 1400px) and (min-width: 901px) { .loan-workspace #loanForm { padding-bottom: 90px; } .loan-workspace .workspace-review-bar { position: fixed; left: 258px; right: 36px; bottom: 10px; width: auto; } }
.loan-workspace #loanForm { transform: none; filter: none; contain: none; }
.loan-workspace .main-content, .loan-workspace main { transform: none; filter: none; contain: none; }
.loan-workspace .page-header h1 { text-shadow: none; }
.loan-workspace #historicalExtensionEntry:not([hidden]) { display: flex; align-items: baseline; flex-wrap: wrap; margin-top: 8px; gap: 4px 10px; }
.loan-workspace #historicalExtensionEntry > span { margin: 0; }
.loan-workspace #loanForm > .workspace-accounting .form-group label:has(#useCustomInterestRate) { font-size: 10px; font-weight: 400; }
.loan-workspace #loanForm > .workspace-accounting .form-row:last-child { margin-bottom: 0; }
@media (max-width: 1400px) and (min-width: 901px) { .loan-workspace .form-group input:not([type=checkbox]), .loan-workspace .form-group select { min-height: 36px; height: var(--workspace-field-height); font-size: 14px; } .loan-workspace .form-section { padding-top: 11px; padding-bottom: 11px; } .loan-workspace .workspace-client-facts { margin-top: 7px; padding-top: 7px; } .loan-workspace #loanForm { gap: 8px 14px; } .loan-workspace .page-header { padding-top: 10px; padding-bottom: 10px; } .loan-workspace .workspace-accounting .form-row:last-child { padding-top: 8px; } .loan-workspace .workspace-review-bar { bottom: 10px; } }
.loan-workspace #loanForm { backdrop-filter: none; -webkit-backdrop-filter: none; animation: none; }
.loan-workspace #loanForm { grid-template-areas: 'client application' 'profile profile' 'terms accounting' 'review review'; }
html[data-theme=dark] .loan-workspace .workspace-review-bar, html[data-theme=dark] .loan-workspace .workspace-records { background: #223141; border-color: var(--workspace-border); }
html[data-theme=dark] .loan-workspace .form-group input:not([type=checkbox]), html[data-theme=dark] .loan-workspace .form-group select { background: #18232f; border-color: var(--workspace-border); color: var(--workspace-ink); }
html[data-theme=dark] .loan-workspace .form-group input[readonly] { background: #263847; }
html[data-theme=dark] .loan-workspace #netLoanProceeds { background: #183e38; color: #8be0c9 !important; border-color: #3d796b; }
html[data-theme=dark] .loan-workspace .form-actions button[type=reset] { background: transparent; color: var(--workspace-ink); }
html[data-theme=dark] .loan-workspace .form-actions button[type=submit] { color: #12382f; }
@media (max-width: 900px) { .loan-workspace #loanForm { grid-template-areas: 'client' 'application' 'profile' 'terms' 'accounting' 'review'; } }
.loan-workspace .workspace-client label[for=clientSearchInput] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.loan-workspace #historicalExtensionEntry > span:not(.hx-entry-message) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.loan-workspace #historicalExtensionEntry .hx-entry-button { margin: 0; min-height: 0; line-height: 1.5; }
.loan-workspace .workspace-client { align-self: stretch; }
html[data-theme=dark][data-page=index] body.loan-workspace #loanForm { background: transparent !important; box-shadow: none !important; }
@media (max-width: 1400px) { .loan-workspace .app-header .header-breadcrumb { display: none; } }
html:has(body.loan-workspace) { scroll-padding-bottom: 100px; }
.loan-workspace .page-header::before, .loan-workspace .page-header::after, .loan-workspace .page-header .header-content::before, .loan-workspace .page-header .header-content::after { display: none; }
@media (min-width: 901px) and (max-width: 1400px) { .loan-workspace .app-header > .header-content { grid-template-columns: minmax(250px, 1fr) auto !important; } }
.loan-workspace #renewalPayoffSuggestion { overflow-wrap: anywhere; }
.loan-workspace #extensionParentHelp { display: block; margin-top: 6px; line-height: 1.5; }
.loan-workspace #absorptionLoansList > div { min-width: 0; flex-wrap: wrap; gap: 8px; }
.loan-workspace #absorptionLoansList > div > label { min-width: 0; max-width: 100%; }
.loan-workspace #absorptionLoansList > div > label > div { min-width: 0; overflow-wrap: anywhere; }
.loan-workspace #absorptionLoansList input.absorption-amount-input { max-width: 100%; box-sizing: border-box; }
/* Optional choices: two matching compact cards in Loan Terms (production loan-option markup). */
.loan-workspace .loan-info-options { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 8px; margin-top: 10px; }
.loan-workspace .workspace-loan > .form-row:has(+ .loan-info-options) { margin-bottom: 0; }
@media (min-width: 1500px) { .loan-workspace .loan-info-options { grid-template-columns: repeat(2, minmax(0, 1fr)); } .loan-workspace .loan-info-options:has(> #lessAdvancePaymentGroup[hidden]) > #considerNextMonthOption { grid-column: 1 / -1; } }
.loan-workspace .loan-option { min-width: 0; padding: 8px 12px 9px; border: 1px solid var(--workspace-border); border-radius: 8px; background: #f7f9fb; transition: border-color .15s ease, background-color .15s ease; }
.loan-workspace .loan-option[hidden] { display: none !important; }
.loan-workspace .loan-option:has(> .loan-option__toggle input:checked) { border-color: #9ccfc5; background: #fff; box-shadow: inset 3px 0 0 var(--workspace-accent); }
.loan-workspace .loan-option__toggle { display: flex; align-items: center; gap: 8px; min-width: 0; }
.loan-workspace .loan-option__toggle input[type=checkbox] { appearance: auto; flex: 0 0 16px; width: 16px; height: 16px; min-width: 0 !important; min-height: 0 !important; margin: 0; padding: 0; border: 0; box-shadow: none; transform: none; accent-color: var(--workspace-accent); cursor: pointer; }
.loan-workspace .loan-option__toggle input[type=checkbox]:disabled { cursor: not-allowed; }
.loan-workspace .loan-option__toggle label { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; margin: 0; font-size: 12px; font-weight: 700; line-height: 1.35; color: var(--workspace-ink); cursor: pointer; }
.loan-workspace .loan-option__toggle label::after { content: none; }
.loan-workspace .loan-option:has(> .loan-option__toggle input:disabled) .loan-option__toggle label { cursor: not-allowed; opacity: .65; }
.loan-workspace .loan-option__tag { padding: 1px 6px; border: 1px solid var(--workspace-border); border-radius: 999px; font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--workspace-muted); }
.loan-workspace .loan-option__state { margin-left: auto; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 650; white-space: nowrap; color: var(--workspace-muted); background: #edf1f5; }
.loan-workspace .loan-option__state:empty { display: none; }
.loan-workspace .loan-option__state[data-state=available], .loan-workspace .loan-option__state[data-state=on] { color: #0f5f58; background: #e3f4ef; }
.loan-workspace .loan-option__state[data-state=unavailable] { color: #8a4b12; background: #fbf0e3; }
.loan-workspace .loan-option__desc { display: block; margin: 3px 0 0 24px; font-size: 11px; line-height: 1.45; color: var(--workspace-muted); }
.loan-workspace .loan-option__desc:empty { display: none; }
.loan-workspace .loan-option__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; margin: 6px 0 0 24px; padding-top: 7px; border-top: 1px solid #e8edf2; }
.loan-workspace .loan-option__fields[hidden] { display: none; }
.loan-workspace .loan-option__full { grid-column: 1 / -1; }
.loan-workspace .loan-option__fields .loan-info-help { display: block; margin-top: 3px; font-size: 11px; line-height: 1.4; color: var(--workspace-muted); }
#loanForm .loan-option__fields label[for=lessAdvancePaymentAmount]::after, #loanForm .loan-option__fields label[for=lessAdvancePaymentMonthDisplay]::after { content: none; }
.loan-workspace #lessAdvancePaymentRemarks { display: block; width: 100%; box-sizing: border-box; min-height: 37px; height: 37px; padding: 7px 10px; overflow-y: hidden; border: 1px solid #cbd6e1; border-radius: 6px; background: #fff; color: var(--workspace-ink); font: inherit; font-size: 12px; line-height: 1.35; resize: vertical; }
.loan-workspace #lessAdvancePaymentRemarks:disabled { opacity: .75; cursor: not-allowed; }
@media (max-width: 767px) { .loan-workspace .loan-option__fields { grid-template-columns: 1fr; margin-left: 0; } .loan-workspace .loan-option__desc { margin-left: 0; } .loan-workspace .loan-option__toggle { align-items: flex-start; } .loan-workspace .loan-option__toggle label { font-size: 14px !important; line-height: 20px; } .loan-workspace .loan-option__tag { font-size: 10px !important; line-height: 1.4; } .loan-workspace .loan-option__state { font-size: 11px !important; line-height: 20px; padding-top: 0; padding-bottom: 0; } .loan-workspace .loan-option__toggle input[type=checkbox] { flex-basis: 20px; width: 20px !important; height: 20px !important; } }
html[data-theme=dark] .loan-workspace .loan-option { background: #1d2b39; }
html[data-theme=dark] .loan-workspace .loan-option:has(> .loan-option__toggle input:checked) { background: #223141; border-color: #3d796b; }
html[data-theme=dark] .loan-workspace .loan-option__state { background: #2b3b4b; }
html[data-theme=dark] .loan-workspace .loan-option__state[data-state=available], html[data-theme=dark] .loan-workspace .loan-option__state[data-state=on] { color: #8be0c9; background: #183e38; }
html[data-theme=dark] .loan-workspace .loan-option__state[data-state=unavailable] { color: #f3c48d; background: #3d2d1c; }
html[data-theme=dark] .loan-workspace .loan-option__fields { border-color: var(--workspace-border); }
html[data-theme=dark] .loan-workspace #lessAdvancePaymentRemarks { background: #18232f; border-color: var(--workspace-border); }
.loan-workspace .loan-option__fields .form-group label { margin-bottom: 3px; }
@media (max-width: 1400px) and (min-width: 901px) { .loan-workspace #lessAdvancePaymentRemarks { min-height: 34px; height: 34px; padding-top: 6px; padding-bottom: 6px; } }
@media (min-width: 1800px) { .loan-workspace #lessAdvancePaymentRemarks { min-height: 42px; height: 42px; padding-top: 9px; padding-bottom: 9px; } }
/* Verification Fee: one compact line in Accounting (label, Yes/No, amount, helper); JS toggles display. */
.loan-workspace #verificationFeeGroup { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 4px 10px; margin: 0 0 10px; padding: 7px 10px; border: 1px dashed var(--workspace-border); border-radius: 7px; background: #f9fbfc; }
.loan-workspace #verificationFeeGroup > label { margin: 0; white-space: nowrap; }
#loanForm #verificationFeeGroup > label::after { content: none; }
.loan-workspace #verificationFeeGroup .loan-info-inline { display: flex; align-items: center; gap: 6px; }
.loan-workspace #verificationFeeGroup select { width: 76px; min-height: 30px; height: 30px; padding: 3px 8px; }
.loan-workspace #verificationFeeGroup .loan-info-amount { padding: 2px 8px; border: 1px solid var(--workspace-border); border-radius: 999px; background: #fff; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--workspace-ink); white-space: nowrap; }
.loan-workspace #verificationFeeGroup:has(select option[value=yes]:checked) .loan-info-amount { border-color: #e2b7a4; background: #fbf1ec; color: #8a3b1a; }
.loan-workspace #verificationFeeGroup .loan-info-help { margin: 0; font-size: 11px; line-height: 1.4; color: var(--workspace-muted); }
@media (max-width: 767px) { .loan-workspace #verificationFeeGroup { grid-template-columns: auto minmax(0, 1fr); } .loan-workspace #verificationFeeGroup .loan-info-help { grid-column: 1 / -1; } .loan-workspace #verificationFeeGroup .loan-info-amount { font-size: 11px !important; } }
html[data-theme=dark] .loan-workspace #verificationFeeGroup { background: #1d2b39; }
html[data-theme=dark] .loan-workspace #verificationFeeGroup .loan-info-amount { background: #18232f; }

/* Premium presentation stays within Loan Creation. */
.loan-workspace #pwa-install-btn,
.loan-workspace #pwa-install-button.floating-install-btn { display: none !important; }
.loan-workspace .page-header h1 { font-size: 28px; font-weight: 720; letter-spacing: -.04em; }
.loan-workspace .workspace-eyebrow { color: var(--workspace-accent); font-size: 10px; }
.loan-workspace .workspace-intro { color: var(--workspace-muted); }
.loan-workspace .form-section { border-radius: 12px; box-shadow: 0 3px 12px #172b4005; }
.loan-workspace .form-section legend { text-transform: none; font-size: 14px; letter-spacing: -.01em; }
.loan-workspace .form-group { animation: none; }
.loan-workspace .form-group input:not([type=checkbox]),
.loan-workspace .form-group select { font-size: 14px !important; border-radius: 7px; }
.loan-workspace .form-group input[readonly] { color: #42566c; background: #f3f6f9; border-color: #e4eaf0; }
.loan-workspace .form-group input:not([readonly]):focus,
.loan-workspace .form-group select:focus,
.loan-workspace textarea:focus { border-color: var(--workspace-accent); box-shadow: 0 0 0 3px #116b6514; }
.loan-workspace :is(input, select, textarea, button, summary, a):focus-visible { outline: 3px solid #168b80; outline-offset: 3px; }
.loan-workspace .form-group label { min-height: 17px; }
.loan-workspace .workspace-application .form-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr); }
.loan-workspace #branch { padding-left: 8px; padding-right: 24px; text-overflow: ellipsis; }
.loan-workspace .workspace-client-facts { font-size: 12px; line-height: 1.6; }
.loan-workspace .workspace-profile > summary { font-size: 12px; }
.loan-workspace .workspace-accounting > .form-row:has(#unearnedInterest) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.loan-workspace .workspace-accounting .form-group:has(#unearnedInterest) { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 14px; align-items: center; }
.loan-workspace .workspace-accounting label[for=unearnedInterest] { grid-column: 1; }
.loan-workspace #unearnedInterest { grid-column: 1; }
.loan-workspace #unearnedInterestRate { grid-column: 1; }
.loan-workspace .workspace-accounting .custom-rate-toggle { grid-column: 2; grid-row: 2; margin: 0; line-height: 1.4; }
.loan-workspace #loanForm > .workspace-accounting .form-group label:has(#useCustomInterestRate) { font-size: 12px; }
.loan-workspace #useCustomInterestRate { accent-color: var(--workspace-accent); width: 16px; height: 16px; flex-shrink: 0; }
.loan-workspace #customInterestRateFields { margin-bottom: 12px; padding: 10px 12px; gap: 8px 12px; }
.loan-workspace #customInterestRateFields .custom-rate-info { min-height: 0; gap: 5px; font-size: 12px; }
.loan-workspace #customInterestRateFields input { height: var(--workspace-field-height) !important; min-height: var(--workspace-field-height) !important; padding: 7px 10px; border: 1px solid #cbd6e1; background: #fff; color: var(--workspace-ink); box-shadow: none; font-size: 14px !important; }
.loan-workspace #verificationFeeGroup { border-style: solid; background: #f7f9fb; }
.loan-workspace #verificationFeeGroup select { font-size: 13px !important; }
.loan-workspace #verificationFeeGroup .loan-info-help { font-size: 11px; }
.loan-workspace label[for=netLoanProceeds] { color: var(--workspace-accent) !important; }
.loan-workspace #netLoanProceeds { font-size: 18px !important; background: #edf7f4; }
.loan-workspace .loan-option { background: #f7f9fb; border-radius: 9px; }
.loan-workspace .loan-option__toggle label { font-size: 12px; }
.loan-workspace .loan-option__fields .form-group label { font-size: 11px; }
.loan-workspace #renewalPayoffSuggestion { margin-bottom: 12px; font-size: 12px !important; border-color: var(--workspace-border) !important; }
.loan-workspace #absorptionPreviewContainer { padding: 12px; margin: 0 0 12px; background: #f7f9fb; border: 1px solid var(--workspace-border); border-radius: 9px; }
.loan-workspace #absorptionPreviewContainer > div:first-child { margin-bottom: 8px !important; }
.loan-workspace #absorptionLoansList { padding: 8px !important; max-height: 230px !important; background: #fff !important; }
.loan-workspace #absorptionNoLoansMessage { padding: 12px !important; text-align: left !important; }
.loan-workspace #absorptionNoLoansMessage p { margin-bottom: 4px !important; }
.loan-workspace .workspace-conditional-hint { padding: 12px; margin-bottom: 12px; border: 1px dashed #b7c9d6; border-radius: 9px; background: #f7fafc; color: var(--workspace-muted); font-size: 12px; line-height: 1.55; }
.loan-workspace .workspace-conditional-hint strong { display: block; margin-bottom: 3px; color: var(--workspace-ink); font-size: 13px; }
.loan-workspace .workspace-conditional-hint[hidden] { display: none; }
.loan-workspace[data-awaiting-client=true] #absorptionPreviewContainer,
.loan-workspace[data-awaiting-client=true] #renewalPayoffSuggestion { display: none !important; }
.loan-workspace .workspace-review-bar { padding: 12px 18px; gap: 20px; background: #142d43; border: 1px solid #142d43; box-shadow: 0 8px 26px #142d4326; border-radius: 12px; }
.loan-workspace .workspace-financial-summary { min-width: 0; gap: 24px; }
.loan-workspace .workspace-financial-summary span { color: #bdcedb; font-size: 11px; line-height: 1.35; }
.loan-workspace .workspace-financial-summary output { color: #f0f5fa; font-size: 16px !important; letter-spacing: -.02em; line-height: 1.3; }
.loan-workspace .workspace-net { border-color: #456073; padding-right: 24px; }
.loan-workspace .workspace-net output { color: #91e5d0; font-size: 28px !important; font-weight: 700; letter-spacing: -.035em; }
.loan-workspace .form-actions button { min-height: 40px; font-size: 12px !important; border-radius: 7px; }
.loan-workspace .form-actions button[type=submit] { background: #14796e; border-color: #278c81; }
.loan-workspace .form-actions button[type=submit]:hover { background: #19877b; }
.loan-workspace .form-actions button[type=reset] { background: transparent; border-color: #5b7183; color: #e4edf5; }
.loan-workspace .form-actions button[type=reset]:hover { background: #29465c; }
.loan-workspace .workspace-records { border-radius: 8px; font-size: 12px; }
.loan-workspace .dropdown-list { border-radius: 9px; }
.loan-workspace .dropdown-item { min-height: 38px; font-size: 14px; }
.loan-workspace .modern-sidebar { border: 1px solid #e2e8ef; box-shadow: none; }
.loan-workspace .modern-sidebar .sidebar-link.active { background: #eaf4f1; color: #105f58; box-shadow: inset 3px 0 #14796e; }
.loan-workspace .loan-preview-banner { font-size: 10px; gap: 6px 10px; }
.loan-workspace .loan-preview-banner select { font-size: 11px !important; min-height: 24px !important; height: 24px !important; padding: 1px 22px 1px 6px !important; }
.loan-workspace .loan-preview-banner [aria-label="Synthetic scenario"] { width: 190px; }
.loan-workspace .loan-preview-banner [aria-label="Preview role"] { width: 116px; }
.loan-workspace .loan-preview-banner [aria-label="Preview staff branch"] { width: 100px; }
@media (min-width: 901px) {
    .loan-workspace > .container { padding-left: 240px !important; }
    .loan-workspace .modern-sidebar { width: 210px !important; }
    .loan-workspace .app-header > .header-content { grid-template-columns: minmax(250px, 1fr) auto !important; }
    .loan-workspace .app-header .header-breadcrumb { display: none; }
    .loan-workspace .workspace-accounting .form-group:has(#serviceChargePayable) label { white-space: nowrap; }
}
@media (min-width: 901px) and (max-width: 1400px) {
    .loan-workspace .workspace-review-bar { left: 258px; padding: 10px 14px; gap: 14px; }
    .loan-workspace .workspace-financial-summary { gap: 18px; }
    .loan-workspace .workspace-net { padding-right: 18px; }
    .loan-workspace .loan-preview-banner > span { display: none; }
    .loan-workspace .workspace-application #branch { font-size: 13px !important; }
    .loan-workspace .form-section { padding: 12px 14px; }
}
@media (min-width: 1401px) {
    .loan-workspace .workspace-review-bar { position: sticky; bottom: 14px; }
}
@media (max-width: 900px) {
    .loan-workspace .workspace-review-bar { gap: 14px; padding: 16px; }
    .loan-workspace .workspace-financial-summary { gap: 14px 20px; }
    .loan-workspace .workspace-financial-summary > div { flex: 1 0 auto; }
    .loan-workspace .workspace-net { width: 100%; border-right: 0; padding-right: 0; padding-bottom: 10px; border-bottom: 1px solid #456073; }
    .loan-workspace .form-actions { justify-content: stretch; }
    .loan-workspace .form-actions button { flex: 1; }
    .loan-workspace .workspace-application .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .loan-workspace .workspace-application .form-group:has(#cvNumber) { grid-column: 1 / -1; }
    .loan-workspace .workspace-application #cvSourceGroup { grid-column: 2; }
    .loan-workspace .form-group input:not([type=checkbox]), .loan-workspace .form-group select { font-size: 16px !important; min-height: 42px; }
    .loan-workspace #verificationFeeGroup select { min-height: 34px; }
    .loan-workspace .workspace-loan > .form-row:has(#startDate) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .loan-workspace .workspace-loan .form-group:has(#terms) { grid-column: 1 / -1; }
    .loan-workspace .loan-preview-banner label:first-of-type { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .loan-workspace *, .loan-workspace *::before, .loan-workspace *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
html[data-theme=dark] .loan-workspace .workspace-conditional-hint,
html[data-theme=dark] .loan-workspace #absorptionPreviewContainer { background: #1d2b39; border-color: var(--workspace-border); }
html[data-theme=dark] .loan-workspace .workspace-review-bar { background: #10283c; border-color: #456073; }
html[data-theme=dark] .loan-workspace .form-actions button[type=reset] { color: #e4edf5; }
html[data-theme=dark] .loan-workspace .form-actions button[type=submit] { color: #fff; }
html[data-theme=dark] .loan-workspace #absorptionLoansList { background: #223141 !important; }

.loan-workspace .workspace-application .form-group > label:not(.cv-booklet-choice) { font-size: 11px; white-space: nowrap; }
.loan-workspace .workspace-application .form-group:has(#cvNumber) { min-width: 0; }
@media (min-width: 901px) {
    .loan-workspace .modern-sidebar .sidebar-link, .loan-workspace .modern-sidebar .dropdown-toggle { font-size: 13px !important; }
    .loan-workspace .form-group:has(#unearnedInterest) .custom-rate-toggle { font-size: 11px !important; }
}
/* Keep the review controls reachable while conditional sections expand. */
.loan-workspace #historicalExtensionEntry .hx-entry-button { min-height: 28px !important; }
@media (min-width: 901px) {
    .loan-workspace #loanForm { padding-bottom: 98px; }
    .loan-workspace .workspace-review-bar { position: fixed; bottom: 10px; }
}
@media (min-width: 1401px) {
    .loan-workspace .workspace-review-bar { left: max(268px, calc((100vw - 1538px) / 2 + 28px)); width: min(calc(100vw - 314px), 1704px); }
    .loan-workspace .page-header { padding-top: 16px; padding-bottom: 14px; }
    .loan-workspace .form-section { padding: 16px 20px; }
    .loan-workspace .form-row { gap: 12px 18px; margin-bottom: 12px; }
}
.loan-workspace #loanForm :is(input, select, textarea, button, summary) { scroll-margin-top: 100px; scroll-margin-bottom: 115px; }
.loan-workspace #customInterestRateFields label { font-size: 12px; line-height: 1.4; font-weight: 600; color: var(--workspace-muted); }
.loan-workspace #customInterestRateFields input { border-radius: 7px; }
@media (min-width: 901px) {
    .loan-workspace #startDateSuggestion { display: block; width: calc(300% + 20px); max-width: none; }
}
@media (max-width: 900px) {
    .loan-workspace .workspace-application .form-row { display: flex !important; flex-direction: column; gap: 12px; }
    .loan-workspace .workspace-application #cvSourceGroup { min-height: 0 !important; }
    .loan-workspace #cvSourceConfirmed { width: 20px !important; height: 20px !important; min-width: 20px !important; min-height: 20px !important; }
    .loan-workspace .workspace-application .cv-booklet-choice { min-height: 28px; align-items: center; }
}
html[data-theme=dark] .loan-workspace #customInterestRateFields { background: #332c1e; border-color: #9a7735; }
html[data-theme=dark] .loan-workspace #customInterestRateFields :is(label, .custom-rate-info, .custom-rate-info *) { color: #f4dfb4 !important; }
html[data-theme=dark] .loan-workspace .loan-preview-banner { background: #183e38; color: #b7e6da; border-color: #3d796b; }
html[data-theme=dark] .loan-workspace .loan-preview-guide { background: #1d2b39; color: #b7e6da; border-color: #3d796b; }

/* Supporting copy stays compact while validation remains prominent. */
@media (min-width: 901px) and (max-width: 1400px) { .loan-workspace { --workspace-field-height: 36px; } }
@media (min-width: 1800px) { .loan-workspace { --workspace-field-height: 42px; } }
@media (max-width: 900px) { .loan-workspace { --workspace-field-height: 44px; } }
.loan-workspace #loanForm :is(.form-help, .form-helper-text, .loan-info-help, .loan-option__desc, #startDateSuggestion):not(#extensionFieldsContainer *) {
    font-size: 11px !important;
    line-height: 1.45 !important;
    font-style: normal;
}
.loan-workspace #customInterestRateFields { align-items: start; }
.loan-workspace #customInterestRateFields label { min-height: 17px; margin-bottom: 5px; }
.loan-workspace #customInterestRateFields .custom-rate-info { grid-column: 1 / -1; padding: 4px 8px; gap: 4px; min-height: 0; }
.loan-workspace :is(#renewalPayoffSuggestion, #absorptionPreviewContainer, #isrRequiredNotice, .warning-content) :is(p, small, li, .warning-details) {
    font-size: 11px !important;
    line-height: 1.45;
}
.loan-workspace :is(.error-message, .rlp-error) { font-size: 12px !important; line-height: 1.45 !important; font-weight: 600; color: #b42318; overflow-wrap: anywhere; animation: none; }
.loan-workspace .error-message::before { content: '!'; display: inline-flex; align-items: center; justify-content: center; width: 13px; height: 13px; margin-right: 5px; border: 1px solid currentColor; border-radius: 50%; font-size: 10px; line-height: 1; }
.loan-workspace :is(.warning-icon, .modal-icon, .banner-icon, .success-icon, .step-icon, .acm-header-icon):empty { display: none; }
html[data-theme=dark] .loan-workspace :is(.error-message, .rlp-error) { color: #ffb4aa !important; }
html[data-theme=dark] .loan-workspace #customInterestRateFields input { background: #18232f; border-color: var(--workspace-border); }

.loan-workspace :is(.warning-text, .warning-text strong, .modal-description, .modal-question, .step-subtitle) { font-size: 12px !important; line-height: 1.45; }

@media (max-width: 900px) { .loan-workspace #customInterestRateFields input { font-size: 16px !important; } }

/* Screen only: clear the shared 280px sidebar; direct Ctrl+P keeps the original 240px layout. */
@media screen and (min-width: 901px) {
    .loan-workspace > .container { padding-left: 316px !important; }
}
@media screen and (min-width: 901px) and (max-width: 1400px) {
    .loan-workspace .workspace-review-bar { left: 334px; }
}
/* With the 280px sidebar, 901-1279px is too narrow for three date-bearing fields per row, so reuse the two-column field layout. */
@media screen and (min-width: 901px) and (max-width: 1279px) {
    .loan-workspace .workspace-application .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .loan-workspace .workspace-application .form-group:has(#cvNumber),
    .loan-workspace .workspace-application #cvSourceGroup { grid-column: 1 / -1; grid-row: auto; }
    .loan-workspace .workspace-application #cvSourceGroup { order: 1; }
    .loan-workspace .workspace-loan > .form-row:has(#startDate) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .loan-workspace .workspace-loan .form-group:has(#terms) { grid-column: 1 / -1; }
    .loan-workspace #startDateSuggestion { width: calc(200% + 12px); }
}
/* From 1280px the Application row keeps one line with room for the full mm/dd/yyyy, picker icon and branch placeholder. */
@media screen and (min-width: 1280px) {
    .loan-workspace .workspace-application .form-row { grid-template-columns: minmax(134px, 1fr) minmax(146px, 1.25fr) minmax(0, 1fr); }
}
@media screen and (min-width: 1280px) and (max-width: 1400px) {
    .loan-workspace .workspace-application .form-row { grid-template-columns: minmax(134px, 1fr) minmax(130px, 1.1fr) minmax(115px, 1fr); }
}
@layer application-shell {
    @media screen and (min-width: 901px) {
        :root[data-navigation-shell] body.loan-workspace #loanForm .workspace-review-bar {
            left: var(--workspace-summary-left) !important;
            right: var(--workspace-summary-right) !important;
        }
    }
}

/* Proceeds warnings reflect existing submission rules without changing calculations. */
.loan-workspace .workspace-net-message { display: block; margin-top: 4px; font-size: 11px; line-height: 1.35; color: #b42318; }
.loan-workspace .workspace-net-message[hidden] { display: none; }
.loan-workspace .workspace-net .workspace-net-message { max-width: 240px; color: #ffb4aa; }
body.loan-workspace[data-negative-net=true] #netLoanProceeds { color: #b42318 !important; background: #fff1f0; border-color: #d92d20; }
body.loan-workspace[data-negative-net=true] label[for=netLoanProceeds] { color: #b42318 !important; }
body.loan-workspace[data-negative-net=true] #workspaceNet { color: #ff9a9a !important; }
html[data-theme=dark] .loan-workspace .workspace-net-message { color: #ffb4aa; }
html[data-theme=dark] body.loan-workspace[data-negative-net=true] #netLoanProceeds { color: #ffb4aa !important; background: #422723; border-color: #e67e73; }
html[data-theme=dark] body.loan-workspace[data-negative-net=true] label[for=netLoanProceeds] { color: #ffb4aa !important; }
