.cost-page{font-size:1rem;min-width:0}.cost-toolbar{display:flex;flex-wrap:wrap;gap:12px;align-items:end;margin:16px 0}.cost-toolbar label,.cost-form label{display:flex;flex-direction:column;gap:6px;font-size:.9rem;min-width:0}.cost-toolbar input,.cost-toolbar select,.cost-form input,.cost-form select,.cost-form textarea{font-size:1rem;min-width:0;width:100%;max-width:100%}.cost-toolbar label{min-width:160px}.cost-page .cost-note{color:var(--muted);font-size:.9rem;line-height:1.7;margin:10px 0}.cost-page .panel{margin-bottom:18px;min-width:0}.cost-page .panel-head{padding:16px 20px}.cost-page .panel-body{padding:18px 20px}.cost-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:18px 0}.cost-metrics article{border:1px solid var(--line);border-radius:12px;padding:18px;background:var(--panel,var(--surface,#fff));min-width:0}.cost-metrics strong{display:block;font-size:1.5rem;margin:8px 0;overflow-wrap:anywhere}.cost-metrics small{font-size:.875rem;color:var(--muted)}.cost-form{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.cost-form .cost-wide{grid-column:1/-1}.cost-form .actions{justify-content:flex-start}.cost-page .table-wrap{overflow:auto;max-width:100%}.cost-table{width:100%;border-collapse:collapse;font-size:.9rem}.cost-table th,.cost-table td{padding:12px;white-space:nowrap;border-bottom:1px solid var(--line);text-align:right}.cost-table th:first-child,.cost-table td:first-child{text-align:left}.cost-table th{background:var(--soft,#f5f6fa)}.cost-page details>summary{cursor:pointer;font-weight:650;padding:18px}.cost-page .cost-warning{padding:12px 16px;background:var(--soft,#f5f6fa);border-left:3px solid var(--accent,#7464e9);border-radius:6px;line-height:1.65}.cost-page .cost-chart{width:100%;height:150px}.cost-chart text{fill:var(--muted);font-size:12px}.cost-page .cost-error{color:var(--red,#c43c47)}.cost-tag{display:inline-block;font-size:.875rem;border:1px solid var(--line);padding:5px 9px;border-radius:6px}.cost-page button:disabled{opacity:.6;cursor:wait}@media(max-width:850px){.cost-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.cost-form{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:550px){.cost-form{grid-template-columns:1fr}.cost-toolbar{display:grid;grid-template-columns:1fr 1fr}.cost-toolbar label{min-width:0}.cost-metrics article{padding:12px}.cost-metrics strong{font-size:1.15rem}.cost-page .panel-body{padding:14px}.cost-page .cost-note{overflow-wrap:anywhere}.cost-toolbar button{grid-column:1/-1}}

.page-head:has(#cost-funding-input),.page-head:has(#cost-funding-input) .actions{flex-wrap:wrap;min-width:0}#cost-upload-status{font-size:.875rem;overflow-wrap:anywhere}

.cost-upload-date{display:flex;flex-direction:column;gap:4px;font-size:.875rem}.cost-upload-date input{font-size:1rem;min-width:0;max-width:100%}

.cost-month{border:1px solid var(--line);border-radius:10px;margin:12px 0;overflow:hidden}.cost-month>summary{display:flex;gap:16px;flex-wrap:wrap;align-items:center;background:var(--soft,#f5f6fa)}.cost-month>summary strong{font-size:1.1rem}.cost-month>summary span{font-size:.9rem}.cost-month>.cost-note{padding:0 14px}

.cost-entry-table{min-width:1050px}.cost-entry-table input[type=text]{width:130px;min-width:90px}.cost-entry-table select{max-width:145px}.cost-entry-table th[scope=row]{min-width:150px}#cost-batch-form .table-wrap{max-height:60vh;overflow:auto}#cost-batch-form{min-width:0}#cost-batch-form .actions{flex-wrap:wrap}

.modal.wide:has(#cost-batch-form){width:min(1400px,96vw);max-width:1400px}

/* Keep the upload action and settlement date on one shared control baseline. */
.page-head:has(#cost-funding-input){align-items:center;gap:16px}
.page-head:has(#cost-funding-input) .actions{align-items:center;gap:10px;max-width:100%}
.cost-upload-controls{display:flex;align-items:center;gap:10px;max-width:100%;min-width:0}
.page-head .cost-upload-controls>button{box-sizing:border-box;height:44px;min-height:44px;padding:0 14px;border-radius:9px;font-size:13px;line-height:1.2;white-space:nowrap;display:inline-flex;align-items:center;justify-content:center;gap:8px;flex:none}
.page-head .cost-upload-controls>button .icon{width:17px;height:17px;flex:none}
.page-head .cost-upload-date{box-sizing:border-box;display:flex;flex-direction:row;align-items:center;gap:12px;height:44px;min-height:44px;margin:0;padding:0 10px 0 12px;border:1px solid var(--line);border-radius:9px;background:var(--surface,#fff);min-width:0}
.page-head .cost-upload-date>span{font-size:12px;line-height:1.2;color:var(--muted);white-space:nowrap}
.page-head .cost-upload-date input{box-sizing:border-box;width:138px;min-width:0;height:42px;min-height:0;max-height:42px;margin:0;padding:0 2px;border:0;border-radius:0;background:transparent;font-size:14px;line-height:normal;box-shadow:none}
.page-head .cost-upload-date:focus-within{outline:2px solid var(--accent,#7464e9);outline-offset:2px}
#cost-upload-status:empty{display:none}
@media(max-width:600px){
 .page-head:has(#cost-funding-input){align-items:flex-start;gap:14px}
 .page-head:has(#cost-funding-input) .actions{width:100%;justify-content:flex-start}
 .cost-upload-controls{width:100%;flex-direction:column;align-items:stretch;gap:8px}
 .page-head .cost-upload-controls>button,.page-head .cost-upload-date{width:100%}
 .page-head .cost-upload-date{justify-content:space-between}
 .page-head .cost-upload-date input{width:145px;max-width:50%}
}

.cost-page .cost-month-head{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.cost-page .cost-month-head h2{flex:1 1 auto;margin:0}
.cost-page .cost-month-head>button{margin-left:auto;white-space:nowrap}
.cost-confirm-inline{scroll-margin-top:84px}
.cost-confirm-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin-bottom:14px}
.cost-confirm-toolbar>label{display:inline-flex;align-items:center;gap:10px;font-size:14px;font-weight:600}
.cost-confirm-toolbar input{height:40px;box-sizing:border-box;min-width:145px}
.cost-confirm-toolbar>.muted{font-size:13px}
#cost-inline-confirmation #cost-batch-form .table-wrap{max-height:420px}
.cost-confirm-inline .cost-entry-table thead{position:sticky;top:0;z-index:2}
.cost-confirm-inline .cost-entry-table input[type=text]{box-sizing:border-box;height:38px;font-size:14px;text-align:right}
.cost-confirm-inline .cost-entry-table input[data-cost-cell=memo]{text-align:left}
#cost-batch-form .cost-confirm-actions{justify-content:flex-end;gap:10px;margin-top:14px}
.cost-confirm-actions [role=status]{flex-basis:100%;color:var(--muted);font-size:13px}
.cost-confirm-actions [role=status]:empty{display:none}
@media(max-width:600px){.cost-page .cost-month-head h2{flex-basis:100%}.cost-confirm-toolbar{align-items:flex-start}.cost-confirm-toolbar>.muted{flex-basis:100%}}

.cost-confirm-toolbar>label{white-space:nowrap;flex:none}
.cost-confirm-toolbar input{width:160px;flex:none}
.cost-confirm-inline .cost-entry-table th[scope=row]{font-size:13px;line-height:1.45;font-weight:600;text-align:left;white-space:normal;min-width:140px;max-width:170px}

.cost-confirm-inline select[data-cost-cell=recognition]{width:120px;min-width:120px;max-width:130px}
