*{box-sizing:border-box}body{margin:0;font-family:Segoe UI,Arial,sans-serif;background:#f4f6f8;color:#18212f}.app-shell{display:flex;min-height:100vh}.sidebar{width:275px;background:#101827;color:white;padding:22px 18px;position:sticky;top:0;height:100vh}.brand{display:flex;gap:12px;align-items:center;margin-bottom:28px}.brand-mark{width:42px;height:42px;border-radius:12px;background:#4f8cff;display:grid;place-items:center;font-weight:800;font-size:22px}.brand-title{font-weight:700;font-size:18px}.brand-subtitle{color:#aab5c4;font-size:12px}.sidebar nav{display:flex;flex-direction:column;gap:4px}.sidebar a{color:#e8edf5;text-decoration:none;padding:10px 12px;border-radius:9px}.sidebar a:hover{background:#1c2a3d}.nav-heading{margin:18px 10px 6px;color:#8290a3;font-size:12px;text-transform:uppercase;letter-spacing:.08em}.main{flex:1;min-width:0}.topbar{height:92px;background:#fff;border-bottom:1px solid #e1e6ee;display:flex;align-items:center;padding:0 32px}.kicker{color:#6b7585;font-size:13px}.topbar h1{margin:4px 0 0;font-size:28px}.content{padding:28px 32px}.metrics-grid{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:14px;margin-bottom:18px}.metric-card,.module-card,.grid-card{background:#fff;border:1px solid #dde3ec;border-radius:16px;padding:18px;box-shadow:0 6px 18px rgba(16,24,39,.05)}.metric-label{color:#64748b;font-size:13px;font-weight:600}.metric-value{font-size:34px;font-weight:800;margin-top:4px}.warning{border-left:5px solid #f5c542}.success{border-left:5px solid #22c55e}.danger{border-left:5px solid #ef4444}.dashboard-grid{display:grid;grid-template-columns:repeat(2,minmax(260px,1fr));gap:18px}.module-card{text-decoration:none;color:inherit;min-height:130px}.module-title{font-size:20px;font-weight:700;margin-bottom:8px}.module-text{color:#5f6b7a;line-height:1.45}.toolbar{margin-bottom:16px;display:flex;align-items:center;gap:12px;flex-wrap:wrap}.search-box{height:40px;width:360px;border:1px solid #cfd7e3;border-radius:10px;background:#fff;padding:0 12px}.grid-scroll-wrap{position:relative}.grid-card{overflow:auto;border-top-left-radius:0;border-top-right-radius:0}.grid-scroll-top{overflow-x:auto;overflow-y:hidden;height:18px;background:#fff;border:1px solid #dde3ec;border-bottom:0;border-top-left-radius:16px;border-top-right-radius:16px}.grid-scroll-top>div{height:1px}.edge-scroll{position:fixed;top:50%;transform:translateY(-50%);z-index:50;width:44px;height:88px;border:0;border-radius:12px;background:rgba(37,99,235,.78);color:white;font-size:46px;line-height:1;cursor:pointer;box-shadow:0 8px 20px rgba(15,23,42,.25);opacity:.85}.edge-scroll:hover{opacity:1;background:rgba(37,99,235,.95)}.edge-left{left:290px}.edge-right{right:20px}.edge-scroll.disabled{opacity:.12;pointer-events:none}.data-grid{width:100%;border-collapse:collapse;min-width:1750px}.data-grid th{text-align:left;background:#f8fafc;color:#475569;font-size:12px;text-transform:uppercase;letter-spacing:.04em;padding:11px 12px;border-bottom:1px solid #e2e8f0;white-space:nowrap}.data-grid td{padding:7px 8px;border-bottom:1px solid #edf2f7;font-size:14px}.data-grid tr:hover{background:#eef6ff}.sortable-header{cursor:pointer;user-select:none}.sortable-header:hover{background:#eef2ff}.sortable-header.sort-asc::after{content:' ▲';font-size:10px}.sortable-header.sort-desc::after{content:' ▼';font-size:10px}.filter-panel{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:12px;margin-bottom:14px;background:#fff;border:1px solid #dde3ec;border-radius:14px;padding:14px}.filter-panel label{display:flex;flex-direction:column;gap:5px;font-weight:700;font-size:13px;color:#334155}.filter-panel input,.filter-panel select{height:36px;border:1px solid #cfd7e3;border-radius:9px;padding:0 10px;font:inherit}.secondary-button{background:#e2e8f0;color:#334155;border:0;border-radius:10px;padding:10px 14px;font-weight:700;cursor:pointer}.secondary-button:hover{background:#cbd5e1}.secondary-link{color:#475569;text-decoration:none;font-weight:700;padding:8px 10px;border-radius:8px}.secondary-link:hover,.secondary-link.active-filter{background:#dbeafe;color:#1d4ed8}.strong{font-weight:700}.strong-input{font-weight:700}.row-ready{background:#e8f8ee}.row-efile{background:#e8f1ff}.row-unpaid{background:#fff4e5}.row-urgent{background:#fee2e2}.row-archived{background:#e5e7eb;color:#6b7280}.cell-edit,.new-cell{width:100%;border:1px solid transparent;background:transparent;padding:6px;font:inherit;border-radius:6px}.cell-edit:focus,.new-cell:focus{background:#fff;border-color:#8ab4f8;outline:none}.cell-edit.saving{background:#fff8dc}.small{width:75px}.medium{width:115px}.wide{min-width:185px}.checkbox-cell{width:18px;height:18px;cursor:pointer}.center-cell{text-align:center}.action-cell{white-space:nowrap}select.cell-edit,select.new-cell{min-width:110px;cursor:pointer}.primary-button{display:inline-block;background:#2563eb;color:white;text-decoration:none;border:0;border-radius:10px;padding:10px 14px;font-weight:700;cursor:pointer;margin-right:0}.mini-button{background:#2563eb;color:white;border:0;border-radius:8px;padding:7px 10px;font-weight:700;cursor:pointer;margin-right:4px}.mini-button.secondary{background:#64748b}.danger-button{background:#dc2626}.new-row{background:#fef9c3}.hidden{display:none!important}.form-card{max-width:900px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(240px,1fr));gap:16px}.form-grid label{display:flex;flex-direction:column;gap:6px;font-weight:700;color:#334155}.form-grid input,.form-grid select,.form-grid textarea{border:1px solid #cfd7e3;border-radius:10px;padding:9px 10px;font:inherit}.form-grid textarea{min-height:90px}.full-width{grid-column:1 / -1}.checkbox-label{display:flex!important;flex-direction:row!important;align-items:center!important;gap:8px!important}.normal-checkbox{width:auto!important;height:auto!important;margin:0!important}.form-actions{margin-top:18px;display:flex;align-items:center;gap:14px}.help-box{margin:0 0 14px 0;padding:12px 14px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px;color:#475569;line-height:1.45}.admin-form{margin-top:16px;display:grid;grid-template-columns:repeat(2,minmax(130px,1fr));gap:12px;align-items:end}.admin-form label{display:flex;flex-direction:column;gap:6px;font-weight:700;color:#334155}.admin-form input{height:38px;border:1px solid #cfd7e3;border-radius:9px;padding:0 10px;font:inherit}.admin-form button{grid-column:1 / -1}@media(max-width:1100px){.metrics-grid,.dashboard-grid,.filter-panel{grid-template-columns:1fr}.edge-left{left:8px}.edge-right{right:8px}}.draggable-header{cursor:grab}.draggable-header:active{cursor:grabbing}.drag-over-column{outline:2px solid #2563eb;outline-offset:-2px;background:#dbeafe!important}.dragging-column{opacity:.55}
/* Client Detail v1 */
.detail-action-cell{text-align:center;min-width:54px}.detail-icon-link{display:inline-grid;place-items:center;width:30px;height:30px;border-radius:999px;background:#eef5ff;border:1px solid #b8d3f5;color:#063b70;font-size:17px;font-weight:800;text-decoration:none;line-height:1}.detail-icon-link:hover{background:#dbeafe;text-decoration:none}.muted-cell{color:#94a3b8;text-align:center}.client-detail-toolbar{margin-bottom:14px}.client-detail-header{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;margin-bottom:18px}.client-detail-header h2{margin:4px 0 6px;font-size:30px;color:#111827}.client-detail-subtitle{color:#64748b;font-weight:600}.client-detail-actions{min-width:260px;display:flex;justify-content:flex-end}.client-document-text{margin:0;max-width:420px}.client-detail-grid{display:grid;grid-template-columns:minmax(320px,1.2fr) minmax(320px,.8fr);gap:18px;margin-bottom:18px}.detail-fields{display:grid;grid-template-columns:repeat(2,minmax(180px,1fr));gap:14px}.detail-fields label{display:flex;flex-direction:column;gap:6px;font-weight:700;color:#334155}.client-detail-edit,.client-notes-edit{border:1px solid #cfd7e3;border-radius:10px;padding:9px 10px;font:inherit;background:#fff;width:100%}.client-detail-edit:focus,.client-notes-edit:focus{border-color:#8ab4f8;outline:none;box-shadow:0 0 0 3px rgba(6,59,112,.12)}.client-detail-edit.saving,.client-notes-edit.saving{background:#fff8dc}.client-notes-edit{min-height:240px;resize:vertical}.save-note{margin-top:10px;color:#64748b;font-size:13px}.client-history-card{overflow:auto}.client-history-grid{min-width:980px}.client-history-grid td{vertical-align:top}.client-history-grid a{color:#063b70;font-weight:800;text-decoration:none}.client-history-grid a:hover{text-decoration:underline}@media(max-width:1100px){.client-detail-header{flex-direction:column}.client-detail-actions{justify-content:flex-start}.client-detail-grid{grid-template-columns:1fr}.detail-fields{grid-template-columns:1fr}}
.detail-header{width:28px;min-width:28px;max-width:28px;padding-left:4px!important;padding-right:4px!important}.detail-action-cell{width:28px!important;min-width:28px!important;max-width:28px!important;text-align:center;padding-left:3px!important;padding-right:3px!important}.detail-icon-link{display:inline-grid;place-items:center;width:20px;height:20px;border-radius:6px;background:transparent;border:1px solid transparent;color:#2563eb;font-size:12px;font-weight:800;text-decoration:none;line-height:1}.detail-icon-link:hover{background:#dbeafe;border-color:#bfdbfe;text-decoration:none}.client-summary-strip{display:grid;grid-template-columns:repeat(5,minmax(120px,1fr));gap:12px;margin-bottom:18px;min-height:0}.summary-item{border:1px solid #e2e8f0;border-radius:12px;padding:12px;background:#f8fafc}.summary-item span{display:block;color:#64748b;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.04em}.summary-item strong{display:block;margin-top:4px;color:#111827;font-size:16px}.crm-detail-grid{grid-template-columns:minmax(380px,1.15fr) minmax(300px,.85fr)}.crm-note-help{margin-top:-2px;margin-bottom:12px}.document-open-button{margin-bottom:14px}.document-location-label{display:flex;flex-direction:column;gap:6px;font-weight:700;color:#334155;margin-top:12px}@media(max-width:1100px){.client-summary-strip{grid-template-columns:1fr}.crm-detail-grid{grid-template-columns:1fr}}

/* Client Link v1 */
.client-master-card{margin-bottom:18px}.client-master-title-row{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}.master-link-help{margin:0;max-width:820px}.master-link-status{font-weight:800;border-radius:999px;padding:7px 12px;font-size:13px;white-space:nowrap}.master-link-status.linked{background:#dcfce7;color:#166534;border:1px solid #86efac}.master-link-status.unlinked{background:#fff7ed;color:#9a3412;border:1px solid #fed7aa}.linked-master-client{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;margin-top:14px;padding:14px;border:1px solid #dbeafe;background:#eff6ff;border-radius:14px}.master-small-line{font-size:12px;color:#64748b;margin-top:4px}.inline-form{margin:0}.master-client-search-form{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:14px}.master-client-search-box{width:420px;max-width:100%}.master-client-results-wrap{margin-top:14px;overflow:auto}.master-client-results{min-width:850px}.master-client-results td{vertical-align:top}.master-client-results form{margin:0}@media(max-width:800px){.client-master-title-row,.linked-master-client{flex-direction:column}.master-client-search-form{align-items:stretch}.master-client-search-form button{width:100%}}

/* Client Detail portal document fields */
.portal-document-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.document-link-row {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    flex-wrap: wrap;
    font-size: 0.92rem;
}

.small-module-title {
    margin-top: 0.8rem;
    font-size: 0.95rem;
}


/* Embedded TaxPortal workflow */
.card { background: rgba(255,255,255,.94); border: 1px solid #d9e2ec; border-radius: 14px; padding: 18px; margin: 16px 0; box-shadow: 0 8px 22px rgba(15,35,65,.07); }
.page-header, .section-header, .button-row, .page-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.button, button, .primary, .button.primary { border: 0; border-radius: 10px; padding: 9px 14px; text-decoration: none; cursor: pointer; display: inline-block; }
.button, button { background: #eef3f8; color: #15395b; }
.primary, .button.primary, button.primary { background: #0b5cab; color: #fff; }
.button.light { background: #f7f9fb; color: #25435f; }
.button.danger, button.danger { background: #b42318; color: #fff; }
.button.small, button.small { padding: 5px 9px; font-size: .85rem; border-radius: 8px; }
.form-grid, .details-grid, .signer-field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.form-grid .wide { grid-column: 1 / -1; }
.stacked-form { display: grid; gap: 12px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input, .stacked-form input, .form-grid input, .form-grid select, .signer-field-grid input { border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px 10px; min-height: 36px; }
.muted { color: #64748b; }
.small { font-size: .85rem; }
.validation, .text-danger { color: #b42318; }
.alert { border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.alert.warning { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; }
.alert.success { background: #ecfdf3; border: 1px solid #abefc6; color: #027a48; }
.pill { display: inline-block; border-radius: 999px; padding: 4px 10px; background: #e2e8f0; font-size: .85rem; font-weight: 700; }
.workflow-card { display: flex; gap: 14px; align-items: flex-start; }
.workflow-step-number { width: 34px; height: 34px; border-radius: 50%; background: #0b5cab; color: #fff; display:flex; align-items:center; justify-content:center; font-weight:700; flex: 0 0 auto; }
.workflow-step-body { flex: 1; min-width: 0; }
.signer-identity-card { border: 1px solid #dbe5ee; border-radius: 12px; padding: 12px; background: #fbfdff; margin: 10px 0; }
.signature-link-box { background: #f8fafc; border: 1px solid #dbe5ee; border-radius: 10px; padding: 10px; overflow-wrap: anywhere; margin: 8px 0; }
.audit-table td, .audit-table th { vertical-align: top; }
.placement-layout { display: grid; grid-template-columns: minmax(280px, 1fr) 320px; gap: 14px; }
.placement-preview-shell { border: 1px solid #cbd5e1; background: #f8fafc; border-radius: 10px; overflow: auto; min-height: 360px; }
.placement-preview { position: relative; min-height: 360px; }
.placement-side-panel { border: 1px solid #dbe5ee; border-radius: 12px; padding: 12px; background: #fff; }
.placement-toolbar { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.placement-fields label { display: block; margin: 6px 0; }
.placement-fields input, .placement-fields select { width: 100%; }
@media (max-width: 900px) { .placement-layout { grid-template-columns: 1fr; } }

/* TaxPortal merge v14.3 cleanup: better placement tool + external client signing shell */
.placement-designer {
    border: 1px solid #d8e4f0;
    border-radius: 14px;
    padding: 14px;
    background: #f8fbff;
}
.placement-toolbar {
    align-items: center;
    background: #eef6ff;
    border: 1px solid #d6e7fb;
    border-radius: 12px;
    padding: 10px;
}
.placement-toolbar-group { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.placement-layout { grid-template-columns: minmax(420px, 1fr) 340px; }
.placement-preview-shell {
    background: #e7edf5;
    padding: 16px;
    min-height: 620px;
}
.placement-preview {
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
    touch-action: none;
}
.placement-preview canvas { display:block; }
.placement-side-panel { position: sticky; top: 12px; align-self: start; }
.placement-instructions {
    background: #f1f7ff;
    border: 1px solid #d6e7fb;
    color: #244969;
    border-radius: 10px;
    padding: 10px;
    line-height: 1.35;
}
.signature-box-list { display:grid; gap:7px; margin: 10px 0 14px; }
.signature-box-list-item {
    width: 100%;
    border: 1px solid #dbe5ee;
    border-radius: 10px;
    background: #fff;
    color: #1f3b57;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    text-align:left;
    padding: 9px 10px;
}
.signature-box-list-item.selected { border-color:#0b5cab; background:#eaf4ff; box-shadow:0 0 0 3px rgba(11,92,171,.12); }
.signature-box-list-item span { color:#64748b; font-size:.82rem; }
.placement-box {
    position:absolute;
    z-index: 3;
    display:flex;
    align-items:center;
    justify-content:center;
    gap: 8px;
    border: 2px solid #0b5cab;
    background: rgba(37, 99, 235, .15);
    color:#063b70;
    border-radius: 8px;
    font-weight:800;
    cursor: move;
    user-select:none;
    touch-action:none;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .18);
}
.placement-box.spouse-box { border-color:#9a3412; background:rgba(249,115,22,.14); color:#7c2d12; }
.placement-box.selected { outline: 4px solid rgba(11,92,171,.23); }
.placement-box.dragging { opacity:.92; cursor:grabbing; }
.placement-box.pulse { animation: placementPulse .7s ease-in-out; }
.placement-box-delete {
    position:absolute;
    top:-11px;
    right:-11px;
    width:24px;
    height:24px;
    border-radius:999px;
    padding:0;
    line-height:1;
    display:grid;
    place-items:center;
    background:#b42318!important;
    color:#fff!important;
    border:2px solid #fff!important;
    font-size:16px;
    box-shadow:0 4px 10px rgba(15,23,42,.2);
}
.box-editor-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
@keyframes placementPulse { 0% { transform: scale(1); } 50% { transform: scale(1.035); } 100% { transform: scale(1); } }

.client-signing-body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(180deg, #f3f8fd 0%, #eef3f8 55%, #e7edf5 100%);
    color: #18212f;
    font-family: Segoe UI, Arial, sans-serif;
}
.client-signing-topbar {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    padding: 18px 28px;
    background: #fff;
    border-bottom: 1px solid #dbe5ee;
    box-shadow: 0 4px 18px rgba(15,35,65,.06);
}
.client-signing-brand { display:flex; align-items:center; gap:12px; }
.client-signing-logo {
    width:42px;
    height:42px;
    border-radius:12px;
    background:#0b5cab;
    color:#fff;
    display:grid;
    place-items:center;
    font-weight:900;
    font-size:22px;
}
.client-signing-brand-title { font-weight:800; font-size:18px; color:#10243a; }
.client-signing-brand-subtitle { color:#64748b; font-size:13px; }
.client-signing-secure-badge {
    color:#166534;
    background:#dcfce7;
    border:1px solid #86efac;
    border-radius:999px;
    padding:7px 12px;
    font-weight:800;
    font-size:13px;
}
.client-signing-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 24px auto 36px;
}
.client-signing-shell .page-header {
    background: #fff;
    border: 1px solid #dbe5ee;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(15,35,65,.07);
}
.client-signing-shell .page-header h1 { margin:0 0 6px; color:#10243a; }
.client-signing-shell .card {
    background:#fff;
    border-radius:18px;
    box-shadow: 0 10px 28px rgba(15,35,65,.08);
}
.client-signing-footer {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 28px;
    color:#64748b;
    font-size:13px;
    display:flex;
    justify-content:space-between;
    gap:14px;
    flex-wrap:wrap;
}
.client-sign-preview-shell { max-height: 76vh; }
.client-sign-box {
    position:absolute;
    z-index:4;
    border: 3px solid #0b5cab;
    background: rgba(37,99,235,.18);
    color:#063b70;
    border-radius:10px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    font-weight:800;
    box-shadow: 0 8px 20px rgba(15,23,42,.2);
}
.client-sign-box:hover, .client-sign-box.active-next-signature { background: rgba(37,99,235,.26); outline: 5px solid rgba(11,92,171,.18); }
.client-sign-box.signed { border-color:#166534; background:rgba(34,197,94,.18); color:#14532d; }
.client-sign-box.spouse-box { border-color:#9a3412; background:rgba(249,115,22,.16); color:#7c2d12; }
.client-sign-progress {
    padding:10px 12px;
    border-radius:12px;
    background:#eef6ff;
    border:1px solid #d6e7fb;
    color:#063b70;
    font-weight:800;
    margin: 8px 0;
}
.signature-certification {
    display:flex;
    align-items:flex-start;
    gap:10px;
    padding:12px;
    background:#f8fafc;
    border:1px solid #dbe5ee;
    border-radius:12px;
    margin: 10px 0;
    font-weight:700;
}
.signature-next-modal-overlay {
    position:fixed;
    inset:0;
    z-index:9999;
    background:rgba(15,23,42,.45);
    display:grid;
    place-items:center;
    padding:20px;
}
.signature-next-modal-overlay[hidden] { display:none; }
.signature-next-modal {
    max-width:520px;
    background:#fff;
    border-radius:18px;
    padding:24px;
    box-shadow:0 20px 70px rgba(15,23,42,.35);
}
.signature-next-modal h3 { margin-top:0; }
@media (max-width: 900px) {
    .placement-layout { grid-template-columns:1fr; }
    .placement-side-panel { position:static; }
    .placement-preview-shell { min-height:420px; }
    .client-signing-topbar { padding:14px 16px; }
}

/* TaxPortal merge v14.4: reduce wrapped technical text, fix overlapping labels, clean search/upload selection UI */
*, *::before, *::after { box-sizing: border-box; }

.compact-page-header { margin-bottom: 14px; }
.compact-page-header h1 { margin-bottom: 4px; }
.compact-page-header p { margin: 0; color: #64748b; font-weight: 600; }
.compact-card h2 { margin-top: 0; }

.return-upload-form { display: grid; gap: 16px; }
.return-workitem-list { display: grid; gap: 10px; margin: 12px 0 14px; }
.return-workitem-card {
    display: grid;
    grid-template-columns: 28px minmax(180px, 1fr) minmax(160px, .9fr) minmax(220px, 1fr);
    gap: 12px;
    align-items: center;
    border: 1px solid #d8e4f0;
    border-radius: 14px;
    background: #fff;
    padding: 12px;
    cursor: pointer;
    line-height: 1.28;
    min-width: 0;
}
.return-workitem-card:hover { border-color:#8ab4f8; background:#f8fbff; }
.return-workitem-card input[type="radio"] { width: 18px; height: 18px; }
.return-workitem-main, .return-workitem-return, .return-workitem-statuses { min-width:0; }
.return-workitem-main, .return-workitem-return { display:grid; gap:3px; }
.return-workitem-client, .return-workitem-title { font-weight: 800; color:#10243a; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.return-workitem-subline { color:#64748b; font-size:.86rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.return-workitem-statuses { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
.mini-status {
    display:inline-flex;
    align-items:center;
    gap:5px;
    border:1px solid #dbe5ee;
    background:#f8fafc;
    color:#334155;
    border-radius:999px;
    padding:5px 8px;
    font-size:.78rem;
    max-width: 150px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.mini-status b { color:#0b5cab; }
.return-workitem-card.unavailable { cursor: default; grid-template-columns:minmax(220px,.8fr) minmax(260px,1fr); }
.upload-panel { border-top:1px solid #e2e8f0; padding-top:14px; display:grid; gap:12px; }
.compact-form-grid { align-items:end; }

.compact-link-grid { display:grid; gap:10px; margin-top:12px; }
.compact-link-card {
    display:grid;
    grid-template-columns:minmax(180px, 1fr) auto;
    gap:8px 12px;
    align-items:center;
    border:1px solid #dbe5ee;
    border-radius:12px;
    background:#f8fafc;
    padding:12px;
    min-width:0;
}
.compact-link-card strong { display:block; color:#10243a; }
.compact-link-card span { display:block; color:#64748b; font-size:.85rem; margin-top:2px; }
.compact-link-card input {
    grid-column:1 / -1;
    width:100%;
    min-width:0;
    border:1px solid #cbd5e1;
    border-radius:8px;
    padding:7px 9px;
    font-family: Consolas, "Courier New", monospace;
    font-size:.82rem;
    color:#334155;
    background:#fff;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.technical-details-card details { width:100%; }
.technical-details-card summary { cursor:pointer; font-weight:800; color:#0b5cab; }
.compact-details-grid { margin-top:12px; }
.technical-value, .audit-details code {
    display:block;
    max-width:100%;
    overflow:auto;
    white-space:nowrap;
    word-break:normal;
    overflow-wrap:normal;
    border:1px solid #e2e8f0;
    border-radius:8px;
    background:#f8fafc;
    padding:7px 9px;
    color:#475569;
    font-family: Consolas, "Courier New", monospace;
    font-size:.82rem;
    line-height:1.35;
}
.audit-details { max-width: 520px; }
.audit-details code { max-height: 90px; }

.placement-toolbar, .placement-toolbar-group, .button-row, .section-header { min-width:0; }
.placement-toolbar strong, .placement-toolbar .muted { line-height:1.3; }
.placement-fields label, .signer-identity-card label, .form-grid label, .signer-field-grid label {
    line-height:1.25;
    min-width:0;
}
.placement-fields input, .placement-fields select,
.signer-identity-card input, .form-grid input, .form-grid select, .signer-field-grid input,
.inline-form input, .stacked-form input {
    max-width:100%;
    min-width:0;
    line-height:1.25;
}
.signature-box-list-item { line-height:1.25; min-height:44px; }
.signature-box-list-item strong,
.signature-box-list-item span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.placement-box, .client-sign-box {
    line-height:1.15;
    text-align:center;
    overflow:hidden;
    padding: 4px 7px;
}
.placement-box { white-space:nowrap; font-size: 13px; }
.client-sign-box { font-size: 13px; }
.placement-box span, .client-sign-box span { pointer-events:none; }

.client-signing-shell .page-header { align-items:flex-start; }
.client-signing-shell .page-header p { margin: 0; color:#64748b; }
.client-click-sign-card h2, .signing-card h2 { line-height:1.2; }
.signature-certification { line-height:1.35; }

@media (max-width: 1050px) {
    .return-workitem-card { grid-template-columns: 28px minmax(180px,1fr); }
    .return-workitem-return, .return-workitem-statuses { grid-column:2; justify-content:flex-start; }
}
@media (max-width: 700px) {
    .return-workitem-card { grid-template-columns: 24px minmax(0,1fr); padding:10px; }
    .return-workitem-card.unavailable { grid-template-columns: 1fr; }
    .compact-link-card { grid-template-columns:1fr; }
    .compact-link-card .button { justify-self:start; }
    .mini-status { max-width:100%; }
}

/* TaxPortal merge v14.5: fix global .small collision and hide technical noise */
.helper-text,
.muted.small,
p.small,
span.small,
div.small {
    width: auto !important;
    max-width: 920px;
    min-width: 0;
    display: block;
    line-height: 1.45;
    font-size: .92rem;
}

.compact-card > .helper-text,
.signer-identity-card .helper-text,
.identity-source-row .helper-text {
    margin: 6px 0 12px;
}

.inline-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    max-width: 720px;
}

.inline-form input {
    width: min(360px, 100%);
    flex: 1 1 260px;
}

.compact-card {
    padding: 18px 20px;
}

.compact-card h2 {
    line-height: 1.2;
}

.signer-send-panel,
.signer-identity-card,
.signer-field-grid,
.internal-verification-grid {
    min-width: 0;
}

.signer-identity-card {
    padding: 16px;
}

.identity-source-row {
    max-width: 740px;
}

.taxpayer-identity-source-row {
    width: 100%;
    max-width: none;
}

.internal-verification-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    align-items: end;
}

.taxpayer-verification-grid {
    grid-template-columns: minmax(220px, 1fr);
}

.technical-details-card,
.audit-log-card {
    background: rgba(255,255,255,.72);
    box-shadow: none;
}

.technical-details-card summary,
.audit-log-card summary {
    cursor: pointer;
    color: #0b5cab;
    font-weight: 800;
    line-height: 1.25;
}

.technical-detail-list {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.technical-detail-list label {
    display: block;
    margin-bottom: 5px;
    color: #475569;
    font-weight: 800;
}

.technical-value {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
}

.audit-table-wrap {
    overflow-x: auto;
    margin-top: 10px;
}

.audit-table {
    width: 100%;
    min-width: 880px;
    table-layout: fixed;
    border-collapse: collapse;
}

.audit-table th,
.audit-table td {
    vertical-align: top;
    padding: 9px 10px;
    border-bottom: 1px solid #e2e8f0;
    line-height: 1.25;
}

.audit-table th:nth-child(1), .audit-table td:nth-child(1) { width: 170px; white-space: nowrap; }
.audit-table th:nth-child(2), .audit-table td:nth-child(2) { width: 190px; }
.audit-table th:nth-child(3), .audit-table td:nth-child(3) { width: 160px; }
.audit-table th:nth-child(4), .audit-table td:nth-child(4) { width: auto; }

.audit-details {
    max-width: none;
    min-width: 0;
}

.audit-details code {
    max-width: 100%;
    max-height: 70px;
    overflow: auto;
    white-space: nowrap;
    font-size: .78rem;
}

.return-workitem-card,
.compact-link-card,
.signer-identity-card,
.workflow-card {
    overflow: hidden;
}

@media (max-width: 900px) {
    .internal-verification-grid { grid-template-columns: 1fr; }
    .inline-form { max-width: none; }
    .helper-text,
    .muted.small,
    p.small,
    span.small,
    div.small { max-width: 100%; }
}

/* v14.6 return-flow cleanup */
.reset-prep-form {
    margin-top: 12px;
}

.reset-prep-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.88);
}

.reset-prep-box p {
    margin: 4px 0 0;
    max-width: none;
}

.portal-file-search input {
    min-width: min(520px, 100%);
}

.portal-file-list {
    display: grid;
    gap: 12px;
}

.portal-file-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    background: rgba(255,255,255,0.92);
}

.portal-file-card.inactive {
    opacity: .65;
    background: rgba(248,250,252,.82);
}

.portal-file-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.portal-file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: #64748b;
    font-size: 13px;
    margin-bottom: 6px;
}

.portal-file-path {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 8px;
}

.portal-file-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 900px) {
    .portal-file-card,
    .reset-prep-box {
        grid-template-columns: 1fr;
        display: block;
    }

    .portal-file-actions,
    .reset-prep-box button {
        margin-top: 12px;
    }
}

/* v14.7: Client Detail return file manager */
.client-section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.return-file-list {
    display: grid;
    gap: .75rem;
}

.return-file-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .85rem 1rem;
    border: 1px solid rgba(15, 65, 110, .14);
    border-radius: 14px;
    background: rgba(248, 251, 255, .92);
}

.return-file-card.inactive {
    opacity: .62;
    background: rgba(245, 245, 245, .9);
}

.return-file-main {
    min-width: 0;
    flex: 1;
}

.return-file-meta {
    margin-top: .2rem;
    color: #60718a;
    font-size: .88rem;
}

.return-file-path {
    max-width: 100%;
    margin-top: .2rem;
    color: #60718a;
    font-size: .82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.return-file-actions {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.return-file-actions .inline-form {
    margin: 0;
    display: inline-flex;
}

@media (max-width: 900px) {
    .client-section-title-row,
    .return-file-card {
        align-items: stretch;
        flex-direction: column;
    }

    .return-file-actions {
        justify-content: flex-start;
    }
}

/* v14.9: Client Detail layout cleanup */
.client-return-files-card {
    margin-bottom: 18px;
}

.client-return-files-card .client-section-title-row {
    align-items: center;
}

.upload-return-button {
    white-space: nowrap;
}

.client-return-file-list {
    grid-template-columns: 1fr;
}

.client-notes-card {
    margin-bottom: 18px;
}

.client-notes-card .client-notes-edit {
    min-height: 130px;
}

.return-file-delete-form {
    margin: 0;
    display: inline-flex;
    align-items: center;
}

.return-file-delete-form button {
    cursor: pointer;
}

.success-box {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.warning-box {
    border-color: #fecaca;
    background: #fff7f7;
    color: #991b1b;
}

.warning-details {
    color: #991b1b;
    margin: -6px 0 12px;
}

@media (min-width: 1101px) {
    .return-file-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }
}

/* v14.10: return flow polish */
.client-detail-header {
    align-items: center;
}
.client-detail-actions.client-detail-status-actions {
    min-width: 0;
    align-items: center;
}
.client-return-files-card .upload-return-button {
    background: #0b5cab;
    color: #fff;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 800;
    text-decoration: none;
}

.placement-designer {
    background: #fff;
    border-color: #dbe4f0;
}
.placement-toolbar {
    background: transparent;
    border: 0;
    padding: 0 0 10px;
}
.placement-toolbar-group {
    gap: 10px;
}
.placement-toolbar-group button,
.box-editor-actions button {
    min-width: 132px;
    border-radius: 11px;
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .08);
}
[data-placement-action="add-taxpayer"] {
    background: #0b5cab;
    color: #fff;
}
[data-placement-action="add-spouse"],
button.spouse-action {
    background: #f97316;
    color: #fff;
}
[data-placement-action="previous-page"],
[data-placement-action="next-page"] {
    min-width: 104px;
    background: #eef3f8;
    color: #15395b;
}
.placement-toolbar-bottom {
    justify-content: center;
    margin-top: 12px;
    margin-bottom: 0;
    padding-top: 12px;
    border-top: 1px solid #dbe4f0;
}
.placement-toolbar-bottom-group {
    justify-content: center;
}
.return-prepare-actions {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}
.return-prepare-actions > button {
    justify-self: start;
}
.return-prepare-actions .preview-prepared-button {
    grid-column: 2;
    justify-self: center;
    min-width: 220px;
    text-align: center;
    font-size: 1rem;
}
.inline-reset-prep-form {
    margin-top: 10px;
    display: flex;
    justify-content: center;
}
.inline-reset-prep-form .button {
    min-width: 220px;
}
.exception-card {
    margin-top: 12px;
    opacity: .94;
}
.exception-card summary {
    cursor: pointer;
    font-weight: 800;
    color: #7f1d1d;
}
.exception-action-grid {
    margin-top: 12px;
}
.audit-event {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.audit-table th:nth-child(2), .audit-table td:nth-child(2) {
    width: 160px;
    white-space: normal;
}

.return-workitem-statuses {
    align-items: center;
}
.mini-status {
    max-width: 130px;
}
.mini-status b {
    display: none;
}
.mini-status:first-child::before {
    content: "Status";
    color: #0b5cab;
    font-weight: 800;
    margin-right: 4px;
}
.mini-status:nth-child(2)::before {
    content: "Paid";
    color: #0b5cab;
    font-weight: 800;
    margin-right: 4px;
}
.mini-status:nth-child(3)::before {
    content: "E-file";
    color: #0b5cab;
    font-weight: 800;
    margin-right: 4px;
}

@media (max-width: 900px) {
    .return-prepare-actions {
        grid-template-columns: 1fr;
    }
    .return-prepare-actions .preview-prepared-button {
        grid-column: auto;
        width: 100%;
    }
    .return-prepare-actions > button,
    .inline-reset-prep-form .button {
        width: 100%;
    }
}

/* TaxPortal merge v14.11 polish */
.upload-step-card { padding: 14px 18px; margin: 12px 0; }
.upload-step-card h2 { margin: 0 0 8px; font-size: 1.45rem; }
.upload-step-card .helper-text { margin: 0 0 10px; max-width: none; }
.upload-step-card .inline-form { display: grid; grid-template-columns: minmax(260px, 520px) auto; gap: 10px; align-items: center; }
.upload-step-card .inline-form input { width: 100%; }
.return-workitem-list { margin-top: 8px; display: grid; gap: 8px; }
.return-workitem-card { padding: 12px 14px; min-height: 70px; display: grid; grid-template-columns: 28px minmax(240px, 1.2fr) minmax(180px, .8fr) auto; align-items: center; gap: 14px; }
.return-workitem-statuses.single-status { justify-content: flex-end; }
.return-workitem-statuses.single-status .mini-status { max-width: none; min-width: 120px; padding: 7px 12px; }
.upload-panel { margin-top: 14px; padding-top: 12px; border-top: 1px solid #dbe5ee; }
.upload-panel .compact-form-grid { grid-template-columns: minmax(180px, 260px) 1fr; align-items: end; }
.upload-return-submit { display: inline-block; width: auto !important; min-width: 210px; margin-top: 12px; padding: 10px 18px; font-weight: 800; font-size: .98rem; background: #0b5cab !important; }

#addSpouseSignatureBox,
button.spouse-action {
    background: rgba(249,115,22,.14) !important;
    color: #7c2d12 !important;
    border: 2px solid #9a3412 !important;
}
.signature-box-list-item.spouse-list-item {
    border-color: #9a3412;
    background: rgba(249,115,22,.14);
    color: #7c2d12;
}
.signature-box-list-item.spouse-list-item.selected {
    border-color: #9a3412;
    background: rgba(249,115,22,.20);
    box-shadow: 0 0 0 3px rgba(154,52,18,.15);
}
.signature-box-list-item.taxpayer-list-item.selected {
    border-color: #0b5cab;
    background: rgba(37,99,235,.12);
}
.signature-box-list-item strong { overflow-wrap: anywhere; }

.return-pdf-action-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}
.return-pdf-action-row .button { min-width: 220px; text-align: center; font-weight: 800; }
.return-pdf-action-row .prepare-pdf-button { flex: 1 1 100%; width: 100%; min-width: 0; }
.prepare-pdf-button.button.primary { background: #0b5cab; color: #fff; }
.prepare-pdf-button.button.light { width: 100%; }
.hidden-reset-prep-form { display: none; }
.return-prepare-actions, .inline-reset-prep-form { display: none !important; }

.client-audit-card summary { cursor: pointer; color: #063b70; font-weight: 800; }
.client-audit-list { display: grid; gap: 7px; margin-top: 10px; }
.client-audit-row { display: grid; grid-template-columns: 150px minmax(160px, .8fr) minmax(120px, .6fr) minmax(120px, 1fr); gap: 10px; align-items: start; padding: 9px 10px; border: 1px solid #dbe5ee; border-radius: 10px; background: #f8fafc; }
.client-audit-time, .client-audit-actor { color: #64748b; font-size: .88rem; }
.client-audit-event { font-weight: 800; overflow-wrap: anywhere; }
.client-audit-details summary { font-size: .86rem; color: #64748b; }
.client-audit-details code { display: block; margin-top: 6px; max-height: 90px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px; font-size: .78rem; }
.audit-event { white-space: normal !important; overflow-wrap: anywhere !important; word-break: break-word !important; }

@media (max-width: 900px) {
    .upload-step-card .inline-form,
    .return-workitem-card,
    .upload-panel .compact-form-grid,
    .client-audit-row { grid-template-columns: 1fr; }
    .upload-return-submit, .return-pdf-action-row .button { width: 100% !important; }
}

/* v14.13 workflow layout cleanup */
.client-detail-toolbar { display: none !important; }
.compact-client-detail-header {
    display: grid;
    grid-template-columns: minmax(240px, .95fr) minmax(520px, 1.55fr);
    align-items: center;
    gap: 18px;
    margin-top: 0;
    margin-bottom: 14px;
    padding: 18px 20px;
}
.compact-client-detail-header h2 { margin: 2px 0 4px; }
.client-header-status-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(105px, 1fr));
    gap: 10px;
}
.client-header-status-grid .summary-item { padding: 10px 12px; }
.client-header-status-grid .summary-item strong { font-size: 15px; line-height: 1.25; }
.client-return-files-card { margin-top: 0; }
.client-notes-card .client-notes-edit { min-height: 95px; }
.client-master-title-row-stacked { align-items: flex-start; }
.master-link-action-stack { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.linked-master-client { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px; }
.master-unlink-form { justify-self: end; }
.client-audit-card { padding: 12px 16px !important; margin-top: 18px; min-height: auto !important; }
.client-audit-card summary { line-height: 1.2; }
.client-audit-card details:not([open]) { min-height: 0; }
.client-audit-list { max-height: 380px; overflow: auto; }

.tax-return-detail-title-row { margin-bottom: 12px; }
.tax-return-detail-title-row h1 { font-size: 2rem; margin-bottom: 4px; }
.tax-return-detail-title-row p { font-size: 1.15rem; font-weight: 700; color: #334155; }
.return-summary-header h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.green-status-pill, .status-uploaded { background: #dcfce7 !important; color: #166534 !important; border: 1px solid #86efac !important; }
.details-grid label { font-weight: 900 !important; color: #10243a !important; }
section.card > .button-row { justify-content: flex-start !important; }
.return-pdf-action-row { justify-content: flex-start !important; }
.return-pdf-action-row .button.light,
.prepare-pdf-button.button.light { background: #0b5cab !important; color: #fff !important; border-color: #0b5cab !important; opacity: 1 !important; }
.reset-prep-button { background: #b91c1c !important; color: #fff !important; }

/* Upload page compacting */
body .page-header + .card.upload-step-card { margin-top: 8px; }
.upload-step-card { padding: 12px 16px !important; margin: 10px 0 !important; }
.upload-step-card h2 { font-size: 1.35rem !important; margin-bottom: 6px !important; }
.return-workitem-card { min-height: 58px !important; padding: 10px 12px !important; }
.upload-panel { margin-top: 10px !important; padding-top: 10px !important; }
.upload-panel .compact-form-grid { grid-template-columns: minmax(180px, 240px) minmax(360px, 1fr) auto !important; align-items: end !important; gap: 12px !important; }
.upload-panel .upload-return-submit { margin-top: 0 !important; align-self: end; min-width: 190px; }
.upload-panel .compact-form-grid label { margin: 0; }
.upload-panel .compact-form-grid input[type="file"] { min-height: 42px; padding: 8px; border: 1px solid #cfd9e6; border-radius: 8px; background: #fff; width: 100%; }

/* Spouse color alignment */
#addSpouseSignatureBox,
button.spouse-action {
    background: rgba(249,115,22,.14) !important;
    color: #7c2d12 !important;
    border: 2px solid #9a3412 !important;
    box-shadow: 0 6px 16px rgba(154,52,18,.15) !important;
}

@media (max-width: 1100px) {
    .compact-client-detail-header { grid-template-columns: 1fr; }
    .client-header-status-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
    .upload-panel .compact-form-grid { grid-template-columns: 1fr !important; }
}


/* v14.14 client detail message placement */
.compact-client-detail-header .client-header-message {
    grid-column: 1 / -1;
    margin: 6px 0 0 0;
    font-size: 1rem;
}
.compact-client-detail-header .client-header-message .warning-details {
    margin: 6px 0 0 0;
}
.client-history-card {
    margin-bottom: 18px;
}
.client-master-card {
    margin-top: 18px;
}


/* v14.15 upload form single-row layout */
.upload-panel .compact-form-grid {
    display: grid !important;
    grid-template-columns: minmax(150px, 220px) minmax(360px, 1fr) auto !important;
    align-items: end !important;
    gap: 12px !important;
}
.upload-panel .compact-form-grid label,
.upload-panel .compact-form-grid .upload-pdf-field {
    margin: 0 !important;
    grid-column: auto !important;
    min-width: 0 !important;
}
.upload-panel .compact-form-grid .wide {
    grid-column: auto !important;
}
.upload-panel .compact-form-grid select {
    width: 100% !important;
    min-height: 42px !important;
}
.upload-panel .compact-form-grid input[type="file"] {
    width: 100% !important;
    min-height: 42px !important;
    padding: 8px !important;
    border: 1px solid #cfd9e6 !important;
    border-radius: 8px !important;
    background: #fff !important;
}
.upload-panel .upload-return-submit {
    margin: 0 !important;
    align-self: end !important;
    min-height: 42px !important;
    min-width: 190px !important;
    width: auto !important;
    padding: 10px 18px !important;
    background: #0b5cab !important;
    color: #fff !important;
    font-size: 1rem !important;
    font-weight: 800 !important;
}
@media (max-width: 1100px) {
    .upload-panel .compact-form-grid {
        grid-template-columns: 1fr !important;
    }
    .upload-panel .upload-return-submit {
        width: 100% !important;
    }
}

/* v14.16: align empty return-files message and standardize upload button */
.client-return-files-card .client-section-title-row {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 16px !important;
}

.client-return-files-card .upload-return-button,
a.upload-return-button,
.secondary-button.upload-return-button {
    background: #063b70 !important;
    color: #fff !important;
    border: 1px solid #063b70 !important;
    border-radius: 10px !important;
    padding: 10px 16px !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .12) !important;
    white-space: nowrap !important;
}

.client-return-files-card .upload-return-button:hover,
a.upload-return-button:hover,
.secondary-button.upload-return-button:hover {
    background: #0b4f91 !important;
    border-color: #0b4f91 !important;
    text-decoration: none !important;
}

.client-return-files-card .client-document-text {
    margin-left: auto !important;
    margin-right: 0 !important;
    margin-top: 12px !important;
    width: min(520px, 100%) !important;
    max-width: 520px !important;
    text-align: left !important;
}

@media (max-width: 900px) {
    .client-return-files-card .client-section-title-row {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .client-return-files-card .client-document-text {
        margin-left: 0 !important;
        max-width: none !important;
        width: 100% !important;
    }
}

/* v14.17: upload form alignment - labels and controls on same line, upload button own row */
.upload-panel .compact-form-grid {
    display: grid !important;
    grid-template-columns: minmax(260px, 330px) minmax(520px, 1fr) !important;
    align-items: center !important;
    gap: 12px 18px !important;
}

.upload-panel .compact-form-grid label,
.upload-panel .compact-form-grid .upload-pdf-field,
.upload-panel .compact-form-grid .wide {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin: 0 !important;
    grid-column: auto !important;
    min-width: 0 !important;
    white-space: nowrap !important;
}

.upload-panel .compact-form-grid label > select {
    flex: 1 1 auto !important;
    min-width: 120px !important;
    width: auto !important;
}

.upload-panel .compact-form-grid label > input[type="file"] {
    flex: 1 1 auto !important;
    width: auto !important;
}

.upload-panel .compact-form-grid label > .text-danger {
    display: none !important;
}

.upload-panel .upload-return-submit {
    grid-column: 1 / -1 !important;
    justify-self: start !important;
    align-self: start !important;
    margin-top: 8px !important;
    width: auto !important;
    min-width: 230px !important;
    background: #0b4778 !important;
    color: #fff !important;
}

@media (max-width: 1100px) {
    .upload-panel .compact-form-grid {
        grid-template-columns: 1fr !important;
    }

    .upload-panel .compact-form-grid label,
    .upload-panel .compact-form-grid .upload-pdf-field,
    .upload-panel .compact-form-grid .wide {
        display: grid !important;
        grid-template-columns: 120px 1fr !important;
        white-space: normal !important;
    }

    .upload-panel .upload-return-submit {
        width: 100% !important;
        justify-self: stretch !important;
    }
}

/* v14.18: make empty return-files message compact under the upload button */
.client-return-files-card .client-document-text {
    width: fit-content !important;
    max-width: calc(100% - 24px) !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: 0 !important;
    padding: 10px 14px !important;
    display: block !important;
    white-space: normal !important;
}

.client-return-files-card .client-document-text:only-child,
.client-return-files-card .client-document-text.empty-return-files-message {
    width: fit-content !important;
}

@media (max-width: 900px) {
    .client-return-files-card .client-document-text {
        width: auto !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* v14.19: force upload labels/controls onto one horizontal line */
.upload-panel .compact-form-grid label,
.upload-panel .compact-form-grid .upload-pdf-field,
.upload-panel .compact-form-grid .wide {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    white-space: nowrap !important;
}

.upload-panel .compact-form-grid label select,
.upload-panel .compact-form-grid label input[type="file"] {
    margin-top: 0 !important;
}

.upload-panel .compact-form-grid label:first-child {
    max-width: 330px !important;
}

.upload-panel .compact-form-grid label.wide {
    width: 100% !important;
}

@media (max-width: 1100px) {
    .upload-panel .compact-form-grid label,
    .upload-panel .compact-form-grid .upload-pdf-field,
    .upload-panel .compact-form-grid .wide {
        display: grid !important;
        grid-template-columns: 120px 1fr !important;
        white-space: normal !important;
    }
}

/* v14.20: add breathing room between return-summary fields and action buttons */
.return-summary-header + .details-grid + .button-row,
section.card:has(.return-summary-header) > .button-row {
    margin-top: 18px !important;
    padding-top: 4px !important;
}

@supports not selector(:has(*)) {
    .details-grid + .button-row {
        margin-top: 18px !important;
        padding-top: 4px !important;
    }
}

/* Payment v15 */
.payment-setup-card { margin-top: 18px; }
.payment-setup-form { display:grid; grid-template-columns: minmax(160px,220px) minmax(280px,1fr) auto; gap:14px; align-items:end; }
.payment-setup-form label, .payment-manual-form label { display:flex; flex-direction:column; gap:6px; font-weight:800; color:#18324d; }
.payment-setup-form input, .payment-manual-form input { min-height:42px; border:1px solid #c9d7e8; border-radius:10px; padding:8px 12px; font:inherit; background:#fff; }
.payment-status-row { display:grid; grid-template-columns: repeat(4,minmax(150px,1fr)); gap:12px; margin-top:14px; }
.payment-status-row > div { border:1px solid #d9e5f2; border-radius:12px; padding:12px 14px; background:#f8fbff; }
.payment-status-row label { display:block; color:#60718a; font-weight:800; text-transform:uppercase; font-size:12px; letter-spacing:.04em; margin-bottom:5px; }
.payment-status-row strong { color:#0b1f36; overflow-wrap:anywhere; }
.payment-manual-details { margin-top:14px; border:1px dashed #c9d7e8; border-radius:12px; padding:12px 14px; background:#fbfdff; }
.payment-manual-details summary { cursor:pointer; font-weight:800; color:#063b70; }
.payment-manual-form { display:grid; grid-template-columns:minmax(160px,220px) minmax(260px,1fr) auto; gap:12px; align-items:end; margin-top:12px; }
.payment-card { width:100%; max-width:none; margin:0 auto; }
.payment-heading-row { display:flex; justify-content:space-between; align-items:flex-start; gap:18px; margin-bottom:18px; }
.payment-heading-row h2 { margin:0 0 6px 0; color:#063b70; }
.payment-summary-grid { display:grid; grid-template-columns:repeat(3,minmax(180px,1fr)); gap:14px; margin:18px 0; }
.payment-summary-grid > div { border:1px solid #d9e5f2; border-radius:14px; padding:16px; background:#f8fbff; }
.payment-summary-grid label { display:block; font-weight:800; color:#5f7088; text-transform:uppercase; font-size:12px; letter-spacing:.04em; }
.payment-summary-grid strong { display:block; font-size:26px; color:#0b1f36; margin:6px 0; }
.payment-summary-grid span { color:#64748b; }
.payment-action-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.payment-action-grid form { border:1px solid #d9e5f2; border-radius:14px; padding:16px; background:#ffffff; }
.secondary-card-payment { background:#f97316 !important; color:#fff !important; border-color:#ea580c !important; }
@media(max-width:900px){ .payment-setup-form,.payment-manual-form,.payment-summary-grid,.payment-action-grid,.payment-status-row{grid-template-columns:1fr;} }


/* v15.4 payment fee setup */
.payment-fee-form { display:flex; flex-direction:column; gap:14px; }
.payment-fee-grid { display:grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap:14px; align-items:end; }
.payment-fee-form label { display:flex; flex-direction:column; gap:6px; font-weight:800; color:#18324d; }
.payment-fee-form input { min-height:42px; border:1px solid #c9d7e8; border-radius:10px; padding:8px 12px; font:inherit; background:#fff; }
.payment-fee-form input[readonly] { background:#f1f6fb; color:#0b2a4a; font-weight:900; }
.payment-wide-field { width:100%; }
.payment-recipient-field small { color:#60748d; font-weight:500; line-height:1.35; }
.payment-form-section { display:grid; gap:10px; }
.payment-form-section-title {
    color:#18324d;
    font-size:1rem;
    font-weight:900;
    letter-spacing:.045em;
    text-transform:uppercase;
}
.payment-adjustment-grid {
    display:grid;
    grid-template-columns:minmax(160px, 220px) minmax(260px, 1fr);
    gap:14px;
    align-items:end;
}
.payment-request-grid {
    display:grid;
    grid-template-columns:minmax(280px, 1.35fr) minmax(260px, 1fr);
    gap:14px;
    align-items:start;
}
.payment-final-request-grid {
    display:grid;
    grid-template-columns:minmax(190px, 240px) minmax(320px, 1.35fr) minmax(280px, 1fr);
    gap:14px;
    align-items:start;
}
.payment-save-row {
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:16px;
    padding-top:12px;
    border-top:1px solid #d9e4f0;
}
.payment-save-row .payment-audit-note { margin-right:auto; }
.payment-save-row .button { min-width:140px; }
.prior-fee-history-details {
    border:1px solid #d6e3f0;
    border-radius:10px;
    background:#f8fbff;
    padding:8px 12px;
}
.prior-fee-history-details summary {
    cursor:pointer;
    color:#315879;
    font-weight:800;
}
.prior-fee-history-details .prior-fee-history-card {
    margin-top:9px;
    border:0;
    border-top:1px solid #dce7f2;
    border-radius:0;
    padding:10px 0 2px;
}
.payment-final-row { display:grid; grid-template-columns: minmax(150px, 220px) minmax(150px, 220px) minmax(280px, 1fr) auto; gap:14px; align-items:end; padding-top:6px; border-top:1px solid #d9e4f0; }
.payment-final-display { background:#f2f7fd; border:1px solid #d4e2f1; border-radius:12px; padding:10px 12px; }
.payment-final-display label { display:block; font-size:.78rem; text-transform:uppercase; color:#61738c; margin-bottom:4px; }
.payment-final-display strong { display:block; font-size:1.45rem; color:#052d55; }
.payment-final-display span { display:block; color:#64748b; font-size:.85rem; margin-top:3px; }
.payment-audit-note { margin:0; color:#60748d; font-size:.92rem; }
@media(max-width:1100px){
    .payment-fee-grid,.payment-final-row{ grid-template-columns:1fr 1fr; }
    .payment-adjustment-grid{ grid-template-columns:minmax(160px, 220px) 1fr; }
    .payment-final-request-grid{ grid-template-columns:minmax(190px, 240px) 1fr; }
    .payment-final-request-grid .payment-recipient-field{ grid-column:1 / -1; }
}
@media(max-width:700px){
    .payment-fee-grid,.payment-final-row,.payment-adjustment-grid,.payment-request-grid,.payment-final-request-grid{ grid-template-columns:1fr; }
    .payment-final-request-grid .payment-recipient-field{ grid-column:auto; }
    .payment-save-row{ align-items:stretch; flex-direction:column; }
    .payment-save-row .payment-audit-note{ margin-right:0; }
}


/* v15.5 payment dashboard and paid grid indicator */
.paid-status-grid-select.paid-bubble-select {
    background: #16a34a !important;
    color: #fff !important;
    border-color: #15803d !important;
    border-radius: 999px !important;
    font-weight: 900 !important;
    text-align: center !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
}

.payment-dashboard-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 14px;
}
.payment-dashboard-hero h2 { margin: 0 0 6px 0; color: #063b70; }
.payment-dashboard-hero p { margin: 0; color: #60718a; }
.payment-dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    gap: 10px;
    min-width: min(620px, 100%);
}
.payment-dashboard-metrics > div {
    background: #f7fbff;
    border: 1px solid #d7e5f4;
    border-radius: 12px;
    padding: 10px 12px;
}
.payment-dashboard-metrics label {
    display: block;
    color: #61738c;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.payment-dashboard-metrics strong { display: block; font-size: 24px; color: #052d55; margin-top: 3px; }
.payment-dashboard-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.payment-dashboard-filters a {
    text-decoration: none;
    color: #063b70;
    background: #eef5fb;
    border: 1px solid #d5e4f2;
    border-radius: 999px;
    padding: 8px 13px;
    font-weight: 900;
}
.payment-dashboard-filters a.active { background: #0b4778; border-color: #0b4778; color: #fff; }
.payments-dashboard-card { padding: 0; overflow: hidden; }
.payment-dashboard-table-wrap { overflow-x: auto; }
.payment-dashboard-table { width: 100%; border-collapse: collapse; min-width: 1180px; }
.payment-dashboard-table th {
    text-align: left;
    background: #f8fbff;
    color: #43546b;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 12px 14px;
    border-bottom: 1px solid #dce7f2;
}
.payment-dashboard-table td { padding: 13px 14px; border-bottom: 1px solid #e5edf5; vertical-align: top; }
.payment-dashboard-table td strong { display: block; color: #0b1f36; }
.payment-dashboard-table td span { display: block; color: #63748b; font-size: .92rem; margin-top: 2px; }
.payment-status-pill {
    display: inline-flex !important;
    width: fit-content;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: .82rem !important;
    font-weight: 900;
    margin: 0 0 5px 0 !important;
}
.payment-status-pill.paid { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.payment-status-pill.needs-payment { background: #fff7ed; color: #9a3412; border: 1px solid #fdba74; }
.payment-status-pill.processing { background: #e0f2fe; color: #075985; border: 1px solid #7dd3fc; }
.payment-status-pill.neutral { background: #eef2f7; color: #334155; border: 1px solid #cbd5e1; }
.return-status-line { font-size: .84rem !important; color: #66768a !important; }
.payment-reference-text { max-width: 220px; overflow-wrap: anywhere; }
.payment-dashboard-actions { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; min-width: 340px; }
.dashboard-mark-paid-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.dashboard-mark-paid-form input {
    height: 34px;
    border: 1px solid #c9d7e8;
    border-radius: 8px;
    padding: 5px 8px;
    font: inherit;
    max-width: 145px;
}
.paid-action-button { background: #16a34a !important; color: #fff !important; }
.empty-state.compact { padding: 18px; color: #64748b; }
@media (max-width: 1100px) {
    .payment-dashboard-hero { flex-direction: column; align-items: stretch; }
    .payment-dashboard-metrics { grid-template-columns: repeat(2, minmax(120px, 1fr)); min-width: 0; }
}

/* v15.7: make Paid in Tax Pipeline a compact green chip, not a large filled select */
.paid-status-grid-select.paid-bubble-select {
    width: 86px !important;
    min-width: 86px !important;
    max-width: 86px !important;
    height: 30px !important;
    line-height: 28px !important;
    background-color: #dcfce7 !important;
    color: #166534 !important;
    border: 1px solid #86efac !important;
    border-radius: 999px !important;
    font-weight: 800 !important;
    text-align: center !important;
    padding: 2px 22px 2px 12px !important;
    box-shadow: none !important;
}

.paid-status-grid-select.paid-bubble-select:hover,
.paid-status-grid-select.paid-bubble-select:focus {
    background-color: #bbf7d0 !important;
    color: #14532d !important;
    border-color: #22c55e !important;
    outline: none !important;
}

/* v15.8: center Paid chip in Tax Pipeline and make it stand out over row colors */
.paid-status-grid-select.paid-bubble-select {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 78px !important;
    min-width: 78px !important;
    max-width: 78px !important;
    height: 28px !important;
    line-height: 26px !important;
    background: #16a34a !important;
    color: #ffffff !important;
    border: 1px solid #15803d !important;
    border-radius: 999px !important;
    font-weight: 900 !important;
    text-align: center !important;
    text-align-last: center !important;
    padding: 1px 18px 1px 10px !important;
    box-shadow: 0 1px 0 rgba(255,255,255,.75), 0 0 0 2px rgba(255,255,255,.70) !important;
    position: relative !important;
    z-index: 1 !important;
}

.paid-status-grid-select.paid-bubble-select:hover,
.paid-status-grid-select.paid-bubble-select:focus {
    background: #15803d !important;
    color: #ffffff !important;
    border-color: #166534 !important;
    outline: none !important;
}

.data-grid td:has(.paid-status-grid-select.paid-bubble-select) {
    text-align: center !important;
}

/* v15.9: make Tax Pipeline Paid chip readable and centered in colored rows */
td:has(.paid-status-grid-select.paid-bubble-select) {
    text-align: center !important;
    vertical-align: middle !important;
}

.paid-status-grid-select.paid-bubble-select,
select.paid-status-grid-select.paid-bubble-select {
    display: inline-block !important;
    margin: 0 auto !important;
    width: 82px !important;
    min-width: 82px !important;
    max-width: 82px !important;
    height: 30px !important;
    min-height: 30px !important;
    line-height: 28px !important;
    padding: 1px 26px 1px 14px !important;
    border-radius: 999px !important;
    border: 1px solid #16a34a !important;
    background-color: #bbf7d0 !important;
    background-image:
        linear-gradient(#bbf7d0, #bbf7d0),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23166534' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat, no-repeat !important;
    background-position: 0 0, right 10px center !important;
    background-size: 100% 100%, 12px 8px !important;
    color: #065f46 !important;
    -webkit-text-fill-color: #065f46 !important;
    font-weight: 900 !important;
    text-align: center !important;
    text-align-last: center !important;
    opacity: 1 !important;
    box-shadow: 0 0 0 2px rgba(255,255,255,.95), 0 1px 3px rgba(15,23,42,.14) !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
}

.paid-status-grid-select.paid-bubble-select:hover,
.paid-status-grid-select.paid-bubble-select:focus,
select.paid-status-grid-select.paid-bubble-select:hover,
select.paid-status-grid-select.paid-bubble-select:focus {
    background-color: #86efac !important;
    background-image:
        linear-gradient(#86efac, #86efac),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23065f46' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    color: #064e3b !important;
    -webkit-text-fill-color: #064e3b !important;
    border-color: #15803d !important;
    outline: none !important;
}

/* v15.10: smaller, more professional Paid chip with centered text */
td:has(.paid-status-grid-select.paid-bubble-select) {
    text-align: center !important;
    vertical-align: middle !important;
}

.paid-status-grid-select.paid-bubble-select,
select.paid-status-grid-select.paid-bubble-select {
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    height: 28px !important;
    min-height: 28px !important;
    line-height: 26px !important;
    padding: 0 18px !important;
    border-radius: 999px !important;
    border: 1px solid #22c55e !important;
    background-color: #dcfce7 !important;
    background-image:
        linear-gradient(#dcfce7, #dcfce7),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23166534' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat, no-repeat !important;
    background-position: 0 0, right 8px center !important;
    background-size: 100% 100%, 10px 6px !important;
    color: #166534 !important;
    -webkit-text-fill-color: #166534 !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    text-align: center !important;
    text-align-last: center !important;
    box-shadow: 0 1px 2px rgba(15,23,42,.08) !important;
    opacity: 1 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
}

.paid-status-grid-select.paid-bubble-select:hover,
.paid-status-grid-select.paid-bubble-select:focus,
select.paid-status-grid-select.paid-bubble-select:hover,
select.paid-status-grid-select.paid-bubble-select:focus {
    background-color: #bbf7d0 !important;
    background-image:
        linear-gradient(#bbf7d0, #bbf7d0),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23166534' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    border-color: #16a34a !important;
    color: #14532d !important;
    -webkit-text-fill-color: #14532d !important;
    outline: none !important;
}


/* v15.11 Included payment status */
.paid-status-grid-select.included-bubble-select,
select.paid-status-grid-select.included-bubble-select {
    width: 92px !important;
    min-width: 92px !important;
    max-width: 92px !important;
    height: 34px !important;
    padding: 0 24px 0 14px !important;
    border-radius: 999px !important;
    border: 1px solid #4f8bd6 !important;
    background-color: #dbeafe !important;
    color: #0b4a86 !important;
    font-weight: 700 !important;
    text-align: center !important;
    text-align-last: center !important;
    box-shadow: none !important;
}

.paid-status-grid-select.included-bubble-select:hover,
.paid-status-grid-select.included-bubble-select:focus,
select.paid-status-grid-select.included-bubble-select:hover,
select.paid-status-grid-select.included-bubble-select:focus {
    background-color: #cfe4ff !important;
    color: #083f75 !important;
    border-color: #2f6fb5 !important;
}

td:has(.paid-status-grid-select.included-bubble-select) {
    text-align: center !important;
}

.included-status-pill,
.payment-status-pill.included {
    background: #dbeafe !important;
    color: #0b4a86 !important;
    border: 1px solid #4f8bd6 !important;
}

.included-action-button {
    background: #dbeafe !important;
    color: #0b4a86 !important;
    border-color: #4f8bd6 !important;
    font-weight: 700 !important;
}

.included-payment-details {
    margin-top: 12px;
}

/* v15.12: make Paid and Included chips same professional size and prevent text cutoff */
td:has(.paid-status-grid-select.paid-bubble-select),
td:has(.paid-status-grid-select.included-bubble-select) {
    text-align: center !important;
    vertical-align: middle !important;
}

.paid-status-grid-select.paid-bubble-select,
.paid-status-grid-select.included-bubble-select,
select.paid-status-grid-select.paid-bubble-select,
select.paid-status-grid-select.included-bubble-select {
    display: inline-block !important;
    width: 92px !important;
    min-width: 92px !important;
    max-width: 92px !important;
    height: 26px !important;
    min-height: 26px !important;
    line-height: 24px !important;
    padding: 0 18px 0 8px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    text-align: center !important;
    text-align-last: center !important;
    box-shadow: 0 1px 2px rgba(15,23,42,.08) !important;
    opacity: 1 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-repeat: no-repeat, no-repeat !important;
    background-position: 0 0, right 7px center !important;
    background-size: 100% 100%, 8px 5px !important;
}

.paid-status-grid-select.paid-bubble-select,
select.paid-status-grid-select.paid-bubble-select {
    border: 1px solid #22c55e !important;
    background-color: #dcfce7 !important;
    background-image:
        linear-gradient(#dcfce7, #dcfce7),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M1 1l3 3 3-3' fill='none' stroke='%23166534' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    color: #166534 !important;
    -webkit-text-fill-color: #166534 !important;
}

.paid-status-grid-select.included-bubble-select,
select.paid-status-grid-select.included-bubble-select {
    border: 1px solid #60a5fa !important;
    background-color: #dbeafe !important;
    background-image:
        linear-gradient(#dbeafe, #dbeafe),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M1 1l3 3 3-3' fill='none' stroke='%230b4a86' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    color: #0b4a86 !important;
    -webkit-text-fill-color: #0b4a86 !important;
}

.paid-status-grid-select.paid-bubble-select:hover,
.paid-status-grid-select.paid-bubble-select:focus,
select.paid-status-grid-select.paid-bubble-select:hover,
select.paid-status-grid-select.paid-bubble-select:focus {
    background-color: #bbf7d0 !important;
    background-image:
        linear-gradient(#bbf7d0, #bbf7d0),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M1 1l3 3 3-3' fill='none' stroke='%23166534' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    border-color: #16a34a !important;
    outline: none !important;
}

.paid-status-grid-select.included-bubble-select:hover,
.paid-status-grid-select.included-bubble-select:focus,
select.paid-status-grid-select.included-bubble-select:hover,
select.paid-status-grid-select.included-bubble-select:focus {
    background-color: #bfdbfe !important;
    background-image:
        linear-gradient(#bfdbfe, #bfdbfe),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M1 1l3 3 3-3' fill='none' stroke='%230b4a86' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    border-color: #3b82f6 !important;
    outline: none !important;
}

/* v15.24: public signing/payment branding alignment and clearer payment options */
.client-signing-topbar {
    justify-content: flex-start;
}

.client-signing-footer.client-contact-footer {
    justify-content: center;
    text-align: center;
}

.client-signing-footer a,
.payment-contact-line a {
    color: #0b5cab;
    font-weight: 700;
    text-decoration: none;
}

.client-signing-footer a:hover,
.payment-contact-line a:hover {
    text-decoration: underline;
}

.client-signing-body.brodie-public-body {
    min-height: 100vh;
    background:
        linear-gradient(90deg, rgba(255,255,255,0.80), rgba(255,255,255,0.90) 38%, rgba(255,255,255,0.97) 78%),
        url('/images/paisley1.jpg') left top / min(980px, 58vw) auto no-repeat fixed,
        #ffffff !important;
}

.client-signing-topbar.brodie-public-topbar {
    background: #073f73 !important;
    color: #fff !important;
    min-height: 78px !important;
    padding: 16px 34px !important;
    border-bottom: 0 !important;
    box-shadow: 0 6px 18px rgba(4,40,78,.18) !important;
}

.brodie-public-brand { gap: 14px !important; }

.client-signing-logo.brodie-public-logo {
    width: 54px !important;
    height: 54px !important;
    border-radius: 13px !important;
    background: #fff !important;
    padding: 5px !important;
    display: grid !important;
    place-items: center !important;
    overflow: hidden !important;
    box-shadow: 0 3px 12px rgba(0,0,0,.16) !important;
}

.brodie-public-logo-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
}

.client-signing-brand-title.brodie-public-brand-title {
    color: #fff !important;
    font-family: Georgia, 'Times New Roman', serif !important;
    font-size: 28px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    letter-spacing: -.02em !important;
}

.client-signing-brand-subtitle.brodie-public-brand-subtitle {
    color: rgba(255,255,255,.78) !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    margin-top: 4px !important;
}

.client-signing-shell.brodie-public-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 28px auto 36px !important;
}

.client-signing-shell.brodie-public-shell .page-header,
.client-signing-shell.brodie-public-shell .card {
    background: rgba(255,255,255,0.96) !important;
    border: 1px solid #dbe5ee !important;
}

.client-signing-footer.brodie-public-footer {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 28px;
    color: #64748b;
}

.client-finish-sign-card {
    scroll-margin-top: 22px;
}

.payment-card {
    padding: 22px;
}

.payment-choice-intro {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin: 18px 0;
    padding: 13px 16px;
    border: 1px solid #cfe0f1;
    border-radius: 13px;
    background: #f7fbff;
    color: #42556d;
}

.payment-choice-intro strong {
    color: #063b70;
    font-size: 1.05rem;
}

.payment-option-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
}

.payment-option-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid #d9e5f2;
    border-radius: 18px;
    padding: 20px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15,35,65,.06);
}

.payment-option-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.payment-option-ach {
    border: 2px solid #78aed9;
    background: linear-gradient(180deg, #ffffff 0%, #f1f8fe 100%);
}

.payment-option-cardfee {
    border: 2px solid #d7b086;
    background: linear-gradient(180deg, #fffdfb 0%, #fff7ef 100%);
}

.payment-option-eyebrow {
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #64748b;
}

.payment-choice-badge {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.payment-choice-badge.ach {
    background: #dff3e6;
    color: #176332;
}

.payment-choice-badge.card {
    background: #fff0dc;
    color: #8a4513;
}

.payment-option-card h3 {
    margin: 0;
    color: #063b70;
    font-size: 1.45rem;
}

.payment-option-description {
    min-height: 44px;
    margin: 0;
    color: #52657a;
    line-height: 1.4;
}

.payment-total-panel {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid rgba(98,128,158,.24);
    border-radius: 13px;
    background: rgba(255,255,255,.78);
}

.payment-total-panel span {
    color: #60718a;
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.payment-total-panel strong {
    color: #0b1f36;
    font-size: 2.15rem;
    line-height: 1.05;
}

.payment-option-subtotal {
    font-weight: 700;
    color: #475569;
}

.payment-choice-or {
    display: grid;
    place-items: center;
    position: relative;
    color: #60718a;
}

.payment-choice-or::before {
    content: "";
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: 50%;
    width: 1px;
    background: #d8e1ea;
}

.payment-choice-or span {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid #cdd9e5;
    border-radius: 50%;
    background: #fff;
    color: #37516b;
    font-size: .82rem;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(15,35,65,.08);
}

.payment-option-points {
    margin: 4px 0 6px 18px;
    padding: 0;
    color: #475569;
    display: grid;
    gap: 6px;
}

.payment-option-card .button {
    margin-top: auto;
    min-height: 46px;
    font-weight: 800;
}

.payment-choice-button {
    width: 100%;
    text-align: center;
}

.secondary-card-payment {
    background: #f97316 !important;
    color: #fff !important;
    border-color: #ea580c !important;
}

.payment-choice-help {
    margin: 14px 0 0;
    color: #66778b;
    text-align: center;
    font-size: .9rem;
}

.payment-success-card {
    display: grid;
    gap: 12px;
}

.payment-success-card h2 {
    margin: 0;
    color: #063b70;
}

.payment-reference-panel {
    display: inline-grid;
    gap: 4px;
    width: fit-content;
    border: 1px solid #d9e5f2;
    border-radius: 12px;
    background: #f8fbff;
    padding: 12px 14px;
}

.payment-reference-panel label {
    color: #60718a;
    font-size: .8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.payment-reference-panel strong {
    color: #0b1f36;
    overflow-wrap: anywhere;
}

.payment-contact-line {
    margin: 0;
    color: #60718a;
}

@media (max-width: 900px) {
    .payment-option-grid {
        grid-template-columns: 1fr;
    }

    .payment-choice-or {
        min-height: 48px;
    }

    .payment-choice-or::before {
        top: 50%;
        right: 14px;
        bottom: auto;
        left: 14px;
        width: auto;
        height: 1px;
    }

    .payment-option-description {
        min-height: 0;
    }
}

@media (max-width: 700px) {
    .client-signing-topbar.brodie-public-topbar {
        min-height: 72px !important;
        padding: 14px 18px !important;
    }

    .client-signing-brand-title.brodie-public-brand-title {
        font-size: 22px !important;
    }

    .client-signing-shell.brodie-public-shell,
    .client-signing-footer.brodie-public-footer {
        width: min(100% - 24px, 1180px);
    }

    .client-signing-body.brodie-public-body {
        background:
            linear-gradient(90deg, rgba(255,255,255,0.82), rgba(255,255,255,0.92) 42%, rgba(255,255,255,0.98) 78%),
            url('/images/paisley1.jpg') left top / min(720px, 86vw) auto no-repeat,
            #ffffff !important;
    }
}


/* v15.26: public signing start step, lighter paisley, and receipt actions */
.client-signing-body.brodie-public-body {
    background:
        linear-gradient(90deg, rgba(255,255,255,0.92), rgba(255,255,255,0.96) 38%, rgba(255,255,255,0.99) 78%),
        url('/images/paisley1.jpg') left top / min(980px, 58vw) auto no-repeat fixed,
        #ffffff !important;
}

.start-signing-row {
    margin-top: 16px;
    justify-content: flex-start;
}

.start-signing-row .button {
    min-width: 180px;
    font-weight: 800;
}

#signatureReviewStep {
    scroll-margin-top: 22px;
}

.payment-success-actions {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
}

.payment-success-actions .button {
    text-decoration: none;
}

@media (max-width: 700px) {
    .client-signing-body.brodie-public-body {
        background:
            linear-gradient(90deg, rgba(255,255,255,0.93), rgba(255,255,255,0.97) 42%, rgba(255,255,255,0.99) 78%),
            url('/images/paisley1.jpg') left top / min(720px, 86vw) auto no-repeat,
            #ffffff !important;
    }
}

/* Clients / CRM v1 integration */
.client-connections-grid { display: grid; gap: 18px; }
.crm-entry-form textarea { resize: vertical; }
.crm-timeline-list { display: grid; gap: 10px; }
.crm-timeline-entry { border: 1px solid #d9e1ea; border-radius: 10px; padding: 12px 14px; background: #fff; }
.crm-entry-header { display: flex; justify-content: space-between; gap: 16px; color: #073e73; }
.crm-entry-meta { margin-top: 8px; color: #687483; font-size: .88rem; }
.crm-dashboard-page .data-grid td { vertical-align: top; }

/* Pay later remains intentionally secondary to Pay Now */
.pay-later-wrap { text-align: center; margin-top: 18px; }
.pay-later-link { border: 0; background: transparent; color: #66717e; text-decoration: underline; font-size: .92rem; cursor: pointer; }
.pay-later-link:hover { color: #073e73; }
.payment-email-link-form { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 6px; align-items: center; }
.payment-email-link-form input { min-width: 220px; }
.copy-payment-link-button { white-space: nowrap; }

/* Tax Pipeline client-link spacing */
#taxPipelineGrid .sort-column-header,
#taxPipelineGrid .sort-column-cell {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
}

#taxPipelineGrid .sort-code-input {
    width: 62px;
    min-width: 62px;
    max-width: 62px;
    padding-left: 7px;
    padding-right: 7px;
}

#taxPipelineGrid .client-links-header,
#taxPipelineGrid .detail-action-cell {
    width: 86px !important;
    min-width: 86px !important;
    max-width: 86px !important;
    padding-left: 5px !important;
    padding-right: 5px !important;
}

#taxPipelineGrid .detail-action-links {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    white-space: nowrap;
}

#taxPipelineGrid .detail-icon-link {
    width: auto;
    min-width: 24px;
    height: 24px;
    padding: 0 4px;
    flex: 0 0 auto;
}

#taxPipelineGrid .crm-row-link {
    min-width: 38px;
    font-size: 12px;
}

/* CRM integrated v2 */
.crm-intro-row,.crm-toolbar,.crm-item-topline,.crm-item-actions,.crm-form-actions,.crm-entry-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.crm-intro-row{justify-content:space-between;margin-bottom:18px}.crm-intro-row h2{margin:0;color:#073d70;font-size:1.65rem}.crm-intro-row p{margin:4px 0 0;color:#5e6c7b}.crm-metric-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:18px}.crm-metric-card{display:flex;justify-content:space-between;align-items:center;padding:18px 20px;background:#fff;border:1px solid #dce5ee;border-radius:16px;box-shadow:0 8px 18px rgba(10,55,95,.07);text-decoration:none;color:#34495e}.crm-metric-card strong{font-size:1.8rem;color:#073d70}.crm-metric-card.overdue strong{color:#a12622}.crm-toolbar{justify-content:space-between;margin-bottom:14px}.crm-search-box{display:flex;gap:8px;align-items:center}.crm-search-box input{min-width:310px;padding:10px 12px;border:1px solid #cad6e2;border-radius:10px}.crm-list-card{padding:0;overflow:hidden}.crm-dashboard-list{display:flex;flex-direction:column}.crm-dashboard-item{display:flex;justify-content:space-between;gap:18px;padding:18px 20px;border-bottom:1px solid #e5ebf1}.crm-dashboard-item:last-child{border-bottom:0}.crm-dashboard-item.is-overdue{border-left:5px solid #b42318;background:#fff8f7}.crm-dashboard-main{min-width:0;flex:1}.crm-client-name{font-weight:800;color:#073d70;text-decoration:none}.crm-note-text{margin-top:6px;white-space:pre-wrap}.crm-entry-meta{color:#667788;font-size:.88rem;margin-top:8px}.crm-item-actions{align-content:flex-start;justify-content:flex-end}.crm-item-actions a,.link-button{color:#0b5796;font-weight:700;text-decoration:none}.link-button{background:none;border:0;padding:0;cursor:pointer;font:inherit}.crm-status-pill{display:inline-flex;padding:3px 9px;border-radius:999px;font-size:.78rem;font-weight:800;background:#eef3f7;color:#435466}.crm-status-pill.open{background:#fff0ca;color:#725000}.crm-status-pill.done{background:#dff4e6;color:#176332}.crm-status-pill.canceled{background:#eceff2;color:#5c6570}.crm-create-card{max-width:980px;margin:0 auto}.crm-task-fields{padding:14px;background:#f5f8fb;border:1px solid #dbe5ee;border-radius:12px}.crm-form-actions{margin-top:20px}.inline-form{display:inline}.crm-entry-actions{margin-top:8px}.crm-note-row-link{white-space:nowrap;font-size:.72rem;padding-left:2px}#taxPipelineGrid .detail-action-cell{min-width:132px;width:132px}#taxPipelineGrid .detail-action-links{gap:5px;flex-wrap:nowrap}
@media(max-width:1000px){.crm-metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.crm-dashboard-item{flex-direction:column}.crm-item-actions{justify-content:flex-start}}@media(max-width:650px){.crm-metric-grid{grid-template-columns:1fr}.crm-search-box input{min-width:0;width:100%}}


/* CRM notes icon and polished entry form */
#taxPipelineGrid .detail-action-cell {
    width: 86px !important;
    min-width: 86px !important;
    max-width: 86px !important;
}

.pipeline-notes-cell {
    min-width: 250px;
}

.pipeline-notes-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.pipeline-notes-wrap .cell-edit {
    flex: 1 1 auto;
    min-width: 0;
}

.pipeline-crm-note-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 18px;
    min-width: 18px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #2563eb;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
}

.pipeline-crm-note-icon:hover {
    background: #dbeafe;
    color: #1d4ed8;
    text-decoration: none;
}

.crm-create-card {
    max-width: 900px;
    padding: 24px 28px 28px;
}

.crm-create-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 18px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e1e8ef;
}

.crm-create-heading .module-title {
    font-size: 1.55rem;
}

.crm-form-grid {
    display: grid;
    grid-template-columns: minmax(180px, .8fr) 140px minmax(300px, 2fr);
    gap: 16px;
}

.crm-field {
    display: grid;
    gap: 6px;
}

.crm-field label {
    color: #27384a;
    font-size: .9rem;
    font-weight: 800;
}

.crm-field input,
.crm-field select,
.crm-field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #c7d3df;
    border-radius: 9px;
    background: #fff;
    padding: 10px 11px;
    color: #182635;
    font: inherit;
}

.crm-field input:focus,
.crm-field select:focus,
.crm-field textarea:focus {
    outline: 2px solid rgba(12, 82, 143, .16);
    border-color: #0b5796;
}

.crm-field-full {
    grid-column: 1 / -1;
}

.crm-field textarea {
    min-height: 145px;
    resize: vertical;
}

.crm-task-panel {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid #d5e1ec;
    border-radius: 12px;
    background: #f6f9fc;
}

.crm-task-panel[hidden] {
    display: none !important;
}

.crm-task-panel-title {
    margin-bottom: 12px;
    color: #073d70;
    font-weight: 900;
}

.crm-task-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.crm-link-details {
    margin-top: 18px;
    color: #536476;
}

.crm-link-details summary {
    cursor: pointer;
    font-weight: 700;
}

.crm-link-field {
    margin-top: 12px;
}

.crm-validation,
.crm-field span.field-validation-error {
    color: #a12622;
    font-weight: 700;
}

@media (max-width: 850px) {
    .crm-form-grid {
        grid-template-columns: 1fr 1fr;
    }
    .crm-field-subject,
    .crm-field-full {
        grid-column: 1 / -1;
    }
    .crm-task-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .crm-create-card {
        padding: 18px;
    }
    .crm-form-grid,
    .crm-task-grid {
        grid-template-columns: 1fr;
    }
    .crm-field-subject,
    .crm-field-full {
        grid-column: auto;
    }
}


/* CRM v2: compact column layout for dashboard and client timeline. */
.crm-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #dbe4ed;
    border-radius: 12px;
    background: rgba(255,255,255,.98);
}
.crm-record-table {
    width: 100%;
    min-width: 1180px;
    border-collapse: collapse;
    table-layout: auto;
}
.crm-record-table th {
    padding: 10px 11px;
    text-align: left;
    background: #f4f7fa;
    color: #1f2937;
    border-bottom: 2px solid #aeb9c5;
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .025em;
    white-space: nowrap;
}
.crm-record-table td {
    padding: 10px 11px;
    border-bottom: 1px solid #e6ebf0;
    vertical-align: top;
    font-size: .9rem;
}
.crm-record-table tbody tr:last-child td { border-bottom: 0; }
.crm-record-table tbody tr:hover td { background: #f5f8fb; }
.crm-record-table .crm-client-column { min-width: 150px; font-weight: 700; }
.crm-record-table .crm-description-column { min-width: 290px; white-space: pre-wrap; }
.crm-record-table .crm-description-column strong { display: block; color: #063b70; margin-bottom: 3px; }
.crm-record-table .crm-actions-column { min-width: 112px; white-space: nowrap; }
.crm-record-table .crm-actions-column a,
.crm-record-table .crm-actions-column .link-button { display: block; margin-bottom: 4px; }
.crm-record-table .crm-actions-column > :last-child { margin-bottom: 0; }
.crm-record-table .crm-overdue-row td { background: #fff7f5; }
.crm-record-table .crm-overdue-row td:first-child { border-left: 4px solid #b42318; }
.crm-linked-returns-table { min-width: 820px; }
.crm-client-timeline-table { min-width: 1260px; }
.crm-dashboard-table { min-width: 1260px; }
#crm-subtab-pane .module-card { margin-bottom: 18px; }
#crm-subtab-pane .module-card:last-child { margin-bottom: 0; }

/* CRM v3: one compact row per entry with inline actions. */
.crm-record-table td {
    padding: 7px 10px;
    vertical-align: middle;
    line-height: 1.25;
}
.crm-record-table .crm-description-column {
    min-width: 320px;
    max-width: 520px;
    white-space: normal;
}
.crm-description-line {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}
.crm-record-table .crm-description-column .crm-description-line strong {
    display: inline;
    flex: 0 0 auto;
    margin: 0;
    color: #063b70;
    white-space: nowrap;
}
.crm-description-separator {
    flex: 0 0 auto;
    color: #64748b;
}
.crm-note-inline {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.crm-record-table .crm-actions-column {
    min-width: 165px;
    white-space: nowrap;
}
.crm-record-table .crm-actions-column a,
.crm-record-table .crm-actions-column .link-button,
.crm-record-table .crm-actions-column form {
    display: inline-block;
    margin: 0 10px 0 0;
    vertical-align: baseline;
}
.crm-record-table .crm-actions-column > :last-child {
    margin-right: 0;
}

/* Historical fee import and ClientFees payment history */
.historical-fee-upload-card { max-width: 980px; }
.historical-fee-upload-form { display:grid; grid-template-columns:minmax(280px,1fr) minmax(180px,240px) auto; gap:16px; align-items:end; margin-top:20px; }
.historical-fee-upload-form label { display:flex; flex-direction:column; gap:7px; color:#18324d; font-weight:800; }
.historical-fee-upload-form input { min-height:42px; border:1px solid #c9d7e8; border-radius:10px; padding:8px 11px; background:#fff; font:inherit; }
.historical-fee-upload-form small { color:#64748b; font-weight:500; }
.historical-fee-help { margin-top:18px; }
.historical-fee-validation { color:#b91c1c; font-weight:700; margin-top:12px; }
.historical-fee-metrics { margin-bottom:14px; }
.historical-fee-toolbar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:14px; }
.historical-fee-toolbar input[type="search"] { width:min(430px,100%); min-height:40px; border:1px solid #cbd8e8; border-radius:10px; padding:8px 12px; background:#fff; }
.historical-fee-preview-card { padding:0; overflow:auto; }
.historical-fee-table { width:100%; min-width:1450px; border-collapse:collapse; }
.historical-fee-table th { background:#f7faff; color:#42556e; font-size:12px; text-transform:uppercase; letter-spacing:.04em; text-align:left; padding:11px 12px; border-bottom:1px solid #dce7f2; }
.historical-fee-table td { padding:10px 12px; border-bottom:1px solid #e7eef6; vertical-align:top; font-size:14px; }
.historical-fee-table td span { display:block; color:#65758a; font-size:12px; margin-top:3px; }
.historical-fee-table tr.fee-row-ready { background:#f7fff9; }
.historical-fee-table tr.fee-row-review { background:#fffdf2; }
.historical-fee-table tr.fee-row-unmatched { background:#fff8f1; }
.historical-fee-table tr.fee-row-conflict { background:#f5f6f8; }
.historical-fee-use { width:18px; height:18px; }
.fee-year-input { width:84px; min-height:36px; border:1px solid #cbd8e8; border-radius:8px; padding:5px 7px; background:#fff; }
.fee-client-select { width:310px; max-width:100%; min-height:38px; border:1px solid #cbd8e8; border-radius:8px; padding:5px 7px; background:#fff; }
.fee-description-preview { max-width:450px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:#27364a; }
.fee-amount { white-space:nowrap; font-weight:900; color:#0b365f; }
.historical-fee-result-messages { margin-top:18px; border:1px solid #dce6f1; border-radius:12px; overflow:hidden; }
.historical-fee-result-messages > div { padding:9px 12px; border-bottom:1px solid #e7eef6; background:#fbfdff; }
.historical-fee-result-messages > div:last-child { border-bottom:0; }
.payment-fee-form input.fee-absolute-display[readonly] { background:#fff !important; color:#0b2a4a; font-weight:900; opacity:1; }
.payment-fee-form input.fee-absolute-input { background:#fff; color:#0b2a4a; font-weight:900; }
.fee-history-source { color:#15803d; font-weight:800; font-size:.78rem; }
.prior-fee-history-card { border:1px solid #d6e3f0; border-radius:12px; background:#fff; padding:12px 14px; }
.prior-fee-history-heading { display:flex; justify-content:space-between; gap:16px; color:#153a5c; margin-bottom:7px; }
.prior-fee-history-heading span { color:#64748b; font-size:.9rem; }
.prior-fee-description { color:#334155; white-space:pre-line; line-height:1.45; }
.prior-fee-warning { border-left:4px solid #f59e0b; background:#fff8e8; color:#92400e; padding:9px 12px; border-radius:8px; }
@media(max-width:1000px){ .historical-fee-upload-form{grid-template-columns:1fr;} }

/* ClientFees history and prior-fee diagnostics. */
.client-fee-history-card { max-width: none; }
.client-fee-history-table { min-width: 1120px; }
.client-fee-history-table td { vertical-align: top; }
.client-fee-history-table .fee-history-amount { white-space: nowrap; font-weight: 700; color: #063b70; }
.client-fee-history-table .fee-history-description { max-width: 430px; white-space: pre-line; line-height: 1.35; }
.prior-fee-notice { margin: 12px 0; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 9px; background: #ffffff; color: #475569; }

/* Keep the four payment fee fields aligned when prior-fee source text is shown. */
.payment-fee-grid-primary {
    align-items: start;
}

.payment-fee-grid-primary > label {
    align-self: start;
}

.payment-fee-grid-primary .fee-history-source {
    display: block;
    min-height: 1rem;
    margin-top: 2px;
    line-height: 1.2;
}


/* v25 payment setup layout refinement */
.payment-included-choice-row {
    display:flex;
    align-items:center;
    gap:14px;
    flex-wrap:wrap;
    margin:8px 0 14px;
}
.payment-included-toggle {
    display:inline-flex;
    align-items:stretch;
    flex:0 0 auto;
    border:1px solid #c9d7e8;
    border-radius:10px;
    overflow:hidden;
    background:#fff;
}
.payment-included-toggle-option {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:108px;
    min-height:36px;
    margin:0;
    padding:7px 13px;
    border:0;
    border-right:1px solid #c9d7e8;
    border-radius:0;
    background:#fff;
    color:#38536f;
    font:inherit;
    font-size:.9rem;
    font-weight:800;
    line-height:1.1;
    cursor:pointer;
}
.payment-included-toggle-option:last-child { border-right:0; }
.payment-included-toggle-option:hover { background:#f1f6fb; color:#0b4a86; }
.payment-included-toggle-option.is-active {
    cursor:default;
    box-shadow:none;
}
.payment-included-toggle-option.is-active.not-included-pill {
    background:#e9eef5;
    color:#334155;
    border-color:#c9d7e8;
}
.payment-included-toggle-option.is-active.included-status-pill {
    background:#dbeafe !important;
    color:#0b4a86 !important;
    border:0 !important;
}
.payment-choice-label {
    display:flex;
    align-items:baseline;
    gap:6px;
    flex-wrap:wrap;
    min-width:260px;
    color:#334155;
}
.payment-choice-label strong { color:#18324d; }
.payment-choice-label span { color:#60748d; }
.payment-final-fee-section { margin-top:16px; padding-top:16px; border-top:1px solid #d7dde5; }
.payment-final-display {
    min-height:70px;
    display:flex;
    flex-direction:column;
    justify-content:center;
}
@media(max-width:700px){
    .payment-included-choice-row { align-items:flex-start; }
    .payment-choice-label { min-width:0; }
    .payment-included-toggle { width:100%; }
    .payment-included-toggle-option { flex:1 1 50%; }
}

/* Payment and signer layout refinement: inline Save Fee and aligned taxpayer validation fields */
.payment-final-request-grid {
    grid-template-columns: minmax(190px, 240px) minmax(300px, 1.35fr) minmax(260px, 1fr) auto;
    align-items: start;
}
.payment-final-request-grid .payment-recipient-field {
    grid-column: auto;
}
.payment-save-inline {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding-top: 28px;
}
.payment-save-inline .button {
    min-width: 140px;
    min-height: 42px;
    white-space: nowrap;
}
.payment-save-row {
    margin-top: 14px;
}
.payment-save-row .button {
    display: block;
    width: 100%;
    min-height: 44px;
    text-align: center;
}
.payment-audit-note-below {
    margin-top: 8px;
}
.taxpayer-validation-field-grid {
    display: grid;
    grid-template-columns: minmax(0, 680px);
    gap: 12px;
    align-items: start;
}
.taxpayer-validation-field-grid label {
    display: grid;
    grid-template-columns: 105px minmax(260px, 520px);
    align-items: center;
    column-gap: 14px;
    width: 100%;
    font-weight: 800;
    color: #18324d;
}
.taxpayer-validation-field-grid input {
    width: 100%;
    min-height: 42px;
    box-sizing: border-box;
}
@media (max-width: 950px) {
    .payment-final-request-grid {
        grid-template-columns: minmax(190px, 240px) 1fr;
    }
    .payment-final-request-grid .payment-recipient-field {
        grid-column: 1;
    }
    .payment-save-inline {
        grid-column: 2;
        padding-top: 28px;
    }
}
@media (max-width: 700px) {
    .payment-final-request-grid {
        grid-template-columns: 1fr;
    }
    .payment-final-request-grid .payment-recipient-field,
    .payment-save-inline {
        grid-column: auto;
    }
    .payment-save-inline {
        justify-content: stretch;
        padding-top: 0;
    }
    .payment-save-inline .button {
        width: 100%;
    }
    .taxpayer-validation-field-grid {
        grid-template-columns: 1fr;
        max-width: none;
    }
    .taxpayer-validation-field-grid label {
        grid-template-columns: 92px minmax(0, 1fr);
        column-gap: 10px;
    }
}


/* Fee calculation table layout */
.payment-fee-table {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
}
.payment-fee-half {
    display: grid;
    grid-template-columns: minmax(245px, 0.62fr) minmax(0, 1.38fr);
    gap: 14px;
    min-width: 0;
    align-items: stretch;
    align-content: start;
}
.payment-fee-override-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(245px, 0.62fr) minmax(0, 1.38fr);
    gap: 14px;
    align-items: start;
}
.payment-fee-field-row-override {
    align-self: start;
}
.payment-fee-override-reason-wrap {
    min-width: 0;
}
.payment-fee-override-reason-wrap input {
    width: 100%;
    box-sizing: border-box;
}
.payment-fee-field-stack {
    display: grid;
    grid-template-rows: repeat(2, auto);
    gap: 12px;
    min-width: 0;
    align-self: start;
    align-content: start;
}
.payment-fee-field-row {
    display: grid;
    grid-template-columns: 145px minmax(92px, 122px);
    gap: 12px;
    align-items: center;
    min-width: 0;
}
.payment-fee-half-quoted .payment-fee-field-row {
    grid-template-columns: 150px minmax(165px, 185px);
}
.payment-fee-field-row:first-child {
    align-self: start;
}
.payment-fee-field-row:last-child {
    align-self: end;
}
.payment-fee-field-row > label {
    display: block;
    margin: 0;
    font-weight: 800;
    color: #18324d;
}
.payment-fee-table-control {
    min-width: 0;
}
.payment-fee-table-control input {
    width: 100%;
    box-sizing: border-box;
}
.payment-fee-table-control .fee-history-source {
    display: block;
    margin-top: 5px;
}
.payment-fee-table-message-column {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: auto;
}
.payment-fee-half-quoted {
    grid-template-columns: minmax(335px, 0.72fr) minmax(0, 1.28fr);
    grid-template-rows: auto auto;
    align-self: start;
    align-content: start;
}
.payment-fee-half-quoted .payment-fee-field-stack {
    grid-column: 1;
    grid-row: 1;
}
.payment-fee-half-quoted .payment-fee-table-message-column {
    grid-column: 2;
    grid-row: 1;
    align-self: stretch;
    min-height: 0;
}
.payment-fee-half-quoted .payment-quote-source-meta {
    grid-column: 1 / -1;
    grid-row: 2;
}
.payment-fee-table-message,
.payment-fee-table-helper-note {
    flex: 1 1 auto;
    margin: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #ffffff;
    color: #475569;
    line-height: 1.35;
    box-sizing: border-box;
}
.payment-fee-table-helper-note {
    color: #60718a;
}
@media (max-width: 1250px) {
    .payment-fee-table {
        gap: 18px;
    }
    .payment-fee-half,
    .payment-fee-override-row {
        grid-template-columns: minmax(235px, 0.58fr) minmax(0, 1.42fr);
    }
    .payment-fee-field-row {
        grid-template-columns: 135px minmax(90px, 118px);
        gap: 10px;
    }
    .payment-fee-half-quoted {
        grid-template-columns: minmax(310px, 0.7fr) minmax(0, 1.3fr);
    }
    .payment-fee-half-quoted .payment-fee-field-row {
        grid-template-columns: 140px minmax(155px, 175px);
    }
}
@media (max-width: 1000px) {
    .payment-fee-table {
        grid-template-columns: 1fr;
    }
    .payment-fee-half,
    .payment-fee-override-row {
        grid-template-columns: minmax(245px, 0.62fr) minmax(0, 1.38fr);
    }
    .payment-fee-half-quoted {
        grid-template-columns: minmax(325px, 0.72fr) minmax(0, 1.28fr);
    }
}
@media (max-width: 650px) {
    .payment-fee-half,
    .payment-fee-override-row {
        grid-template-columns: 1fr;
    }
    .payment-fee-field-stack {
        grid-template-rows: auto;
    }
    .payment-fee-field-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .payment-fee-field-row:first-child,
    .payment-fee-field-row:last-child {
        align-self: auto;
    }
}

/* CRM quote integration */
.crm-quote-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
}
.payment-quote-source-note {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
}
.payment-quote-description-field {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    color: #18324d;
}
.payment-quote-description-field textarea {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 96px;
    resize: vertical;
    box-sizing: border-box;
    border: 1px solid #c9d7e8;
    border-radius: 9px;
    padding: 10px 12px;
    font: inherit;
    font-weight: 400;
    line-height: 1.35;
    background: #fff;
    color: #0b1f36;
}
.payment-quote-source-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 0;
    min-width: 0;
    color: #60718a;
    font-size: .82rem;
    line-height: 1.3;
}
.payment-quote-source-meta span {
    flex: 1 1 auto;
    min-width: 0;
}
.payment-remove-quote-button {
    flex: 0 0 auto;
    padding: 0;
    white-space: nowrap;
    color: #9f1239;
    font-weight: 800;
    text-decoration: underline;
}
.payment-remove-quote-button:hover {
    color: #7f1d1d;
}
@media (max-width: 700px) {
    .crm-quote-grid {
        grid-template-columns: 1fr;
    }
    .payment-quote-description-field textarea {
        height: auto;
        min-height: 78px;
    }
    .payment-fee-half-quoted {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    .payment-fee-half-quoted .payment-fee-field-stack,
    .payment-fee-half-quoted .payment-fee-table-message-column,
    .payment-fee-half-quoted .payment-quote-source-meta {
        grid-column: 1;
        grid-row: auto;
    }
    .payment-quote-source-meta {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Quote history recovery: archived quote revisions remain visible in client CRM timeline. */
.crm-client-timeline-table .crm-archived-row { opacity:.82; background:#f8fafc; }
.crm-client-timeline-table .crm-status-pill.archived { background:#e2e8f0; color:#475569; }

/* v14.14 signing workflow layout and controls */
.placement-page-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.placement-scroll-hint {
    color: #4b5563;
    font-size: .9rem;
}
.placement-zoom-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border: 1px solid #d6e7fb;
    border-radius: 10px;
    background: #fff;
}
.placement-zoom-controls .small {
    min-width: 34px;
    min-height: 34px;
    font-size: 1.05rem;
    line-height: 1;
    padding: 6px 10px;
}
.placement-zoom-label {
    min-width: 54px;
    text-align: center;
    font-weight: 800;
    color: #18324d;
}
.placement-preview-shell {
    overflow: auto;
}
.placement-preview {
    margin: 0 auto;
}
.signer-validation-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(320px, 1fr));
    gap: 16px;
    align-items: start;
}
.signer-validation-grid .signer-identity-card {
    height: 100%;
    margin: 0;
}
.workflow-section-button-row {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}
.workflow-section-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 300px;
    max-width: 100%;
    min-height: 54px;
    padding: 14px 30px;
    border-radius: 12px;
    font-size: 1.08rem;
    font-weight: 800;
    text-align: center;
    background: #0b5cab !important;
    border-color: #0b5cab !important;
    color: #fff !important;
    white-space: nowrap;
}
.return-pdf-action-row {
    justify-content: center !important;
}
.return-pdf-action-row .prepare-pdf-button.workflow-section-button {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 320px;
}
.return-pdf-action-row .button:not(.workflow-section-button) {
    min-width: 220px;
}
.payment-save-row {
    display: flex;
    justify-content: center;
}
.payment-save-row .workflow-section-button {
    width: auto !important;
}
@media (max-width: 1050px) {
    .signer-validation-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 700px) {
    .placement-toolbar-group {
        width: 100%;
        justify-content: flex-start;
    }
    .placement-scroll-hint {
        width: 100%;
    }
    .workflow-section-button {
        width: 100%;
        min-width: 0;
        white-space: normal;
    }
}

/* v14.15 signing workflow refinements: true continuous PDF scrolling, exact button sizing, pipeline Included sync */
.placement-preview {
    display: grid;
    gap: 18px;
    min-height: 0;
    background: transparent !important;
    box-shadow: none !important;
    touch-action: auto !important;
}
.placement-page {
    position: relative;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
}
.placement-page-canvas {
    display: block;
}
.placement-box-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
}
.placement-page-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
    border-radius: 999px;
    padding: 4px 9px;
    background: rgba(15, 23, 42, .72);
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
    pointer-events: none;
}
.workflow-section-button,
.return-pdf-action-row .prepare-pdf-button.workflow-section-button,
.payment-save-row .workflow-section-button,
.signer-send-panel .workflow-section-button {
    flex: 0 0 auto !important;
    width: 380px !important;
    min-width: 380px !important;
    max-width: 380px !important;
    min-height: 56px !important;
    padding: 14px 24px !important;
    font-size: 1.08rem !important;
    line-height: 1.2 !important;
}
.payment-save-row .button.workflow-section-button {
    display: inline-flex !important;
}
.workflow-section-button-row,
.payment-save-row.workflow-section-button-row,
.return-pdf-action-row {
    justify-content: center !important;
}
@media (max-width: 700px) {
    .workflow-section-button,
    .return-pdf-action-row .prepare-pdf-button.workflow-section-button,
    .payment-save-row .workflow-section-button,
    .signer-send-panel .workflow-section-button {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
}
.placement-preview-shell {
    height: min(78vh, 860px) !important;
    min-height: 520px !important;
    max-height: 78vh !important;
    overflow: auto !important;
}


/* v14.16 signing placement polish: taller viewer, balanced side panel, no visual gap */
.placement-layout {
    align-items: start !important;
}
.placement-preview-shell {
    height: min(86vh, 980px) !important;
    min-height: 680px !important;
    max-height: min(86vh, 980px) !important;
    overflow: auto !important;
}
.placement-side-panel {
    max-height: min(86vh, 980px) !important;
    overflow: auto !important;
}
.placement-preview {
    gap: 12px !important;
    padding-bottom: 12px;
}
@media (max-width: 900px) {
    .placement-preview-shell {
        height: min(82vh, 820px) !important;
        min-height: 560px !important;
        max-height: min(82vh, 820px) !important;
    }
    .placement-side-panel {
        max-height: none !important;
        overflow: visible !important;
    }
}

/* v14.17 signing scroll ownership tweak: faster PDF-vs-page scrolling handoff */
.placement-preview-shell {
    overscroll-behavior: contain !important;
    scroll-behavior: auto !important;
}
.placement-preview-shell:hover {
    cursor: default;
}


/* v14.18 signing scroll smoothness tweak: keep native scrolling crisp */
.placement-preview-shell {
    overscroll-behavior-y: contain !important;
    overscroll-behavior-x: contain !important;
    scroll-behavior: auto !important;
}
.placement-page,
.placement-page-canvas {
    transform: none !important;
    backface-visibility: visible !important;
    will-change: auto !important;
    image-rendering: auto !important;
}

/* v15.31: reliable Tax Pipeline Paid/Included visual state while async saves complete */
tr.row-saving {
    position: relative;
}
tr.row-saving .detail-action-links a,
tr.row-saving .pipeline-crm-note-icon {
    opacity: .45 !important;
    pointer-events: none !important;
}
.paid-status-grid-select.saving {
    cursor: progress !important;
}
.paid-status-grid-select.paid-bubble-select,
.paid-status-grid-select.included-bubble-select,
select.paid-status-grid-select.paid-bubble-select,
select.paid-status-grid-select.included-bubble-select,
.paid-status-grid-select.paid-bubble-select.saving,
.paid-status-grid-select.included-bubble-select.saving,
select.paid-status-grid-select.paid-bubble-select.saving,
select.paid-status-grid-select.included-bubble-select.saving {
    display: inline-block !important;
    width: 92px !important;
    min-width: 92px !important;
    max-width: 92px !important;
    height: 26px !important;
    min-height: 26px !important;
    line-height: 24px !important;
    padding: 0 18px 0 8px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    text-align: center !important;
    text-align-last: center !important;
    box-shadow: 0 1px 2px rgba(15,23,42,.08) !important;
    opacity: 1 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-repeat: no-repeat, no-repeat !important;
    background-position: 0 0, right 7px center !important;
    background-size: 100% 100%, 8px 5px !important;
}
.paid-status-grid-select.paid-bubble-select,
select.paid-status-grid-select.paid-bubble-select,
.paid-status-grid-select.paid-bubble-select.saving,
select.paid-status-grid-select.paid-bubble-select.saving {
    border: 1px solid #22c55e !important;
    background-color: #dcfce7 !important;
    background-image:
        linear-gradient(#dcfce7, #dcfce7),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M1 1l3 3 3-3' fill='none' stroke='%23166534' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    color: #166534 !important;
    -webkit-text-fill-color: #166534 !important;
}
.paid-status-grid-select.included-bubble-select,
select.paid-status-grid-select.included-bubble-select,
.paid-status-grid-select.included-bubble-select.saving,
select.paid-status-grid-select.included-bubble-select.saving {
    border: 1px solid #60a5fa !important;
    background-color: #dbeafe !important;
    background-image:
        linear-gradient(#dbeafe, #dbeafe),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M1 1l3 3 3-3' fill='none' stroke='%230b4a86' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    color: #0b4a86 !important;
    -webkit-text-fill-color: #0b4a86 !important;
}
.paid-status-grid-select.not-included-bubble-select,
select.paid-status-grid-select.not-included-bubble-select {
    border-color: #d6d3d1 !important;
    background-color: #f5f5f4 !important;
    color: #57534e !important;
    -webkit-text-fill-color: #57534e !important;
}

/* v15.32: client signing page uses continuous PDF scrolling like preparer workflow */
.client-sign-preview-shell {
    height: min(82vh, 980px) !important;
    min-height: 620px !important;
    max-height: min(82vh, 980px) !important;
    overflow: auto !important;
    overscroll-behavior-y: contain !important;
    overscroll-behavior-x: contain !important;
    scroll-behavior: auto !important;
}
.client-sign-preview {
    display: grid !important;
    gap: 12px !important;
    padding-bottom: 12px;
    min-height: 0;
    background: transparent !important;
    box-shadow: none !important;
}
.client-sign-page {
    margin: 0 auto;
}
@media (max-width: 900px) {
    .client-sign-preview-shell {
        height: min(78vh, 860px) !important;
        min-height: 520px !important;
        max-height: min(78vh, 860px) !important;
    }
}

/* v15.33: paper signing / in-office check payment packet */
.paper-invoice-panel {
    border: 1px solid #d6e7fb;
    background: #f8fbff;
    border-radius: 16px;
    padding: 18px;
    display: grid;
    gap: 10px;
}
.paper-invoice-panel h3 {
    margin: 0;
    color: #10243a;
}
.paper-invoice-panel p {
    margin: 0;
}
.paper-invoice-form {
    margin-top: 6px;
}


/* v16: allow multi-line payment work descriptions */
.payment-work-description-field textarea {
    width: 100%;
    min-height: 86px;
    resize: vertical;
    line-height: 1.35;
    font-weight: 800;
    box-sizing: border-box;
}
.payment-final-request-grid .payment-work-description-field {
    min-width: 0;
}

/* Client-level Included migration controls */
.pipeline-paid-cell-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}
.pipeline-paid-cell-wrap .paid-status-grid-select {
    flex: 1 1 auto;
    min-width: 104px;
}
.normalize-payment-selection-button {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border: 1px solid #94a3b8;
    border-radius: 50%;
    background: #ffffff;
    color: #0b4a86;
    font-weight: 800;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}
.normalize-payment-selection-button:hover {
    background: #e7f0fa;
    border-color: #0b4a86;
}
.normalize-payment-selection-button:disabled {
    opacity: .55;
    cursor: wait;
}

/* Client-level Included migration helper. */
.normalize-payment-selection-button { min-width: 42px !important; width: auto !important; padding: 5px 8px !important; font-size: 11px !important; font-weight: 800 !important; }

/* v24: identity verification submit button and SharePoint return-folder recovery */
.identity-verification-card .identity-verify-submit-row {
    margin-top: 20px;
}
.identity-verification-card .identity-verify-submit {
    min-height: 50px;
    padding: 13px 22px;
    font-size: 1.08rem;
    font-weight: 800;
    border-radius: 11px;
}
.sharepoint-folder-recovery-note code {
    display: inline-block;
    margin: 0 4px;
    padding: 2px 6px;
    border-radius: 6px;
    background: #eef4fb;
    color: #073f73;
}
.return-file-row.return-file-signed {
    border-color: #86c99a;
    background: #f2fbf5;
}


/* Data Tools platform access matrix */
.access-matrix-card{grid-column:1 / -1}
.compact-access-card{padding:14px 16px}
.access-header-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px}
.access-table-wrap{overflow:auto;margin:10px 0 12px 0;border:1px solid #d6e1ef;border-radius:12px;background:#fff}
.access-table{width:100%;border-collapse:collapse;min-width:780px}
.access-table th{background:#073e6d;color:#fff;text-align:center;padding:9px 8px;border-bottom:1px solid #073e6d;font-weight:900}
.access-table th:first-child{text-align:left}
.access-table td{padding:7px 8px;border-bottom:1px solid #e6edf5;vertical-align:middle}
.access-table tbody tr:last-child td{border-bottom:0}
.compact-access-table{font-size:.95rem;min-width:920px}
.compact-access-table .feature-column{width:280px;min-width:240px}
.compact-access-table .staff-column{min-width:118px;width:138px}
.compact-access-table .feature-name-cell{line-height:1.15;color:#14233a}
.access-section-row td{
    padding:6px 10px!important;
    background:#eef3f8!important;
    color:#063b70!important;
    border-top:1px solid #d6e1ef!important;
    border-bottom:1px solid #d6e1ef!important;
    border-left:0!important;
    border-right:0!important;
    font-size:.78rem;
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:.08em;
}
.access-feature-row:hover{background:#f8fbff}
.access-check-cell{text-align:center}
.access-check-cell input[type="checkbox"]{width:18px;height:18px;accent-color:#063b70;cursor:pointer}
.access-check-cell input[type="checkbox"]:disabled{cursor:not-allowed;opacity:.65}
.staff-header-cell{display:flex;align-items:center;justify-content:center;gap:6px;line-height:1.15;white-space:nowrap}
.staff-remove-button{width:18px!important;height:18px!important;min-height:18px!important;padding:0!important;border-radius:999px!important;background:#c21f18!important;color:#fff!important;display:inline-grid!important;place-items:center!important;font-size:14px!important;line-height:1!important;font-weight:900!important;border:0!important;box-shadow:none!important;margin:0!important}
.staff-remove-button:hover{background:#9f1713!important}
.access-add-form{display:grid;grid-template-columns:120px minmax(160px,240px) minmax(220px,300px) auto;gap:8px;align-items:end;margin:10px 0 8px;padding:10px;border:1px solid #d6e1ef;border-radius:12px;background:#f8fbff}
.access-add-title{font-weight:900;color:#063b70;align-self:center}
.access-add-form label{display:flex;flex-direction:column;gap:4px;font-size:.82rem;font-weight:800;color:#334155}
.access-add-form input{height:32px;border:1px solid #cbd7e6;border-radius:8px;padding:5px 8px;font:inherit;background:#fff}
.access-add-button{height:32px;padding:6px 10px!important;align-self:end}
.muted-text{color:#607089;font-size:.86rem}
@media(max-width:900px){.access-add-form{grid-template-columns:1fr}.access-add-button{width:100%}.compact-access-table{min-width:760px}.compact-access-table .staff-column{min-width:100px}}
