/* Финансы владельца: текущие остатки и автоматическая история. */
.fn-view{font-size:14px}.fn-view *,.fn-drawer *{box-sizing:border-box}.fn-scroll{overflow:auto;overscroll-behavior:contain;padding:34px clamp(18px,4vw,64px) 44px;scrollbar-gutter:stable}.fn-scroll>section,.fn-scroll>details{margin:0 0 26px}.fn-top{display:flex;justify-content:space-between;align-items:center;gap:24px;margin-bottom:28px}.fn-top h1{font-size:30px;line-height:1.2;letter-spacing:-1px;margin:5px 0 10px}.fn-eyebrow{color:var(--muted);font-size:12px;font-weight:700;margin:0}.fn-sub,.fn-section-head p,.fn-final p,.fn-connection p{color:var(--muted);line-height:1.6;margin:6px 0 0}.fn-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.fn-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;min-width:44px;padding:10px 14px;font:inherit;font-weight:700;border:0!important;border-radius:12px;background:rgba(var(--ov),.025)!important;color:var(--text);cursor:pointer;line-height:1.4;max-width:100%;overflow-wrap:anywhere}.fn-btn:hover{background:rgba(var(--ov),.07)!important}.fn-btn.fn-primary{background:var(--accent)!important;color:var(--on-accent)}.fn-btn:disabled{opacity:.45;cursor:default}.fn-btn.fn-selected{background:rgba(var(--acc),.15)!important;color:var(--afg)}.fn-btn.fn-danger,.fn-negative,.fn-error{color:var(--danger-fg)}.fn-positive{color:var(--teal)}.fn-btn svg{flex-shrink:0}.fn-view button:focus-visible,.fn-drawer button:focus-visible,.fn-drawer input:focus-visible,.fn-view summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.fn-summary{display:grid;grid-template-columns:1fr 1.5fr;gap:34px;padding:30px;border:0;border-radius:20px;background:rgba(var(--acc),.055)}.fn-balance{display:flex;flex-direction:column;gap:10px}.fn-balance>strong{font-size:clamp(28px,3.3vw,46px);line-height:1.15;letter-spacing:-1.5px;font-weight:800;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.fn-status{font-size:13px;font-weight:700}.fn-balance small,.fn-change small{color:var(--muted);font-size:12px;line-height:1.6}.fn-changes{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:22px;align-content:center}.fn-change{display:flex;flex-direction:column;gap:10px}.fn-change>span{color:var(--muted);font-size:13px}.fn-change strong{font-size:18px;font-variant-numeric:tabular-nums;line-height:1.4;overflow-wrap:anywhere}.fn-panel{background:rgba(var(--ov),.025);border:0;border-radius:18px;padding:24px}.fn-section-head{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:20px}.fn-section-head h2,.fn-final h2{font-size:18px;letter-spacing:-.3px;margin:0}.fn-section-head p{font-size:12px;max-width:620px}
.fn-chart{display:block;width:100%;height:auto;max-height:260px;margin:10px 0 20px;overflow:visible}.fn-line{fill:none;stroke:var(--accent);stroke-width:3;stroke-linecap:round;stroke-linejoin:round}.fn-grid{stroke:var(--line2)}.fn-point{fill:var(--accent);stroke:var(--bg);stroke-width:2}.fn-chart text{fill:var(--muted);font:12px Orb,sans-serif}.fn-chart-empty{display:flex;align-items:center;justify-content:center;text-align:center;color:var(--muted);line-height:1.7;min-height:180px;padding:32px}.fn-view summary{min-height:44px;cursor:pointer;align-content:center;color:var(--muted);font-weight:600}.fn-table-wrap{overflow-x:auto}.fn-history{width:100%;border-collapse:collapse;text-align:left;font-variant-numeric:tabular-nums}.fn-history th,.fn-history td{padding:14px 12px;font-weight:500;vertical-align:top}.fn-history thead{color:var(--muted);font-size:12px}.fn-history-item{display:flex;gap:16px;justify-content:space-between;padding:8px 0}
.fn-filters{display:flex;gap:6px;flex-wrap:wrap}.fn-accounts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.fn-account{background:var(--card);border:0;border-radius:16px;padding:20px;min-width:0}.fn-account-head{display:flex;justify-content:space-between;gap:8px;align-items:center;flex-wrap:wrap}.fn-bank{font-size:13px;font-weight:800}.fn-tag{padding:5px 8px;border-radius:7px;background:rgba(var(--ov),.04);font-size:11px;color:var(--muted)}.fn-account h3{font-size:14px;margin:18px 0 10px;font-weight:600;overflow-wrap:anywhere}.fn-account-amount{font-size:23px;font-weight:800;letter-spacing:-.6px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.fn-account .fn-sub{font-size:12px;min-height:38px}.fn-freshness{font-size:12px;line-height:1.6;color:var(--muted);margin:18px 0}.fn-account .fn-btn{font-size:12px;padding:10px}.fn-account .fn-actions{align-items:stretch}.fn-final{display:flex;align-items:center;justify-content:space-between;gap:24px}.fn-final p{font-size:13px;max-width:730px}.fn-final>.fn-btn{flex-shrink:0}.fn-connections{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}.fn-connection{min-width:0;display:flex;flex-direction:column;gap:18px;padding:18px;border:0;border-radius:14px;background:var(--card)}.fn-connection h3{font-size:15px;margin:0}.fn-connection small{display:block;color:var(--muted);font-size:12px;margin-top:8px;line-height:1.5}.fn-connection .fn-actions{margin-top:auto}.fn-connection .fn-btn{font-size:12px}.fn-archived{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:10px 0}.fn-alert{padding:14px 18px;border:0;border-radius:12px;line-height:1.6;color:var(--danger-fg)}
.fn-drawer{width:min(520px,100%);padding:0!important;z-index:48}.fn-scrim{z-index:47}.fn-dhead{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 22px;flex-shrink:0}.fn-dhead h2{font-size:18px;margin:0}.fn-drawer form{display:flex;flex:1;flex-direction:column;min-height:0;overflow:hidden}.fn-dbody{overflow:auto;overscroll-behavior:contain;padding:24px;flex:1;min-height:0}.fn-field{display:flex;flex-direction:column;gap:8px;margin:0 0 22px;font-weight:600;font-size:13px}.fn-field input{min-height:48px;width:100%;border:0;background:var(--field);color:var(--text);border-radius:12px;font:inherit;font-size:16px;padding:12px}.fn-field .fn-btn{justify-content:space-between;background:var(--field)!important;font-size:16px}.fn-check{display:flex;gap:12px;align-items:center;min-height:44px;font-size:14px;line-height:1.6;margin:18px 0}.fn-check input{width:22px;height:22px;accent-color:var(--accent);flex-shrink:0}.fn-dfoot{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:10px;padding:18px 24px;flex-shrink:0}.fn-error{line-height:1.6;font-size:13px;white-space:pre-line}.fn-file{position:relative;display:flex;align-items:center;min-height:48px;border:0;background:var(--field);border-radius:12px;padding:12px;cursor:pointer}.fn-file>span{display:flex;align-items:center;gap:10px}.fn-file input{position:absolute;inset:0;width:100%;opacity:0;cursor:pointer}.fn-file:focus-within{outline:2px solid var(--accent);outline-offset:3px}.fn-ocr{margin-top:28px}.fn-ocr .fn-sub{font-size:12px}.fn-ocr [data-fin-preview]{margin-top:16px;display:flex;flex-direction:column;gap:8px;line-height:1.6}.fn-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
@media(max-width:1200px){.fn-accounts{grid-template-columns:repeat(2,minmax(0,1fr))}.fn-summary{grid-template-columns:1fr;gap:26px}.fn-changes{padding-top:24px}}
@media(max-width:900px){.fn-scroll{padding:22px 16px 30px}.fn-top{align-items:flex-start;flex-direction:column;gap:18px}.fn-top h1{font-size:27px}.fn-summary{padding:22px;gap:22px}.fn-changes{gap:12px}.fn-change strong{font-size:15px}.fn-change small{font-size:11px}.fn-panel{padding:18px}.fn-section-head{align-items:flex-start;flex-wrap:wrap}.fn-accounts{gap:12px}.fn-account{padding:16px}.fn-account-amount{font-size:21px}.fn-final{align-items:flex-start;flex-direction:column;gap:16px}.fn-final>.fn-btn{width:100%}.fn-connections{grid-template-columns:1fr;gap:14px}.fn-drawer{top:var(--mini-safe-top,var(--shell-safe-top,0px));bottom:calc(var(--mini-bottom,0px) + var(--tabbar));height:auto;max-height:none;border-radius:18px 18px 0 0}.fn-dhead{padding:14px 18px}.fn-dbody{padding:20px}.fn-dfoot{padding:14px 20px max(14px,env(safe-area-inset-bottom))}.fn-drawer .fn-dfoot .fn-btn{flex:1}.fn-history th,.fn-history td{padding:12px 6px;font-size:12px}.fn-view .fn-account .fn-actions{display:flex;flex-wrap:nowrap}.fn-account .fn-btn:first-child{flex:1;min-width:0}.fn-account .fn-btn:last-child{flex-shrink:0}}
@media(max-width:540px){.fn-accounts{grid-template-columns:1fr}.fn-account .fn-sub{min-height:0}.fn-account h3{margin-top:14px}.fn-chart{min-height:120px}.fn-changes{grid-template-columns:1fr}.fn-change{display:grid;grid-template-columns:100px 1fr;gap:6px 12px}.fn-change small{grid-column:2}.fn-change strong{font-size:17px}.fn-top>.fn-actions{width:100%}.fn-top>.fn-actions .fn-btn{flex:1;font-size:12px}.fn-history-item{flex-direction:column;gap:4px}.fn-bank{font-size:14px}.fn-account-amount{font-size:27px}}
.fn-drawer:not(.on){visibility:hidden;pointer-events:none}

.fn-periods{display:flex;flex-wrap:wrap;gap:8px}.fn-history-state{margin:0;line-height:1.6;color:var(--muted)}.fn-history-item small{display:block;color:var(--muted);font-size:12px;line-height:1.6}.fn-history th:first-child{white-space:nowrap}.fn-history td:nth-child(2){overflow-wrap:anywhere}
