:root{--ink:#172d36;--muted:#6c7b82;--line:#dce4e5;--bg:#f3f5f3;--teal:#18665e;--soft:#e7f1ed;--red:#a33f38;--amber:#936222;--white:#fff;--shadow:0 8px 36px #21343e12;font-family:Inter,-apple-system,BlinkMacSystemFont,'PingFang SC','Microsoft YaHei',sans-serif;font-size:12.6px;color:var(--ink);background:var(--bg)}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button,.button{cursor:pointer;border:1px solid #cdd9d9;background:white;color:var(--ink);border-radius:7px;padding:8px 13px;line-height:1.2;text-decoration:none;display:inline-block}button:not(:disabled):hover,.button:hover{background:#f1f5f3;border-color:#9bb3ad}button:disabled{opacity:.5;cursor:not-allowed}button.primary{background:var(--teal);border-color:var(--teal);color:#fff}button.primary:not(:disabled):hover{background:#124e49}.danger{color:var(--red)!important}.quiet{background:transparent;border-color:transparent;color:var(--muted)}input,select,textarea{padding:9px 10px;border:1px solid #cdd8da;border-radius:6px;color:var(--ink);background:#fff;max-width:100%}input:focus,select:focus,textarea:focus{outline:2px solid #70a89b;outline-offset:1px}textarea{resize:vertical;width:100%}label{display:block;font-size:11.7px;color:#52656c}h1,h2,h3,h4,p{margin:0}h1{font-size:22.5px;letter-spacing:-.5px}h2{font-size:14.4px}h3{font-size:13.5px}h4{font-size:12.6px}.muted,small{color:var(--muted)}small{font-size:9.9px}.row{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.spread{justify-content:space-between}.stack{display:grid;gap:16px}.top{height:76px;background:var(--white);border-bottom:1px solid var(--line);display:flex;align-items:center;padding:0 24px;gap:22px}.brand{display:flex;gap:11px;align-items:center;min-width:224px}.brand strong{font-size:16.2px}.brand small{display:block;margin-top:3px;letter-spacing:2px}.brandmark{width:37px;height:37px;border-radius:11px;background:var(--teal);color:#fff;display:grid;place-items:center;font-size:18.9px}.environment{font-size:10.8px;color:var(--teal);background:var(--soft);padding:7px 11px;border-radius:20px}.topright{margin-left:auto;display:flex;align-items:center;gap:8px;font-size:10.8px}.layout{--left-width:256px;--right-width:304px;position:relative;display:grid;grid-template-columns:var(--left-width) minmax(500px,1fr) var(--right-width);height:calc(100vh - 76px)}.layout.left-off{grid-template-columns:0 minmax(500px,1fr) var(--right-width)}.layout.right-off{grid-template-columns:var(--left-width) minmax(500px,1fr) 0}.layout.left-off.right-off{grid-template-columns:0 minmax(500px,1fr) 0}aside{background:#fbfcfb;min-width:0;display:flex;flex-direction:column;overflow:hidden}#left{border-right:1px solid var(--line)}#right{border-left:1px solid var(--line)}.paneltitle{height:64px;min-height:64px;padding:0 18px;display:flex;align-items:center;justify-content:space-between}.paneltitle button{border:0;font-size:18px;background:none;min-height:24px;width:24px;padding:0}.scroll{overflow:auto;scroll-behavior:smooth}#main{padding:28px 28px 80px;scroll-behavior:auto}#todos{padding:0 14px 28px}.daylabel{font-size:10.8px;color:var(--muted);margin-bottom:15px}.todo-group{margin-top:23px}.todo-group h3{font-size:10.8px;letter-spacing:1px;margin:0 5px 10px}.todo-group.overdue h3{color:var(--red)}.todo{background:white;border:1px solid var(--line);border-radius:8px;margin:8px 0;padding:11px}.todo .locate{display:block;width:100%;border:0;padding:0;text-align:left;background:transparent}.todo strong{font-size:11.7px}.todo p{font-size:10.8px;line-height:1.55;margin:5px 0;color:#53666e}.todo small{display:block;line-height:1.5}.todo-footer{display:flex;justify-content:space-between;align-items:center;margin-top:6px}.todo-footer button{color:var(--teal)}.pagehead{margin-bottom:22px;display:flex;align-items:flex-start;justify-content:space-between;gap:14px}.eyebrow{font-size:9.9px;letter-spacing:2px;color:var(--teal);margin-bottom:7px}.subtitle{font-size:10.8px;color:var(--muted);margin-top:8px;line-height:1.6}.filters{background:#fff;border:1px solid var(--line);padding:17px;border-radius:10px;margin-bottom:20px;display:flex;gap:12px;flex-wrap:wrap;align-items:end}.filters label{font-size:9.9px;display:grid;gap:6px}.filters .search{flex:1;min-width:210px}.filters input,.filters select{font-size:10.8px;padding:8px;width:100%}.filters label.date{width:140px}.list-summary{font-size:10.8px;color:var(--muted);margin-bottom:11px}.customer-row{background:#fff;border:1px solid var(--line);border-radius:10px;padding:20px;margin-bottom:12px;box-shadow:0 3px 12px #182c3503}.customer-row .name{font-size:16.2px;color:var(--teal);border:0;padding:0;font-weight:650;background:none}.customer-row .contact{font-size:10.8px;margin-top:7px;color:var(--muted)}.customer-row .metrics{display:flex;gap:26px;font-size:10.8px;margin:15px 0}.customer-row .metrics span{color:var(--muted);display:block;font-size:9px;margin-bottom:5px}.case-chip{font-size:10.8px;padding:6px 9px;background:#f4f7f6;border-radius:5px}.pill{display:inline-block;background:var(--soft);color:var(--teal);padding:4px 7px;border-radius:5px;font-size:9.9px}.pill.warn{background:#faf0dc;color:var(--amber)}.pill.gray{background:#eef0f0;color:#697780}.detail-nav{position:sticky;top:-28px;z-index:3;background:var(--bg);padding:12px 0;border-bottom:1px solid var(--line);display:flex;gap:7px;margin-bottom:20px}.detail-nav button{font-size:10.8px;padding:7px 10px}.section{margin:28px 0;scroll-margin-top:65px}.section-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}.section-title h2{font-size:17.1px}.section-number{font-size:10.8px;color:var(--teal);margin-right:8px}.card{padding:18px;background:white;border:1px solid var(--line);border-radius:9px;margin:12px 0;scroll-margin-top:65px}.cardhead{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}.values{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px 20px;margin:0}.values>div{min-width:0}.values dt{font-size:9.9px;color:var(--muted);line-height:1.5;margin-bottom:4px}.values dd{font-size:11.7px;margin:0;word-break:break-word;line-height:1.6}.empty-value{color:#95a0a4}.source{margin-top:15px;font-size:9.9px;color:var(--muted)}.source pre{white-space:pre-wrap;word-break:break-word;line-height:1.6;max-height:200px;overflow:auto}.materials{margin-top:17px;border-top:1px solid #edf0ef;padding-top:12px}.material-line{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:8px 0;font-size:9.9px}.material-entry{min-width:88px;color:var(--muted)}.material-file{color:var(--teal);max-width:200px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.subhead{font-size:12.6px;margin:23px 0 8px;display:flex;align-items:center;justify-content:space-between}.hint{font-size:10.8px;background:#edf3f3;color:#5b7078;padding:12px 14px;line-height:1.7;border-radius:6px;margin:14px 0}.empty{color:var(--muted);padding:22px 0;text-align:center;font-size:11.7px}.case-process{display:flex;gap:12px;font-size:9.9px;margin:15px 0}.case-process span{color:#9ba5a9}.case-process .current{color:var(--teal);font-weight:bold}.plan{margin-top:15px;border:1px solid #d6e2dc;border-radius:7px;padding:15px;background:#fbfdfb}.plan header{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:9px}.actions{width:100%;border-collapse:collapse;font-size:10.8px;margin:10px 0}.actions th{text-align:left;font-weight:500;color:var(--muted);font-size:9.9px;padding:9px 5px;border-bottom:1px solid var(--line)}.actions td{padding:11px 5px;border-bottom:1px solid #e8eeee;vertical-align:top}.actions tr{scroll-margin-top:80px}.log{font-size:10.8px;border-left:2px solid #c9d9d2;padding:1px 12px;margin:13px 0;line-height:1.7}.log small{display:block;margin-top:4px}.history{margin-top:16px}dialog{width:min(860px,94vw);max-height:90vh;border:1px solid var(--line);border-radius:13px;padding:0;box-shadow:0 20px 80px #172d363d;color:var(--ink)}dialog::backdrop{background:#23343a66;backdrop-filter:blur(2px)}.dialoghead{position:sticky;top:0;background:white;z-index:2;padding:19px 23px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center}.dialoghead>button{border:0;font-size:18px;min-height:24px;width:24px;padding:0}#dialog-body{padding:24px}#dialog-body form{display:grid;gap:20px}.form-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px 15px}.field{min-width:0}.field>label{margin-bottom:7px;line-height:1.5}.field input,.field select{width:100%}.field .state{font-size:9px;color:var(--muted);border:0;padding:4px 0;margin-top:3px;background:transparent;width:auto;max-width:100%}.dialog-actions{display:flex;justify-content:flex-end;gap:6px;border-top:1px solid var(--line);padding-top:18px}.form-error{font-size:10.8px;color:var(--red);white-space:pre-wrap;line-height:1.6}.plan-editor-row{border:1px solid var(--line);background:#f8faf9;padding:14px;border-radius:8px;display:grid;gap:12px}.plan-editor-row .action-fields{display:grid;grid-template-columns:120px 1fr 1fr;gap:12px}.plan-editor-row label{display:grid;gap:6px;font-size:9.9px}.checklist{display:grid;gap:10px}.checklist label{display:flex;gap:9px;align-items:center}.checklist input{width:auto}#toast{position:fixed;z-index:100;top:14px;left:50%;transform:translateX(-50%);max-width:650px;border-radius:8px;padding:12px 20px;background:var(--ink);color:white;box-shadow:var(--shadow);display:none;font-size:11.7px}#toast.error{background:var(--red)}#preview{width:min(1000px,95vw)}#preview-body{height:72vh;display:grid;place-items:center;background:#e8edec}#preview-body iframe{border:0;width:100%;height:100%}#preview-body img{max-width:100%;max-height:100%;object-fit:contain}.chatnote{margin:0 17px;padding:10px;background:var(--soft);color:var(--teal);font-size:9.9px;border-radius:7px;line-height:1.7}.connection{font-size:9.9px;color:var(--muted);margin:12px 18px;line-height:1.7}.connection.online{color:var(--teal)}#chat-messages{overflow:auto;flex:1;padding:5px 17px}.bubble{font-size:11.7px;line-height:1.8;white-space:pre-wrap;word-break:break-word;background:#f0f3f1;border:1px solid #e2e9e6;padding:12px;border-radius:8px;margin:12px 0}.bubble.user{background:#e1ede7;border:0}.bubble small{display:block;font-size:9px;margin-bottom:5px}#chat-form{padding:17px;border-top:1px solid var(--line)}#chat-form textarea{font-size:11.7px}#chat-form>.row{margin-top:8px}.panel-toggles{position:fixed;bottom:15px;left:17px;right:17px;pointer-events:none;display:flex;justify-content:space-between}.panel-toggles button{pointer-events:auto;box-shadow:var(--shadow)}.flash{animation:flash 3s ease-out}@keyframes flash{0%,40%{outline:3px solid #c3a357;background:#fff5dc}100%{outline:0 solid transparent}}#login{min-height:100vh;display:grid;place-items:center;background:radial-gradient(ellipse at 20% 20%,#d8e8df,transparent 60%),var(--bg)}#login:empty{display:none}.loginbox{background:#fff;width:400px;padding:36px;border:1px solid var(--line);border-radius:15px;box-shadow:var(--shadow)}.loginbox h1{font-size:21.6px;margin:24px 0 8px}.loginbox form{display:grid;gap:18px;margin-top:26px}.loginbox label{display:grid;gap:7px}.loginbox .hint{margin-bottom:0;font-size:9.9px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}[hidden]{display:none!important}@media(max-width:1250px){.layout{--left-width:225px;--right-width:260px}#main{padding:24px 18px 70px}.environment{display:none}.values{grid-template-columns:repeat(2,minmax(0,1fr))}.top{padding:0 18px}}@media(max-width:950px){.layout{grid-template-columns:0 minmax(420px,1fr) 0}.layout #left,.layout #right{display:none}.layout.left-off,.layout.right-off,.layout.left-off.right-off{grid-template-columns:0 minmax(420px,1fr) 0}.form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

#preview-body.pdf-pages{display:flex;flex-direction:column;overflow:auto;padding:12px 20px;gap:15px}#preview-body.pdf-pages img{flex:none;max-width:100%;max-height:none;height:auto;object-fit:contain;box-shadow:var(--shadow)}.pdf-controls{position:sticky;top:0;background:white;padding:8px 12px;border-radius:6px;width:100%;font-size:10.8px}
.detail-nav{top:0;flex-wrap:wrap}.detail-nav .selected{background:var(--teal);color:white;border-color:var(--teal)}
.important-word,.todo .important-word{font-size:16.2px;font-weight:750;color:#b52b24;line-height:1.55}.actions .important-word{font-size:15.3px}.step-controls{min-width:130px}.step-controls button{display:block;margin-bottom:7px;}.step-controls small{display:block;margin-top:5px;max-width:180px;word-break:break-word}.step-controls [aria-pressed=true]{background:var(--soft);color:var(--teal)}
.flow-footer{background:#fff;border:2px solid var(--teal);border-radius:10px;padding:22px;margin-top:30px;scroll-margin-top:80px}.flow-item{border-top:1px solid var(--line);margin-top:18px;padding-top:18px;display:flex;flex-wrap:wrap;justify-content:space-between;gap:14px}.flow-item>.subtitle{width:100%}.liability-history{margin:25px 0}.submission-content{font-size:10.8px}.submission-content h4{margin:18px 0 12px}.submission-content dl{padding:12px;border:1px solid var(--line);margin-bottom:10px}
#preview-body .pdf-controls{z-index:2;flex:none;box-shadow:0 2px 8px #21343e22}.pdf-page{margin:0;width:100%;flex:none;text-align:center}.pdf-page img{width:100%;display:block;background:white}.pdf-page figcaption{font-size:10.8px;color:var(--muted);margin-bottom:8px}

.panel-resizer{position:absolute;top:0;bottom:0;width:10px;z-index:6;cursor:col-resize;touch-action:none;outline:none}
#left-resizer{left:calc(var(--left-width) - 5px)}#right-resizer{right:calc(var(--right-width) - 5px)}
.panel-resizer::before{content:"";position:absolute;left:4px;top:0;bottom:0;width:2px;background:transparent;transition:background .12s}
.panel-resizer::after{content:"";position:absolute;left:3px;top:calc(50% - 21px);height:42px;width:4px;border-radius:4px;background:#b4c9c2}
.panel-resizer:hover::before,.panel-resizer:focus-visible::before,.panel-resizer.dragging::before{background:var(--teal)}
.panel-resizer:hover::after,.panel-resizer:focus-visible::after,.panel-resizer.dragging::after{background:var(--teal)}
.layout.left-off #left-resizer,.layout.right-off #right-resizer{display:none}
#left{grid-column:1;position:relative}#main{grid-column:2}#right{grid-column:3;position:relative}
#left,#main,#right{grid-row:1;min-width:0}
.layout.left-off #left,.layout.right-off #right{display:none}
#right-open{margin-left:auto}
#chat-form textarea{height:62px;min-height:62px;max-height:62px;line-height:20px;resize:none;overflow-y:auto}
body.resizing-panels,body.resizing-panels *{cursor:col-resize!important;user-select:none!important}
@media(max-width:950px){.panel-resizer{display:none}}

#query-preview{padding:0 12px;max-height:42vh;overflow:auto}#query-preview ul{padding-left:18px;font-size:10.8px}#query-preview h3{font-size:12.6px}.screen-table{overflow:auto;max-width:100%}.screen-table table{border-collapse:collapse;font-size:10.8px}.screen-table th,.screen-table td{min-width:130px;padding:10px;border-bottom:1px solid #dce4e1;vertical-align:top}.screen-table th{background:#edf3f0;position:sticky;top:0}.screen-table small{display:block;color:#61736c}.screen-pages{margin-top:16px}.query-description{font-size:10.8px;line-height:1.7}.screen-table button{margin:3px}

.query-description summary{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.query-description[open] summary{white-space:normal}

/* Compact isolated experience; keep the existing three-column layout. */
.top{height:54px;padding:0 18px;gap:16px}.brand{gap:8px}.brandmark{width:32px;height:32px;font-size:17.1px;border-radius:9px}.brand strong{font-size:14.4px}.brand small{margin-top:1px;font-size:9px}.environment{padding:4px 9px}
.layout{height:calc(100dvh - 54px);min-height:0}#left,#main,#right{min-height:0}#main{padding:16px 18px 24px}.paneltitle{height:42px;min-height:42px;padding:0 14px}
#right .assistant-title{height:38px;min-height:38px;gap:6px;justify-content:flex-start;padding:0 12px;border-bottom:1px solid var(--line)}.assistant-title h2{font-size:11.7px;white-space:nowrap}.assistant-title .connection{margin:0;min-width:0;flex:1;font-size:9.9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.assistant-title button{font-size:18px;flex:none}
#chat-messages{min-height:0;flex:1 1 0;padding:0 12px}.bubble{padding:9px 10px;margin:8px 0;line-height:1.65}.bubble small{margin-bottom:3px}#chat-form{padding:10px 12px;flex:none}#chat-form>.row{margin-top:5px}
.screen-heading{margin-bottom:4px;align-items:center;min-height:32px}.screen-heading h1{font-size:18px}.screen-meta{display:flex;align-items:baseline;gap:12px;margin-bottom:5px;min-height:24px}.screen-meta .query-description{flex:1;min-width:0}.screen-meta .list-summary{margin:0;white-space:nowrap;flex:none;font-size:9.9px}

/* Keep all handling steps in the existing customer detail column. */
.business-case .case-state{display:flex;align-items:center;justify-content:space-between;gap:10px;background:var(--soft);color:var(--teal);padding:10px 12px;border-radius:6px;margin:8px 0 12px}.business-case .case-actions{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;padding-top:14px;margin-top:16px;border-top:1px solid var(--line)}.business-case .plan header{flex-wrap:wrap}.action-table-wrap{overflow-x:auto}.actions td{overflow-wrap:anywhere}.action-unable .step-content{color:var(--red);text-decoration:line-through}.action-cancelled .step-content{color:var(--muted);text-decoration:line-through}.action-done .important-word{color:var(--teal)}.plan-edit-area .inline-plan-form{display:grid;gap:14px}.editing-plan>.action-table-wrap,.editing-plan>details,.editing-plan>header>button{display:none}.inline-plan-form>label{display:grid;gap:7px}.inline-plan-form .dialog-actions{position:sticky;bottom:0;background:#fbfdfb;padding:12px 0;z-index:2}.postloan{margin-top:16px;padding:14px;border:1px solid var(--line);border-radius:7px;background:#fff}.postloan>button{margin-top:12px}.formal-debt-summary{padding:10px 12px;background:#f5f8f6;border-radius:6px}.formal-debt-summary h4{margin:12px 0 6px}.formal-debt-summary p{font-size:10.8px;line-height:1.8}.no-change-check{display:flex;align-items:center;gap:8px}.no-change-check input{width:auto}#postloan-records h4{margin-top:10px}#postloan-fields:not(:empty){padding:14px;background:#f5f8f6;border-radius:7px;display:grid;gap:14px}.case-actions .row:empty{display:none}

/* Bounded existing lists and compact business forms. */
.todo-group>summary{font-weight:650;font-size:11.7px;cursor:pointer;padding:12px 0}.todo-rows{max-height:38vh;overflow:auto}.todo-pages{display:flex;align-items:center;gap:5px;padding:8px 0}.todo-pages small{font-size:9px}.daylabel small{display:block;margin:5px 0;line-height:1.5}.list-pages{justify-content:center;padding:16px}.metrics small{display:block;margin-top:5px;color:var(--muted)}.loan-fields{border:0;border-top:1px solid var(--line);padding:12px 0 0;margin:0}.loan-fields legend{font-size:11.7px;font-weight:650;padding:0 8px 0 0}.loan-fields .form-grid{gap:10px 14px}.loan-fields .field{gap:4px}#record-form .dialog-actions,#postloan-form>.dialog-actions{position:sticky;bottom:0;background:white;padding:12px 0;z-index:3;border-top:1px solid var(--line)}.material-row{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:10px 0}#upload-dates{display:grid;gap:10px}#upload-dates label{display:grid;gap:5px}#draft-restored button{margin-left:10px}

/* Preserve business readings; only long institution/account content wraps. */
.actions{min-width:640px}.actions th{white-space:nowrap}
.actions .step-date,.actions .step-kind,.actions .step-amount{white-space:nowrap;overflow-wrap:normal;word-break:normal}
.actions .step-date{width:94px}.actions .step-kind{width:68px}.actions .step-amount{width:106px;font-variant-numeric:tabular-nums}
.actions .step-target{min-width:160px;overflow-wrap:anywhere}.step-controls button,.step-controls>.pill,.step-controls>.danger{white-space:nowrap}
.action-table-wrap{container-type:inline-size;scrollbar-gutter:stable;overscroll-behavior-x:contain}
/* One scrolling surface for the existing bounded, collapsible todo groups. */
.todo-rows{max-height:none;overflow:visible}.todo-group{margin-top:10px}.todo-group>summary{padding:8px 0}
.todo{padding:8px;margin:6px 0}.todo p{margin:3px 0}.daylabel{margin-bottom:8px}
.list-heading{align-items:center;margin-bottom:12px}.filters{padding:12px;gap:9px;margin-bottom:12px}
.customer-row{padding:14px;margin-bottom:10px}.customer-row .contact{margin-top:4px}.customer-row .metrics{margin:10px 0 0;gap:20px}
.customer-row .metrics span{font-size:9.9px;margin-bottom:3px}.customer-row>.row:last-child:empty{display:none}.customer-row .case-chip{margin-top:10px}
/* Shared field grouping, persistent record identity and local validation. */
.dialoghead{display:grid;grid-template-columns:1fr auto;gap:5px 12px}.record-context{grid-column:1/-1;font-size:10.8px;line-height:1.5;color:var(--muted);overflow-wrap:anywhere}
.field-error{font-size:10.8px;line-height:1.5;color:var(--red);margin-top:5px}.field [aria-invalid=true]{border-color:var(--red)}
#postloan-fields{scroll-margin-top:125px}#postloan-form>.dialog-actions{flex-wrap:wrap;align-items:center;gap:6px}
#debt-progress{width:100%;font-size:10.8px;color:var(--teal);line-height:1.5}.dialog-actions button{white-space:nowrap}
#screen-results th:nth-child(2),#screen-results td:nth-child(2){min-width:210px;max-width:260px}.result-identity{margin:5px 0;line-height:1.5}
button[aria-busy=true]{opacity:.75;cursor:wait}

.actions caption{display:none;font-size:10.8px;color:var(--muted);text-align:left;padding:0 5px 8px}
@container (max-width:639px){.actions caption{display:table-caption}}

/* Approved single-row step layout. Preserve complete numeric/date readings with local scrolling. */
.compact-steps{min-width:760px;table-layout:fixed;width:100%}.compact-steps th,.compact-steps td{padding:10px 6px;vertical-align:middle}.compact-steps th:first-child{width:38px}.compact-steps .step-kind{width:60px}.compact-steps .step-date{width:112px}.compact-steps .step-target{min-width:145px}.compact-steps .step-amount{width:110px}.compact-steps .step-operations{width:135px}.compact-steps .step-controls{width:140px;min-width:140px}.compact-steps th:nth-child(2){width:60px}.compact-steps th:nth-child(3){width:112px}.compact-steps th:nth-child(5){width:110px}.compact-steps th:nth-last-child(2){width:135px}.compact-steps th:last-child{width:140px}
.step-buttons{display:flex;gap:6px;align-items:center;white-space:nowrap}.step-buttons button{white-space:nowrap}.step-status,.step-state select{font-size:10.8px;padding:7px 5px;min-width:94px;white-space:nowrap}.step-note{font-size:9.9px;margin-top:4px}
.plan-rows-scroll{overflow-x:auto;max-width:100%;padding-bottom:6px}.plan-row-head,.plan-editor-row{display:grid;grid-template-columns:28px 60px 112px minmax(140px,1fr) 108px 128px 100px;gap:7px;min-width:740px;align-items:center}.plan-row-head{font-size:10.8px;font-weight:650;color:var(--muted);padding:9px 0;background:var(--soft)}.plan-editor-row{border:0;border-bottom:1px solid var(--line);padding:10px 0;margin:0;border-radius:0;min-height:58px}.plan-editor-row label{margin:0;min-width:0}.plan-editor-row input,.plan-editor-row select{font-size:11.7px;padding:7px 5px;min-width:0;width:100%;height:36px}.plan-editor-row [name=amount]{font-variant-numeric:tabular-nums}.plan-editor-row>.step-content{white-space:nowrap}.plan-editor-row>.step-target{white-space:normal;overflow-wrap:anywhere}.step-more{font-size:9.9px}.step-more>div{display:flex;gap:6px;flex-wrap:wrap}.inline-plan-form{min-width:0}.plan-rows-scroll{scrollbar-gutter:stable}.material-line{align-items:center}.material-entry{min-width:110px}
@container (max-width:759px){.compact-steps caption{display:table-caption}}

/* Keep the two consumer income pairs together within the same block. */
#section-income .values{grid-template-columns:repeat(2,minmax(0,1fr))}

.customer-more{position:relative}.customer-more>summary{cursor:pointer;border:1px solid #b7cbe0;border-radius:4px;padding:5px 10px;min-height:30px;font-size:11.7px;line-height:1.35;color:#245484;background:white;white-space:nowrap;text-align:center}.customer-more>summary:hover{background:#edf4fc;border-color:#6c96c0}.customer-more>div{position:absolute;right:0;top:100%;z-index:12;width:255px;max-width:80vw;padding:12px;display:grid;gap:6px;background:white;border:1px solid var(--line);border-radius:8px;box-shadow:var(--shadow)}.customer-more small,.step-state small,.step-controls small{display:block;color:var(--muted);font-size:10.8px;line-height:1.5}.step-status-text{font-size:11.7px;white-space:nowrap}.income-category-notice p{margin:6px 0 10px}

/* Account actions use the existing menu, modal, form and table specifications. */
.account-menu{position:relative}.account-menu>div{right:0;left:auto;min-width:140px;z-index:100}.account-menu>div>button{display:block;width:100%;text-align:left}.password-control{flex-wrap:nowrap}.password-control input{flex:1;min-width:0}.password-control button{flex:none}.account-menu summary{white-space:nowrap}#employees small{display:block}#employees td{vertical-align:top}#employees td:last-child button{margin:3px}#password-form .dialog-actions{flex-wrap:wrap}

#editor.account-dialog{width:min(560px,calc(100vw - 32px))}

/* Customer lists share one compact row layout; wide columns scroll inside the list. */
.customer-list-scroll{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-gutter:stable;border:1px solid var(--line);background:var(--white)}
.customer-table{width:100%;min-width:850px;border-collapse:collapse;font-size:11.7px;text-align:left}
.customer-table th{font-size:10.8px;font-weight:500;color:var(--muted);background:#f8faf9;white-space:nowrap;padding:10px 9px;border-bottom:1px solid var(--line)}
.customer-table .customer-row{padding:0;margin:0;border:0;border-radius:0;box-shadow:none}
.customer-table td{padding:11px 9px;border-bottom:1px solid var(--line);vertical-align:middle;line-height:1.5}
.customer-table tr:last-child td{border-bottom:0}.customer-table .name{font-size:12.6px;font-weight:600;text-align:left;line-height:1.5;min-width:56px}
.customer-table small{display:block;font-size:10.8px;line-height:1.5;color:var(--muted);margin-top:2px}
.customer-phone,.customer-amount,.customer-date{white-space:nowrap;font-variant-numeric:tabular-nums}.customer-progress{min-width:100px}
.format-hint{display:block;font-size:10.8px;line-height:1.5;margin-top:4px}
.plan-editor-row[draggable=true]{cursor:grab}.plan-editor-row[draggable=true]:active{cursor:grabbing}.plan-editor-row input,.plan-editor-row select{cursor:auto}
.plan-editor-row.dragging{opacity:.55}.plan-editor-row.drag-over{box-shadow:inset 0 3px 0 var(--teal);background:var(--soft)}
.plan-editor-row[draggable=false] .step-order{color:var(--muted)}

/* A-style preview: presentation only. Existing business content stays in place. */
:root{--ink:#24384d;--muted:#62768b;--line:#d6e0eb;--bg:#f5f8fc;--teal:#2365ab;--soft:#eaf2fb;--red:#b33d3d;--amber:#965f17;--shadow:0 8px 24px #12335816;--navy:#15395f;--navy-light:#204b76}
button,.button{border-radius:4px;border-color:#b7cbe0;color:#245484;line-height:1.35;white-space:nowrap;text-align:center}
button:not(:disabled):hover,.button:hover{background:#edf4fc;border-color:#6c96c0}button.primary{background:var(--teal);border-color:#1d5896;box-shadow:inset 0 1px #ffffff1c}button.primary:not(:disabled):hover{background:#1a528d;border-color:#1d5896}
button.quiet{background:white;border-color:#b7cbe0;color:#245484;box-shadow:none}.danger{color:var(--red)!important}
button.danger,.button.danger{background:white;border-color:var(--red);color:var(--red);box-shadow:none}button.danger:not(:disabled):hover,.button.danger:hover{background:#fff1f1;border-color:var(--red)}
button:focus-visible,summary:focus-visible{outline:2px solid #518bc9;outline-offset:2px}
input,select,textarea{padding:7px 9px;border-color:#bdccdc;border-radius:4px;line-height:1.4;min-height:34px}
input:focus,select:focus,textarea:focus{outline-color:#8bb4df}input[type=checkbox]{min-height:0}
.top{height:52px;padding:0 20px;gap:24px;background:var(--navy);border-bottom:1px solid #102c4b;color:#fff}
.brand{min-width:185px}.brandmark{border-radius:5px;background:#fff;color:var(--navy);font-weight:700}.brand strong{font-size:16.2px}.brand small{color:#bbd0e6}.environment{color:#d8e9fb;background:#ffffff12;border:1px solid #ffffff21;white-space:nowrap;font-size:9.9px}
#domain-nav{display:flex;align-self:stretch;align-items:stretch;gap:4px;margin-left:0}
#domain-nav button{background:none;border:0;border-bottom:3px solid transparent;border-radius:0;color:#dce9f7;padding:0 20px;font-size:13.5px;min-width:80px}
#domain-nav button[aria-current=page]{background:var(--navy-light);color:white;border-bottom-color:#9ac4f3;font-weight:650}
#domain-nav button:hover{background:var(--navy-light)}
.topright{font-size:11.7px}.account-menu>summary{border-color:#ffffff30;display:flex;align-items:center;gap:8px;padding:6px 10px;border-radius:4px;background:transparent;color:inherit}.account-menu>summary:hover{background:#ffffff12;border-color:#ffffff30}
.account-menu>summary::marker{content:''}.account-avatar{width:26px;height:26px;flex:none;border-radius:50%;background:#d9e8f7;position:relative;overflow:hidden}.account-avatar::before{content:'';position:absolute;top:5px;left:9px;width:8px;height:8px;border-radius:50%;background:#557a9e}.account-avatar::after{content:'';position:absolute;bottom:2px;left:5px;width:16px;height:9px;border-radius:9px 9px 2px 2px;background:#557a9e}
.account-menu>div{top:calc(100% + 5px);padding:4px;gap:0;min-width:112px;width:112px}.account-menu>div button{color:#245484;background:white;border-color:transparent;min-height:26px;padding:4px 6px;text-align:center;font-size:11px}.account-menu>div button:hover{background:var(--soft);border-color:transparent}
.layout,.layout.left-off,.layout.right-off,.layout.left-off.right-off{height:calc(100dvh - 52px);grid-template-columns:184px minmax(0,1fr);min-height:0;background:#fff}
#left{display:block!important;background:#f3f7fc;border-right:1px solid var(--line);grid-column:1;overflow-y:auto}
#domain-links{padding:18px 10px;display:grid;gap:7px}#domain-links button{display:flex;align-items:center;gap:10px;text-align:left;white-space:normal;min-height:42px;padding:10px 12px;border:1px solid transparent;background:none;color:#415f7d;border-radius:3px;font-size:12.6px}
#domain-links button span{font-size:16.2px;line-height:1;width:20px;text-align:center;flex:none;color:#6a8cb1}
#domain-links button[aria-current=page]{background:#e1edfa;border-color:#ccdff4;border-left:3px solid var(--teal);color:#194e83;font-weight:650;padding-left:10px}
#domain-links button:hover{background:#eaf2fb}
#main{grid-column:2;padding:18px 22px 28px;background:white;min-width:0;min-height:0;overflow:auto}
#content{min-width:0}.pagehead{align-items:center;gap:14px;margin-bottom:14px;padding-bottom:12px;border-bottom:1px solid var(--line)}
h1{font-size:22.5px;letter-spacing:0}.pagehead .row{gap:6px}.pagehead h1{margin-top:3px}.subtitle{margin-top:5px;line-height:1.6}
.filters{border-radius:4px;background:#f7faff;padding:12px;display:flex;gap:10px 14px;align-items:center;margin-bottom:12px}
.filters label{display:flex;align-items:center;gap:7px;font-size:11.7px;white-space:nowrap}
.filters .search{flex:1 1 380px;min-width:300px;max-width:520px}.filters input,.filters select{width:auto;font-size:11.7px;min-height:34px;padding:6px 8px}
.filters .search input{min-width:150px;width:100%;flex:1}.filters select{min-width:90px;max-width:190px}.filters .date{width:auto}.filter-dates{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.filter-dates input{width:143px}.filter-actions{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.list-summary{font-size:10.8px;margin:8px 0}.list-pages{padding:10px 0;gap:10px;justify-content:flex-end}
.customer-list-scroll{border-radius:3px}.customer-table{min-width:820px}.customer-table th{background:#eaf2fb;color:#355575;text-align:center;font-size:11.7px;font-weight:600;padding:9px 10px}
.customer-table td{padding:9px 10px;background:white;border-right:1px solid #e7edf5}.customer-table tbody tr:hover td{background:#f5f9ff}.customer-table .name{min-height:28px;padding:0;color:#1e63a4}.customer-table .customer-amount{text-align:center}.customer-table th:last-child,.customer-table td:last-child{border-right:0}
.detail-nav{margin-bottom:12px;padding:8px 0;background:white;gap:5px}.detail-nav button{font-size:11.7px;padding:6px 10px;border-radius:3px;min-height:34px}.detail-nav .selected{background:var(--soft);border-color:#82abd6;color:#1c538b;box-shadow:inset 0 -2px var(--teal)}
.section{margin:16px 0;scroll-margin-top:65px}.section-title{margin-bottom:8px;padding:9px 12px;background:#eaf2fb;border:1px solid #d5e3f2;border-left:3px solid #5187bd;border-radius:2px;gap:12px}.section-title h2{font-size:17.1px}.section-number{margin-right:10px;font-weight:650}
.card{padding:12px 14px;margin:8px 0;border-radius:3px;box-shadow:none}.cardhead{margin-bottom:8px;padding-bottom:8px;border-bottom:1px solid #e4ebf3;gap:12px}.cardhead h3{font-size:13.5px;line-height:1.6;overflow-wrap:anywhere}
.values{display:flex;flex-wrap:wrap;gap:0;margin:0;border-top:1px solid #e5ecf4;border-left:1px solid #e5ecf4}
.values>div{flex:1 1 var(--field-size,28ch);max-width:100%;display:flex;align-items:center;gap:10px;padding:8px 10px;min-height:40px;min-width:0;border-right:1px solid #e5ecf4;border-bottom:1px solid #e5ecf4}
.values dt{font-size:11.7px;line-height:1.5;margin:0;flex:0 1 auto;color:#63788e}.values dd{font-size:12.6px;line-height:1.5;flex:1;min-width:0;text-align:right;overflow-wrap:anywhere}
.values [data-kind=money] dd,.values [data-kind=date] dd,.values [data-kind=month] dd{white-space:nowrap;font-variant-numeric:tabular-nums}
.values [data-kind=text]{flex-basis:var(--field-size,34ch)}.values [data-kind=text] dd{text-align:left}
.empty-value{color:#8492a1}.materials{padding-top:8px;margin-top:9px}.material-line{font-size:10.8px;margin:6px 0;gap:8px}.material-file{max-width:100%;white-space:normal;overflow-wrap:anywhere;text-overflow:clip;text-align:left}
.subhead{margin:14px 0 8px;padding:6px 0;border-bottom:1px solid var(--line)}.hint{background:#f0f5fc;border-radius:3px;margin:10px 0;padding:9px 12px;line-height:1.7;font-size:11.7px;border-left:3px solid #c5d9ef}.empty{padding:18px 0}.stack{gap:12px}
.pill{font-size:10.8px;border-radius:3px;padding:3px 7px;line-height:1.5;background:#eaf2fb;color:#235f9a}.pill.warn{background:#fff2d9;color:#885510}.pill.gray{background:#edf0f4;color:#647586}
.business-case>.cardhead{background:#f2f7fd;margin:-12px -14px 0;padding:10px 14px;border-bottom:1px solid var(--line)}.business-case .case-state{background:#f9fbfe;color:#315779;border-bottom:1px solid var(--line);border-radius:0;margin:0 -14px 10px;padding:8px 14px;font-size:11.7px}.business-case .case-actions{padding-top:10px;margin-top:10px;gap:8px}.business-case .case-actions .row{gap:6px}
.plan{margin-top:10px;padding:10px;border:1px solid #d3e1f0;border-radius:3px;background:white}.plan header{padding:4px 0 8px;margin-bottom:0;border-bottom:1px solid #e5ecf4}.plan header h4{line-height:1.7}.actions{margin:0;font-size:11.7px}.actions th{background:#edf4fc;font-size:10.8px;color:#426282;text-align:center;font-weight:600;border:1px solid #dce6f1;padding:8px 6px}.actions td{padding:8px 6px;border-right:1px solid #e4ebf3;vertical-align:middle;line-height:1.55}.actions td:first-child,.actions .step-kind,.actions .step-date,.actions .step-controls{text-align:center}.actions .step-amount{text-align:center}.step-buttons{justify-content:center}.step-status{min-height:34px}.step-status-text{display:inline-block;background:#edf2f7;color:#52677c;padding:3px 7px;border-radius:3px;line-height:1.6}.action-done .step-status-text{background:#e6f3ec;color:#287448}.action-unable .step-status-text{background:#fbe9e8;color:#a33b37}.step-controls small{font-size:10.8px}.step-controls details{text-align:left}
.plan-row-head{background:#edf4fc;border-top:1px solid var(--line);border-bottom:1px solid var(--line);text-align:center}.plan-editor-row{padding:8px 0;min-height:52px;background:white}.plan-editor-row [name=amount]{text-align:center}.plan-editor-row>.step-order{text-align:center}.plan-editor-row>.step-state{text-align:center}.plan-editor-row .step-state small{font-size:10.8px}.step-more{text-align:left}.inline-plan-form .dialog-actions{background:white;border-top:1px solid var(--line);padding:9px 0}.plan-edit-area .inline-plan-form{gap:10px}
.postloan{padding:10px;border-radius:3px;margin-top:12px}.formal-debt-summary{background:#f6f9fd;border-radius:3px;padding:8px 10px}.formal-debt-summary p{font-size:11.7px}.history{margin-top:10px}.log{border-left-color:#adc7e3;margin:10px 0}
dialog{position:fixed;inset:0;margin:auto;width:min(920px,calc(100vw - 40px));border-radius:5px;max-height:90dvh;box-shadow:0 20px 70px #102f5130;border-color:#bdcfe2}
dialog::backdrop{background:#17334d55;backdrop-filter:none}.dialoghead{padding:12px 16px;background:#edf4fc;border-bottom:1px solid #cddded;gap:4px 12px}.dialoghead h2{font-size:16.2px}.dialoghead>button{min-height:24px;background:none}.record-context{font-size:11.7px}#dialog-body{padding:16px}#dialog-body form{gap:14px}
.form-grid,.loan-fields .form-grid{display:flex;flex-wrap:wrap;align-items:flex-start;gap:12px 16px}.form-grid>.field{flex:1 1 var(--field-size,28ch);min-width:0;max-width:100%}.field>label{font-size:11.7px;margin-bottom:5px;line-height:1.5}.field input,.field select{font-size:12.6px}.field .state{font-size:10.8px;min-height:24px;padding:2px 0;margin-top:3px;color:#63788c;display:block}.format-hint{margin-top:3px}.loan-fields{padding-top:10px}.loan-fields legend{font-size:12.6px;color:#365b80}.dialog-actions{padding-top:12px;gap:6px}.form-error{font-size:11.7px}.field-error{font-size:11.7px}#record-form .dialog-actions,#postloan-form>.dialog-actions{padding:10px 0;background:white}
#postloan-fields:not(:empty){padding:10px;background:#f6f9fd;border:1px solid #d9e5f2;border-radius:3px;gap:12px}#postloan-records h4{margin:8px 0}.checklist{gap:8px}.checklist label{font-size:11.7px}
.screen-table{border:1px solid var(--line);border-radius:3px}.screen-table table{width:100%;font-size:11.7px}.screen-table th{background:#eaf2fb;color:#355575;text-align:center;font-weight:600}.screen-table th,.screen-table td{padding:8px 10px;border-right:1px solid #e3eaf3;border-bottom:1px solid var(--line);line-height:1.6}.screen-table td[data-kind=money]{text-align:center;white-space:nowrap;font-variant-numeric:tabular-nums}.screen-table th:last-child,.screen-table td:last-child{border-right:0}.screen-heading{margin-bottom:8px}.screen-meta{gap:10px;align-items:center}.screen-pages{margin-top:10px}#employees td:last-child{min-width:210px}.screen-table small{font-size:10.8px}
#todo-workspace{min-width:0}#todos{padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:start}.daylabel{grid-column:1/-1;padding:10px 12px;margin:0;border:1px solid var(--line);background:#f7faff;font-size:11.7px;line-height:1.6}.daylabel small{font-size:10.8px}.todo-group{margin:0;border:1px solid var(--line);border-radius:3px;background:white;overflow:hidden}.todo-group>summary{padding:10px 12px;background:#edf4fc;border-bottom:1px solid var(--line);font-size:12.6px;color:#315e8c;letter-spacing:0}.todo-group.overdue>summary{color:var(--red)}.todo-rows{max-height:none;overflow:visible}.todo{border:0;border-bottom:1px solid #e5ecf4;border-radius:0;padding:10px 12px;margin:0}.todo:last-child{border-bottom:0}.todo .locate{min-height:0;white-space:normal;color:var(--ink)}.todo strong{font-size:12.6px}.todo p{font-size:11.7px;margin:4px 0}.todo small{font-size:10.8px}.todo-footer{margin-top:5px}.todo-rows>.muted{padding:14px}.todo-pages{justify-content:flex-end;padding:8px 12px}.todo-pages small{font-size:10.8px}
.business-queue .todo-group{width:100%}.business-queue .todo .locate{display:grid;grid-template-columns:minmax(120px,.4fr) minmax(280px,1.6fr);align-items:center;gap:18px}.business-queue .todo p{margin:0}.business-queue .todo:hover{background:#f6faff}
#assistant-dialog{position:fixed;inset:0;margin:auto;width:min(470px,calc(100vw - 220px));max-height:calc(100dvh - 98px);padding:0;z-index:20;background:white}
#assistant-dialog:not([open]){display:none}#assistant-dialog #right{display:flex;position:static;width:100%;height:min(540px,calc(100dvh - 100px));min-height:280px;border:0;overflow:hidden;background:white}
#right .assistant-title{height:auto;min-height:46px;padding:9px 14px;background:#edf4fc;border-bottom:1px solid var(--line);gap:7px;flex:none}.assistant-title h2{font-size:13.5px}.assistant-title .connection{font-size:10.8px;white-space:normal;text-overflow:clip}.assistant-title button{margin-left:auto;min-height:24px}
#chat-messages{padding:0 14px;min-height:100px}.bubble{font-size:12.6px;line-height:1.65;background:#f5f8fc;border-color:#e0e8f1;border-radius:4px;padding:10px;margin:12px 0}.bubble.user{background:#eaf2fc;border:1px solid #d4e3f5}.bubble small{font-size:10.8px;color:#627a94}#chat-form{padding:12px 14px;background:#fafcff}#chat-form textarea{font-size:12.6px;height:62px;min-height:62px;max-height:62px;line-height:20px}#query-preview{padding:8px 14px}#query-preview:empty{padding:0}
.loginbox{border-radius:5px;padding:28px;box-shadow:var(--shadow)}#login{background:linear-gradient(135deg,#e6eff9,#f7faff)}.loginbox .brandmark{background:var(--navy);color:white}.loginbox form{gap:14px}.loginbox h1{margin-top:18px}#toast{border-radius:4px;background:var(--navy)}
@media(max-width:1250px){.top{gap:16px;padding:0 16px}.brand{min-width:176px}.environment{display:none}.layout,.layout.left-off,.layout.right-off,.layout.left-off.right-off{grid-template-columns:172px minmax(0,1fr)}#main{padding:16px}.filters .search{max-width:none;flex-basis:100%}#domain-nav button{padding:0 15px}.values{display:flex}.form-grid{display:flex}#section-income .values{display:flex}}
@media(max-width:950px){.layout,.layout.left-off,.layout.right-off,.layout.left-off.right-off{grid-template-columns:158px minmax(0,1fr)}.layout #left{display:block}#domain-nav button{padding:0 10px;font-size:12.6px}.brand{min-width:155px}.top{gap:10px}#todos{grid-template-columns:1fr}.filters .search{min-width:0}.filter-dates{gap:6px}.topright{min-width:0}.account-menu>summary{white-space:normal}}
.filter-dates{flex:0 0 auto;max-width:100%}.filter-dates label{flex:none}.filter-dates input{flex:none}.filters>label:not(.search){flex:none}
#assistant-dialog #right{flex-direction:column}
.filters .filter-dates label.date{width:auto}
.form-grid>.field{flex-grow:0;flex-basis:var(--field-size,28ch);max-width:100%}
.values>div{flex-grow:0;flex-basis:var(--field-size,28ch)}
.values [data-kind=text]{flex-grow:1}.values dt{flex-shrink:0;max-width:65%}.values dd{min-width:5ch}

/* Content-size classes work with the existing self-only stylesheet policy. */
[data-span=short]{--field-size:22ch}[data-span=regular]{--field-size:32ch}[data-span=wide]{--field-size:46ch}[data-span=long]{--field-size:64ch}
.values>div{flex-shrink:1;max-width:100%}.form-grid>.field[data-span=long]{flex-basis:min(100%,64ch)}

/* Column headings and their corresponding values share one alignment. */
.customer-table th,.customer-table td,.customer-table .name,
.actions th,.actions td,.actions .step-controls details,
.screen-table th,.screen-table td{ text-align:center; }
.plan-row-head,.plan-editor-row,.plan-editor-row input,.plan-editor-row select{ text-align:center; }
.dialoghead,.assistant-title{cursor:grab;touch-action:none;user-select:none}
.dialog-dragging .dialoghead,.dialog-dragging .assistant-title{cursor:grabbing}
.dialoghead button,.dialoghead a,.assistant-title button{cursor:pointer}

/* Independent query fields share three compact rows; date bounds stay together. */
#filters{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;padding:12px}
#filters .filter-row{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr) minmax(0,1.1fr);gap:16px;align-items:center}
#filters .filter-row label{min-width:0;gap:8px}
#filters .filter-row label>span{flex:none}
#filters .filter-identity label>span{width:4em}
#filters .filter-row input,#filters .filter-row select{width:100%;min-width:0;max-width:none;flex:1}
#filters .filter-bottom{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px 16px}
#filters .filter-dates{gap:8px}#filters .filter-dates input{width:143px}
#filters .filter-actions{flex:none;gap:8px}
@media(max-width:950px){#filters .filter-row{grid-template-columns:minmax(0,1fr)}#filters .filter-row label>span{width:9em}}

#filters .filter-row label:first-child>span,#filters .filter-dates label.date:first-child>span{width:8em;flex:none}
#filters .filter-dates label.date{gap:8px}

/* Connected client tabs and a consistent, centered detail grid. */
#content>.detail-nav{position:sticky;top:-18px;display:flex;gap:0;padding:0;margin:0;border:0;border-bottom:1px solid #b7cbe0;background:#edf4fc;z-index:3}
.detail-nav [role=tab]{flex:1;min-width:0;border:1px solid #b7cbe0;border-bottom:0;border-radius:0;margin:0;padding:11px 8px;background:#edf4fc;color:#355575;text-align:center;white-space:normal;line-height:1.5}
.detail-nav [role=tab]+[role=tab]{border-left:0}
.detail-nav [role=tab].selected{position:relative;background:white;color:#1c538b;box-shadow:inset 0 3px var(--teal);font-weight:650}
.detail-nav [role=tab].selected::after{content:'';position:absolute;left:0;right:0;height:2px;bottom:-1px;background:white}
.detail-panels{border:1px solid #b7cbe0;border-top:0;background:white;padding:12px;min-width:0}
.detail-panels>.detail-panel{margin:0;min-width:0}.detail-panel[hidden]{display:none}
.detail-panel>.section-title{margin:0 0 10px;padding:7px 10px;border-width:0 0 1px;border-radius:0;background:#f4f8fd}
.detail-panel>.card{border:0;border-radius:0;padding:8px 0;margin:0;box-shadow:none}
.detail-panel>.card+.card{border-top:1px solid var(--line);margin-top:8px;padding-top:12px}
.detail-panel>.subhead{margin:10px 0 4px}.detail-panel>.hint{margin-top:0}
.detail-panel .cardhead{margin-bottom:8px;padding-bottom:6px}
.detail-panel>.business-case>.cardhead{margin:0;padding:10px}.detail-panel>.business-case>.case-state{margin:0 0 10px;padding:8px 10px}
.values,#section-income .values{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:0;width:100%;border:1px solid #d6e0eb;border-right:0;border-bottom:0}
.values>div,.values [data-kind=text]{display:grid;grid-template-columns:minmax(0,42%) minmax(0,58%);grid-column:span 4;gap:0;padding:0;min-width:0;max-width:none;min-height:42px;align-items:stretch}
.values>div:last-child:nth-child(3n+1){grid-column:span 12}
.values>div:nth-last-child(2):nth-child(3n+1),.values>div:last-child:nth-child(3n+2){grid-column:span 6}
.values dt,.values dd,.values [data-kind=text] dd{display:flex;align-items:center;justify-content:center;text-align:center;max-width:none;min-width:0;margin:0;padding:8px;line-height:1.5;overflow-wrap:anywhere}
.values dt{background:#f5f8fc;border-right:1px solid #e5ecf4;color:#63788e}.values dd{background:white}
/* Read-only client information keeps three fields per row at desktop widths.
   The final one or two fields fill their row; entry forms are unchanged. */

/* Compact reading density: readable text, natural height, and horizontal materials. */
:root{font-size:11.7px}
h1{font-size:18.9px}h2,.section-title h2{font-size:14.4px}h3,.cardhead h3{font-size:12.6px}
button,.button{min-height:30px;padding:5px 10px;font-size:11.7px}
dialog button,dialog .button,.actions button,.plan-editor-row button,.screen-table button,.todo-footer button,.todo-pages button,.customer-more>div button{min-height:26px;padding:4px 6px;font-size:11px}
input,select,textarea{min-height:30px;padding:5px 8px;font-size:11.7px}
#main{padding-top:12px}.pagehead{margin-bottom:10px;padding-bottom:8px;gap:10px}.pagehead .row{gap:6px}
#filters{padding:9px 10px;gap:7px;margin-bottom:8px}
#filters input,#filters select{min-height:30px;padding:4px 7px;font-size:10.8px}
#filters label{font-size:10.8px}#filters .filter-row{gap:12px}#filters .filter-row label{gap:6px}
#filters .filter-bottom{gap:7px 12px}#filters .filter-actions{gap:6px}
.list-summary{margin:6px 0}.list-pages{padding:7px 0;font-size:10.8px}
.customer-table th{font-size:10.8px;padding:6px 8px}
.customer-table td{font-size:10.8px;padding:4px 8px;line-height:1.5}
.customer-table .name{font-size:11.7px;min-height:26px}.customer-table small{font-size:10.8px;line-height:1.2;margin-top:0}
#content>.detail-nav{top:-12px}.detail-nav [role=tab]{padding:7px 6px;font-size:10.8px;min-height:34px}
.detail-panels{padding:9px}.detail-panel>.section-title{padding:5px 8px;margin-bottom:7px}
.detail-panel>.card{padding:5px 0}.detail-panel>.card+.card{margin-top:6px;padding-top:8px}
.detail-panel .cardhead{margin-bottom:5px;padding-bottom:4px}.cardhead h3{font-size:12.6px}
.values>div,.values [data-kind=text]{min-height:32px}.values dt,.values dd,.values [data-kind=text] dd{padding:5px 6px;font-size:10.8px;line-height:1.5}
.materials{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:start;gap:8px;padding-top:6px;margin-top:6px}
.materials>.material-line{max-width:100%;margin:0;min-height:40px}
.material-entry{min-width:0;flex:none}
.material-file{max-width:100%;white-space:normal;overflow-wrap:anywhere}
#asset-materials .materials,#liability-materials .materials{border-top:0;margin-top:4px;padding-top:0}
.card{padding:9px 10px}.subhead{margin:10px 0 6px}.hint{padding:7px 9px;margin:7px 0;font-size:10.8px}
.section{margin:12px 0}.section-number{font-size:10.8px}.subtitle{font-size:10.8px;margin-top:4px}
.actions,.screen-table table{font-size:10.8px}.actions th,.actions td{padding:6px}.actions .important-word{font-size:12.6px}
.screen-table th,.screen-table td{padding:6px 8px}.plan-editor-row{padding:6px 0;min-height:44px}
.dialoghead{padding:9px 12px}.dialoghead h2{font-size:14.4px}#dialog-body{padding:12px}
.form-grid{gap:10px 14px}.field input,.field select{font-size:11.7px}.field>label{font-size:10.8px;margin-bottom:4px}
#dialog-body form{gap:11px}.field .state{font-size:10.8px}
.bubble,#chat-form textarea{font-size:11.7px}.todo strong{font-size:11.7px}.todo p{font-size:10.8px}
@media(max-width:1250px){#main{padding-top:12px}#content>.detail-nav{top:-12px}}

/* Material categories share aligned names, actions and file rows. */
.material-line{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;min-width:0;border:1px solid #b7cbe0;background:#f4f8fd;border-radius:3px;padding:8px;gap:6px}
.material-line .material-entry{grid-column:1;grid-row:1;font-weight:600;color:#245484;padding-right:0;border-right:0;line-height:1.4}
.material-line [data-action=upload]{grid-column:2;grid-row:1}
.material-line .material-file{grid-column:1/-1;width:100%;text-align:left;background:white;border-color:#cbd9e8;line-height:1.4}
.material-line>small{grid-column:1/-1;margin:0;line-height:1.4}
@media(max-width:950px){.materials{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.materials{grid-template-columns:minmax(0,1fr)}}
/* Entry forms share centered rows; field widths follow the value they collect. */
.record-fields{min-width:0}
/* Shared entry rows: subtle internal rules, without another enclosing card. */
.record-fields .form-grid,#record-form>.form-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:0;align-items:stretch}
.record-fields .form-grid>.field,#record-form>.form-grid>.field{grid-column:span 4;padding:3px 7px;box-sizing:border-box;border:0}
.record-fields .form-grid>.field:not(:nth-child(3n+1)),#record-form>.form-grid>.field:not(:nth-child(3n+1)){border-left:1px solid #e3eaf3}
.record-fields .form-grid>.field:nth-child(n+4),#record-form>.form-grid>.field:nth-child(n+4){border-top:1px solid #e3eaf3}
.record-fields .form-grid>.field:last-child:nth-child(3n+1),#record-form>.form-grid>.field:last-child:nth-child(3n+1){grid-column:1/-1}
.record-fields .form-grid>.field:nth-last-child(2):nth-child(3n+1),.record-fields .form-grid>.field:last-child:nth-child(3n+2),#record-form>.form-grid>.field:nth-last-child(2):nth-child(3n+1),#record-form>.form-grid>.field:last-child:nth-child(3n+2){grid-column:span 6}
#record-form>.record-fields+.form-grid{border-top:1px solid #e3eaf3;padding-top:4px}
.record-fields .field,#record-form>.form-grid>.field{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:0;min-width:0;max-width:100%;text-align:center}
.record-fields .field>label,#record-form>.form-grid>.field>label{text-align:center;display:flex;align-items:center;justify-content:center;min-height:18px;height:18px;margin:0 0 3px;color:#365b80}
.record-fields .field input,.record-fields .field select,#record-form>.form-grid select{text-align:center}
.record-fields .field .state,#record-form>.form-grid .state{margin:3px auto 0;display:block}
.record-fields [data-field=name]{flex-basis:140px}.record-fields [data-field=phone]{flex-basis:180px}.record-fields [data-field=id_number]{flex-basis:270px}
.record-fields [data-field=address],.record-fields [data-field=business_name],.record-fields [data-field=business_scope]{flex-basis:320px}
.record-fields [data-kind=money],.record-fields [data-kind=date],.record-fields [data-kind=month],.record-fields [data-kind=integer],.record-fields [data-kind=day]{flex-basis:190px}
.record-fields .format-hint{display:block;line-height:1.5;font-size:10.8px;text-align:center}
.field input::placeholder{color:#8190a1;opacity:1}
.entry-date{position:relative;display:block;flex:none;width:100%;max-width:none;margin:0 auto;line-height:0}
.entry-date.is-empty:not(:focus-within) input::-webkit-datetime-edit{color:transparent}
#record-form[data-table=incomes] .field{width:100%;max-width:none}
.field-advisory{display:block;color:#b52b24;font-size:10.8px;line-height:1.5;margin-top:5px;text-align:center}

.record-fields .field{width:100%}.record-fields .field input,.record-fields .field select,#record-form>.form-grid select{display:block;width:100%;max-width:none;height:32px;min-height:32px;margin:0;line-height:1.2}.record-fields .form-grid>.field:only-child{grid-column:1/-1}


/* A-style visual preview from 7cc60ec5. Ordinary customer detail and entry
   forms deliberately retain the baseline stylesheet without overrides. */
.top{box-shadow:0 1px 4px #12335816}
#domain-nav{gap:0}#domain-nav button{padding:0 24px}#domain-nav button[aria-current=page]{box-shadow:inset 0 -1px #bfd9f6}
#domain-links button[aria-current=page]{box-shadow:inset 0 0 0 1px #d8e7f7}
/* The customer list is outside the frozen, pre-submission customer interior. */
.list-heading{margin-bottom:6px;padding-bottom:4px}.list-heading h1{font-size:19.8px}
#filters{padding:6px 12px;gap:6px;grid-template-columns:minmax(0,1fr) auto;background:#f6f9fd;border:1px solid var(--line);margin-bottom:10px}
#filters .filter-row{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 16px}
#filters .filter-identity{grid-column:1/-1}
#filters .filter-options:has(>label:nth-child(2):last-child){grid-template-columns:repeat(2,minmax(0,1fr))}
#filters .filter-row label{display:grid;gap:3px;align-items:start;white-space:normal}
#filters .filter-row label>span,#filters .filter-row label:first-child>span{width:auto;min-height:14px}
#filters input,#filters select{min-height:26px;font-size:11.7px;padding:3px 8px}#filters label{font-size:11.7px}
#filters .filter-more{min-width:0;align-self:center}

#filters .filter-more[open]{grid-column:1/-1}
#filters .filter-more[open]>.filter-row{margin-top:10px;padding-top:10px;border-top:1px solid var(--line)}
#filters .filter-bottom{justify-content:flex-end;grid-column:2;gap:8px}
#filters .filter-actions{gap:6px}.list-summary{margin:3px 0;font-size:10.8px}.list-pages{padding:9px 0;gap:10px;font-size:11.7px}
.customer-table{min-width:790px}.customer-table th{background:#eaf2fb;font-size:11.7px;color:#365878;font-weight:600;padding:3px 8px;border-right:1px solid #d8e4f0}
.customer-table td{font-size:11.7px;padding:1px 8px;line-height:1.2}.customer-table .name{font-size:12.6px;min-height:20px;padding:0;font-weight:600}
.customer-table small{font-size:10.8px;line-height:1.2;margin-top:0}.customer-table .customer-amount{text-align:center;font-variant-numeric:tabular-nums}.customer-table .customer-progress{min-width:95px}.customer-table tbody tr:nth-child(even) td{background:#fbfdff}.customer-table tbody tr:hover td{background:#eff5fc}
/* Handling phases only. Draft / returned pre-submission cases remain frozen. */
.business-case[data-visual-phase=handling]{border:1px solid #d4e0ed;padding:0;margin:12px 0;display:grid;grid-template-columns:minmax(0,1fr) auto;border-radius:4px;overflow:visible}
.business-case[data-visual-phase=handling]>*{grid-column:1/-1;min-width:0}
.detail-panel>.business-case[data-visual-phase=handling]>.cardhead{grid-column:1;margin:0;padding:12px;background:#edf4fc;border:0;border-radius:3px 0 0 0;gap:12px}
.detail-panel>.business-case[data-visual-phase=handling]>.case-state{grid-column:2;margin:0;padding:12px;background:#edf4fc;border:0;border-radius:0 3px 0 0;align-self:stretch;max-width:270px;font-size:11.7px}
.business-case[data-visual-phase=handling]>:is(.plan,.hint,.postloan,.history){margin:10px 12px}
.business-case[data-visual-phase=handling] .plan{border:1px solid #d4e0ed;padding:0;border-radius:3px;overflow:hidden}
.business-case[data-visual-phase=handling] .plan>header{padding:9px 10px;background:#f3f7fc;border-bottom:1px solid #d4e0ed;gap:12px}
.business-case[data-visual-phase=handling] .plan>header h4{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.business-case[data-visual-phase=handling] .plan>.history{padding:8px 10px}.business-case[data-visual-phase=handling] .plan-edit-area{padding:0 10px}
.business-case[data-visual-phase=handling] .pill{padding:3px 8px;border-radius:3px;font-size:10.8px;background:#eaf3fc;color:#275e94;border:1px solid #d2e2f3}
.business-case[data-visual-phase=handling] .pill.warn{background:#fff5e5;color:#8a5917;border-color:#eed9b3}
.business-case[data-visual-phase=handling] .actions{min-width:820px;font-size:11.7px;margin:0}
.business-case[data-visual-phase=handling] .actions th{background:#edf4fc;font-size:11.7px;padding:9px 10px;color:#385b7f;border-right:1px solid #d4e0ed}
.business-case[data-visual-phase=handling] .actions td{padding:9px 10px;border-right:1px solid #e0e8f2;line-height:1.6}
.business-case[data-visual-phase=handling] .actions :is(th,td):last-child{border-right:0}
.business-case[data-visual-phase=handling] .actions .step-target{text-align:center;min-width:195px}
.business-case[data-visual-phase=handling] .actions .step-amount{text-align:right;font-variant-numeric:tabular-nums;min-width:115px}
.business-case[data-visual-phase=handling] .actions .step-date{min-width:110px}
.business-case[data-visual-phase=handling] .step-buttons{gap:6px}.business-case[data-visual-phase=handling] .step-controls small{font-size:10.8px}.business-case[data-visual-phase=handling] .action-done .step-status-text{color:#237650}.business-case[data-visual-phase=handling] .action-unable .step-status-text{color:var(--red)}
.business-case[data-visual-phase=handling]>.case-actions{padding:10px 12px;margin:0;border-top:1px solid #d4e0ed;background:#fafcff}
.business-case[data-visual-phase=handling] .postloan{padding:12px;background:white;border-color:#d4e0ed}
.business-case[data-visual-phase=handling] .formal-debt-summary{padding:10px 12px;background:#f5f9fe;border:1px solid #dce7f3;border-radius:3px}
.business-case[data-visual-phase=handling] .formal-debt-summary p{font-size:11.7px;line-height:1.6}
/* Formal debt and review dialogs only: never ordinary customer record forms. */
#editor:has(:is(#postloan-form,#review-form,#confirm-form,#employees)){width:min(900px,calc(100vw - 40px));border:1px solid #c6d8eb;border-radius:6px;box-shadow:0 12px 36px #1735531c}
#editor:has(:is(#postloan-form,#review-form,#confirm-form,#employees)) .dialoghead{padding:13px 16px;background:#eaf2fb;border-bottom:1px solid #ccdeef}
#editor:has(:is(#postloan-form,#review-form,#confirm-form,#employees)) .dialoghead h2{font-size:15.3px}
#editor:has(:is(#postloan-form,#review-form,#confirm-form,#employees)) #dialog-body{padding:14px 16px}
#postloan-form .loan-fields{margin:0;padding:0;border:0}#postloan-form .loan-fields legend{padding:2px 10px;margin:0;font-size:11.7px;color:#315a85;line-height:1.5}
#postloan-fields:not(:empty){padding:0;background:white;border:0;border-radius:0}#postloan-records .card{padding:8px 10px;border-radius:3px;margin:6px 0;border:1px solid #d4e0ed;box-shadow:none}#postloan-records h4{margin-top:10px}#debt-progress{font-size:11.7px}
#postloan-form>.dialog-actions{padding:8px 0 0;margin-top:0;gap:6px}
/***** Existing bounded groups in the main workspace. *****/
#todos{gap:16px;grid-template-columns:repeat(2,minmax(0,1fr))}.daylabel{padding:12px 14px;font-size:11.7px;border-radius:3px}.todo-group{border-color:#d4e0ed}.todo-group>summary{padding:10px 12px;font-size:12.6px;background:#edf4fc}.todo{margin:0;padding:10px 12px;border-bottom:1px solid #e1e9f3}.todo strong{font-size:12.6px}.todo p{font-size:11.7px;line-height:1.6}.todo small{font-size:10.8px}.todo-rows{max-height:none;overflow:visible}.todo-footer{margin-top:7px}.todo-group.overdue>summary{background:#fff1ed}
.business-queue .todo .locate{grid-template-columns:minmax(140px,.55fr) minmax(220px,1.45fr);gap:20px;min-height:40px}.business-queue .todo{padding:9px 14px}.business-queue .todo:nth-child(even){background:#fafcff}.business-queue .todo:hover{background:#edf4fc}
#employees table{width:100%;border-collapse:collapse;font-size:11.7px}#employees th{background:#edf4fc;padding:10px;border:1px solid #d4e0ed}#employees td{padding:10px;border:1px solid #d4e0ed;vertical-align:middle}#employees td:last-child{white-space:normal}
#assistant-dialog{width:min(480px,calc(100vw - 48px));border-color:#c6d8eb;border-radius:6px;box-shadow:0 12px 36px #1735531c}#assistant-dialog #right{height:min(550px,calc(100dvh - 96px))}#right .assistant-title{padding:12px 14px;min-height:48px}.assistant-title h2{font-size:14.4px}#chat-messages{padding:0 14px;overflow-y:auto}.bubble{padding:10px 12px;margin:12px 0;font-size:12.6px;line-height:1.65}#chat-form{padding:12px 14px;border-top:1px solid #d4e0ed}#chat-form textarea{font-size:12.6px;height:64px;min-height:64px;max-height:64px;line-height:22px}#content:has(#screen-results) .screen-table th,#content:has(#screen-results) .screen-table td{padding:8px 10px;font-size:11.7px}#screen-results td[data-kind=money]{text-align:right}
@media(max-width:1150px){#domain-nav button{padding:0 15px}#filters .filter-row{gap:12px}.detail-panel>.business-case[data-visual-phase=handling]>.cardhead{grid-column:1/-1}.detail-panel>.business-case[data-visual-phase=handling]>.case-state{grid-column:1/-1;border-radius:0;max-width:none;padding-top:0}#todos{gap:12px}}
@media(max-width:950px){#filters .filter-row{grid-template-columns:repeat(2,minmax(0,1fr))}#filters .filter-row label>span{width:auto}#todos{grid-template-columns:1fr}}

/* Existing components, with the section navigation moved to the sidebar. */
.detail-panels{border-top:1px solid #b7cbe0}
#domain-links .daylabel{overflow-wrap:anywhere}
#domain-links hr{border:0;border-top:1px solid #d8e7f7;margin:12px 0}

.settings-password{max-width:580px}.settings-password form{display:grid;gap:14px}.settings-password .password-control{flex-wrap:nowrap}.settings-password .password-control input{flex:1;min-width:0}.settings-password .dialog-actions{justify-content:flex-end}
.history>summary,.step-note>summary,.step-more>summary,.submission-content>summary,.source>summary,.query-description>summary,#filters .filter-more>summary{display:list-item;list-style-position:inside;width:fit-content;max-width:100%;min-height:30px;padding:5px 10px;background:white;color:#245484;border:1px solid #b7cbe0;border-radius:4px;font-size:11.7px;line-height:1.35;text-align:center;cursor:pointer}
:is(.history,.step-note,.step-more,.submission-content,.source,.query-description,.filter-more)>summary:hover{background:#edf4fc;border-color:#6c96c0}
.step-note>summary,.step-more>summary,#editor :is(.history,.submission-content,.source,.query-description)>summary{min-height:26px;padding:4px 6px;font-size:11px}.business-case>.case-history .log{font-size:11.7px;line-height:1.7}.business-case>.case-history .log small{font-size:10.8px}
.detail-panel>.business-case[data-visual-phase=handling]>.case-state{grid-column:1/-1;padding:6px 12px;background:transparent;max-width:none}.business-case .case-state:only-child{margin:0}.business-case .case-actions:has(>.row:empty):not(:has(>button)){display:none}

/* Debt entry uses the existing record controls and dialog drag handling. */
#editor:has(#record-form,#postloan-form[data-table]){width:min(780px,calc(100vw - 40px));max-height:calc(100dvh - 32px)}
#editor:has([data-table=overdue],#postloan-form[data-table=none]){width:min(640px,calc(100vw - 40px))}
#editor:has(#record-form,#postloan-form[data-table]) .dialoghead{padding:6px 10px;gap:1px 8px}
#editor:has(#record-form,#postloan-form[data-table]) #dialog-body{padding:6px 10px}
#editor:has(#record-form,#postloan-form[data-table]) form{gap:6px}
#editor .record-fields[data-record-fields=loans] .loan-fields:last-child .field:nth-child(n+4){grid-column:span 3;border-top:1px solid #e3eaf3;border-left:1px solid #e3eaf3}
#editor .record-fields[data-record-fields=loans] .loan-fields:last-child .field:nth-child(4){border-left:0}
#record-form[data-table=overdue] .record-fields .form-grid>.field{grid-column:span 3;border-top:0}
#record-form[data-table=overdue] .record-fields .form-grid>.field:not(:first-child){border-left:1px solid #e3eaf3}
#postloan-form[data-table] .record-fields .field>label{height:18px;min-height:18px;margin-bottom:3px}
#postloan-form[data-table] .record-fields .field input,#postloan-form[data-table] .record-fields .field select{height:26px;min-height:26px;text-align:center}
#section-needs:has(>.debt-workspace),.detail-panels:has(.debt-workspace){border:0;padding:0;background:white}
#section-needs>.debt-workspace{display:block;padding:0;border:0;margin:8px 0;box-shadow:none;background:white}
#section-needs>.debt-workspace>.case-state{display:none}
#section-needs>.debt-workspace>.postloan{padding:0;border:0;margin:0;background:white}
.debt-list{margin:12px 0 16px;padding:0;border:0}
.debt-list .subhead{margin:0 0 8px;gap:12px}
.debt-list .debt-add{width:138px;height:30px;min-height:30px;flex:none;padding:5px 10px;text-align:center}
.debt-list table{width:100%;table-layout:fixed;border-collapse:collapse}
.debt-list .screen-table :is(th,td){text-align:center;vertical-align:middle;padding:6px 10px;overflow-wrap:anywhere}
.debt-list>p{padding:6px 0 10px;border-bottom:1px solid var(--line)}
#section-needs>.debt-workspace>.case-actions{padding:8px 0;background:white}

/* Compact dialogs keep the same controls, validation, and mouse dragging. */
#editor{width:min(640px,calc(100vw - 40px));font-size:11.7px}
#editor .dialoghead{padding:6px 10px;gap:1px 8px}
#editor .dialoghead h2{font-size:13px}
#editor .record-context{font-size:10.5px;line-height:1.4}
#editor #dialog-body{padding:8px 10px}
#editor #dialog-body form{gap:8px}
#editor :is(input,select,textarea){font-size:11px;padding:4px 6px;line-height:1.25}
#editor input:not([type=checkbox]):not([type=radio]):not([type=file]),#editor select{height:26px;min-height:26px}
#editor #record-form>.form-grid select{height:26px;min-height:26px;font-size:11px}
#editor textarea{min-height:48px}
#editor :is(label,.field>label){font-size:10.5px}
#editor .format-hint,#editor .field-advisory{font-size:10px;line-height:1.35}
#editor button{font-size:11px;min-height:26px;padding:4px 6px}
#editor .dialoghead>button{font-size:18px;min-height:24px;padding:0 4px}
#editor .dialog-actions{padding-top:6px;gap:6px}
#editor.account-dialog{width:min(480px,calc(100vw - 40px))}
#editor:has(#client-summary){width:min(900px,calc(100vw - 40px));max-height:calc(100dvh - 40px)}
#client-summary>h2{font-size:13px;text-align:center;margin:0 0 10px}
#client-summary .summary-section{margin:8px 0}
#client-summary .summary-section>h3{font-size:11.7px;background:#edf4fc;color:#315a85;padding:4px 6px;border-bottom:1px solid #cbd9e8}
#client-summary .summary-record{margin:4px 0}
#client-summary .summary-record>h4{font-size:10.8px;margin:4px 0}
#client-summary .values{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border:0}
#client-summary .values>div{display:grid;grid-template-columns:minmax(90px,.85fr) minmax(0,1fr);grid-column:auto;min-width:0;border:0;border-bottom:1px solid #e3eaf3;padding:0}
#client-summary .values dt,#client-summary .values dd{font-size:10.5px;padding:4px 5px;min-width:0;margin:0;line-height:1.4;text-align:center;overflow-wrap:anywhere}
#client-summary .values dt{background:#f5f8fc}
#client-summary .values dd{background:white}
#client-summary .summary-files{width:100%;border-collapse:collapse;table-layout:fixed;font-size:10.5px}
#client-summary .summary-files :is(th,td){padding:4px 6px;border-bottom:1px solid #e3eaf3;overflow-wrap:anywhere;text-align:center;font-weight:normal}
#client-summary .summary-files th{background:#f5f8fc}
#client-summary .summary-files :is(th,td):nth-child(2){width:55%}
#editor .summary-actions{position:sticky;bottom:-8px;background:white;margin-top:8px;padding:6px 0}
@media print{
 @page{size:A4;margin:12mm}
 html:has(#client-summary),body:has(#client-summary){background:white!important;color:#172d36}
 body:has(#client-summary)>:not(#editor){display:none!important}
 #editor:has(#client-summary){position:static!important;inset:auto!important;transform:none!important;margin:0!important;display:block!important;width:100%!important;height:auto!important;max-width:none!important;max-height:none!important;overflow:visible!important;box-shadow:none;border:0;border-radius:0}
 #editor:has(#client-summary)::backdrop{display:none}
 #editor:has(#client-summary)>.dialoghead,#editor:has(#client-summary) .summary-actions{display:none!important}
 #editor:has(#client-summary) #dialog-body{padding:0!important;overflow:visible!important;max-height:none!important}
 #client-summary .summary-record,#client-summary .summary-files tr{break-inside:avoid}
 #client-summary :is(h2,h3,h4){break-after:avoid}
 #client-summary .summary-files thead{display:table-header-group}
 #client-summary{print-color-adjust:exact;-webkit-print-color-adjust:exact}
}

/* Four income entries stay balanced as two equal rows. */
#editor:has(#record-form[data-table=incomes] .form-grid>.field:nth-child(4):last-child){width:min(600px,calc(100vw - 40px))}
.record-fields[data-record-fields=incomes] .form-grid:has(>.field:nth-child(4):last-child)>.field{grid-column:span 6;border:0;padding:5px 8px}
.record-fields[data-record-fields=incomes] .form-grid:has(>.field:nth-child(4):last-child)>.field:nth-child(even){border-left:1px solid #e3eaf3}
.record-fields[data-record-fields=incomes] .form-grid:has(>.field:nth-child(4):last-child)>.field:nth-child(n+3){border-top:1px solid #e3eaf3}
#section-income .card>.values:has(>div:nth-child(4):last-child){grid-template-columns:repeat(2,minmax(0,1fr))}
#section-income .card>.values:has(>div:nth-child(4):last-child)>div{grid-column:auto}
.business-case-selector{display:flex;align-items:center;gap:8px;margin-top:7px;font-size:10.8px}
.business-case-selector select{min-width:170px;max-width:320px;font-size:10.8px;min-height:28px}
.business-case .case-actions>.row:empty{display:none}
