.fp-menu [data-add-action=history]{border-top:1px solid #dce7ed;margin-top:8px;padding-top:16px;color:#087960}
.history-dialog,.hist-edit-dialog{box-sizing:border-box;width:min(1080px,calc(100vw - 32px));max-height:calc(100dvh - 32px);padding:24px;border:1px solid #d2e0e8;border-radius:16px;background:#fff;color:#183746;overflow:auto;overscroll-behavior:contain;font:14px/20px Inter,'Segoe UI',Arial,sans-serif;box-shadow:0 16px 64px #173e3526}
.history-dialog::backdrop,.hist-edit-dialog::backdrop{background:#18374666;backdrop-filter:blur(3px)}
.history-dialog [hidden],.hist-edit-dialog [hidden]{display:none!important}
.hist-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:24px}
.hist-heading h2{margin:0;font-size:20px;line-height:28px;font-weight:650}
.hist-heading p{margin:8px 0 0;font-size:12px;line-height:20px}
.hist-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;min-height:44px;min-width:44px;margin:0;padding:12px;border:0;border-radius:8px;background:transparent;color:#54758b;cursor:pointer}
.hist-icon svg{display:block;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7}
.hist-icon:hover{background:#edf8f7;color:#087960}
.hist-icon:disabled{opacity:.4;cursor:default}
.hist-period{display:flex;align-items:center;gap:8px;margin-bottom:24px;flex-wrap:wrap}
.hist-period>span:first-child{margin-right:8px;font-size:13px}
.hist-period .hist-month{min-width:80px;min-height:44px}
.hist-history-range{margin-left:auto;color:#60778a;font-size:12px}
.hist-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start;gap:32px;min-width:0}
.hist-selection,.hist-preview{min-width:0}
.hist-kind-filters{display:flex;align-items:center;gap:8px;min-height:44px;margin-bottom:16px}
.hist-tab{font:inherit;font-size:13px;border:0;min-height:44px;padding:8px 12px;border-radius:8px;background:transparent;color:#54758b;cursor:pointer}
.hist-tab[aria-pressed=true]{background:#eaf7f5;color:#087960}
.hist-select-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:44px;padding-bottom:8px;border-bottom:1px solid #e3ecef}
.hist-master{display:flex!important;align-items:center;gap:12px!important;margin:0!important;min-height:44px;font-size:13px!important;cursor:pointer;flex:1}
.history-dialog input[type=checkbox]{width:18px;height:18px;min-width:18px;min-height:18px;padding:0;margin:0;flex:0 0 18px;accent-color:#087960;cursor:pointer}
.hist-select-bar .text-button{min-height:44px;padding:8px 0;font-size:12px;line-height:20px;text-align:right}
.hist-category-row{display:flex;align-items:center;gap:4px;padding:8px 0 8px calc(var(--depth)*20px);border-bottom:1px solid #e3ecef;min-width:0}
.hist-category-row:last-child{border-bottom:0}
.hist-average-caption{margin:8px 0 0;text-align:right;color:#60778a;font-size:11px;line-height:16px}
.hist-category-label{display:flex!important;flex:1;align-items:center;gap:12px!important;min-height:48px;margin:0!important;font-size:13px!important;min-width:0;cursor:pointer}
.hist-category-copy{flex:1;min-width:0}
.hist-category-copy b{display:block;font-size:13px;line-height:20px;font-weight:600;overflow-wrap:anywhere}
.hist-category-copy small{display:block;font-size:11px;line-height:16px;margin-top:4px}
.hist-money{font-variant-numeric:tabular-nums;white-space:nowrap;font-size:13px;line-height:20px;font-weight:600}
.hist-category-label>strong{font-size:12px;font-weight:500;margin-left:auto;text-align:right;align-self:center}
.hist-tree-toggle svg{transition:transform .12s}
.hist-tree-toggle[aria-expanded=true] svg{transform:rotate(180deg)}
.hist-preview-heading{display:flex;align-items:baseline;justify-content:space-between;gap:16px;min-height:44px;box-sizing:border-box;padding:12px 0;margin-bottom:16px}
.hist-preview-heading h3{margin:0;font-size:14px;line-height:20px}
.hist-preview-heading>span{font-size:12px}
.hist-totals{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:16px;padding:12px 16px;background:#f2f8f7;border-radius:8px}
.hist-totals>div{display:grid;gap:4px;min-width:0}
.hist-totals small{font-size:11px;line-height:16px}
.hist-totals strong{font-size:18px;line-height:24px}
.hist-proposal-row{display:flex;align-items:center;gap:12px;min-height:56px;padding:8px 0;border-bottom:1px solid #e3ecef}
.hist-proposal-row:last-child{border-bottom:0}
.hist-proposal-row>div{flex:1;min-width:0}
.hist-proposal-row>div>span{display:block;font-size:13px;line-height:20px;overflow-wrap:anywhere}
.hist-proposal-row small{display:block;font-size:11px;line-height:16px;margin-top:4px}
.hist-proposal-row>strong{margin-left:auto;text-align:right}
.hist-proposal-row[data-proposal-kind=income]>strong{color:#087960}
.hist-preview-empty{display:flex;align-items:center;justify-content:center;min-height:240px;margin:0;padding:24px;color:#60778a;border:1px dashed #d2e0e8;border-radius:8px;text-align:center;font-size:13px;line-height:20px}
.hist-pagination{display:flex;align-items:center;justify-content:center;gap:16px;margin-top:8px;font-size:12px;color:#60778a;min-height:44px}
.hist-pagination:empty{display:none}
.hist-summary{min-height:20px;margin:16px 0 0;color:#60778a;font-size:12px;line-height:20px}
.hist-method{margin:16px 0 0;padding-top:8px;border-top:1px solid #e3ecef;font-size:12px;line-height:20px}
.hist-method>summary{min-height:44px;display:flex;align-items:center;color:#087960;cursor:pointer}
.hist-method p{margin:8px 0}
.hist-footer{position:sticky;bottom:-24px;display:flex;align-items:center;justify-content:space-between;gap:24px;margin-top:16px;padding:16px 0 24px;background:#fff;border-top:1px solid #e3ecef;z-index:2}
.hist-footer>span{max-width:460px;font-size:12px;line-height:20px}
.hist-footer-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}
.hist-footer-actions>.button,.hist-edit-actions>.button{min-height:44px;font-size:13px;white-space:nowrap}
.hist-footer .button:disabled{opacity:.5;cursor:default}
.hist-edit-dialog{width:min(560px,calc(100vw - 24px))}
.hist-edit-fields{display:grid;gap:24px}
.hist-edit-fields>label{display:grid;gap:8px;margin:0;font-size:13px;line-height:20px}
.hist-edit-fields input{height:44px;min-height:44px;width:100%;box-sizing:border-box;padding:10px 12px;border:1px solid #bfd2de;border-radius:8px;font:14px/20px Inter,'Segoe UI',Arial,sans-serif}
.hist-edit-fields .gc-date-control{width:100%;min-width:0}
.hist-edit-actions{display:flex;justify-content:flex-end;gap:8px;padding-top:24px}
.hist-edit-error{margin:16px 0 0;color:#a13e32;font-size:12px;line-height:20px}
.hist-receipt{display:flex;align-items:center;gap:8px 16px;flex-wrap:wrap;margin:0 16px 16px;padding:8px 12px;background:#edf8f7;border-radius:8px;color:#087960;font-size:12px;line-height:20px}
.hist-receipt .text-button{min-height:44px;padding:8px 0;font-size:12px}
.history-dialog :is(button,input):focus-visible,.hist-edit-dialog :is(button,input):focus-visible{outline:3px solid #159f9a;outline-offset:3px}
@media(max-width:800px){.hist-grid{grid-template-columns:minmax(0,1fr);gap:24px}.hist-history-range{width:100%;margin-left:0}.history-dialog{padding:20px 16px;width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}.hist-footer{bottom:-20px;padding-bottom:20px;align-items:stretch;gap:16px;flex-direction:column}.hist-footer-actions{justify-content:flex-end}.hist-heading h2{font-size:18px;line-height:24px}.hist-category-row{padding-left:calc(var(--depth)*16px)}.hist-category-copy small{font-size:11px}.hist-select-bar{gap:8px}.hist-proposal-row{gap:8px}.hist-preview-empty{min-height:100px}.hist-preview-heading{margin-bottom:8px}.hist-period{gap:8px}.hist-period>span:first-child{width:100%;margin:0}.hist-period>.hist-month{flex:1;min-width:60px}.history-preview-bar .ov-samples{width:auto;margin-left:auto}.history-preview-bar .ov-preview-label{flex-basis:100%}}
@media(prefers-reduced-motion:reduce){.hist-tree-toggle svg{transition:none}}


.hist-month{border:1px solid #bfd2de;border-radius:8px;background:#fff;color:#54758b;padding:8px 12px;font:inherit;cursor:pointer}.hist-month[aria-pressed=true]{background:#eaf7f5;color:#087960;border-color:#087960}.hist-notice-slot{min-height:36px}.hist-notice{margin:0;font-size:13px;line-height:20px}.history-dialog[data-saving=true]>.hist-heading button{visibility:hidden}
