.primary-nav{display:flex;align-items:center;gap:4px;margin-left:auto;margin-right:16px}.primary-nav a{min-height:40px;display:flex;align-items:center;padding:0 10px;border-radius:10px;color:var(--muted);text-decoration:none;font-size:12px;font-weight:700}.primary-nav a:hover,.primary-nav a:focus-visible{background:var(--blue-soft);color:var(--navy)}

.admin-nav{display:flex;gap:6px;overflow-x:auto;padding:7px;margin-bottom:26px;border:1px solid var(--line);border-radius:15px;background:var(--surface)}.admin-nav a{flex:0 0 auto;min-height:42px;display:flex;align-items:center;padding:0 13px;border-radius:10px;color:var(--muted);font-size:12px;font-weight:700;text-decoration:none}.admin-nav a:hover,.admin-nav a.active{background:var(--navy);color:var(--action-text)}

.metric-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:22px 0 34px}.metric-grid article,.admin-card{border:1px solid var(--line);border-radius:var(--radius-md);background:var(--surface);box-shadow:var(--shadow-sm)}.metric-grid article{padding:19px}.metric-grid span,.metric-grid strong{display:block}.metric-grid span{color:var(--muted);font-size:12px}.metric-grid strong{margin-top:8px;color:var(--navy);font:750 29px/1.1 Manrope,sans-serif}.admin-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}.admin-links a{display:flex;flex-direction:column;gap:6px;padding:19px;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--navy);font-weight:750;text-decoration:none;transition:border-color .15s,transform .15s,box-shadow .15s}.admin-links a span{color:var(--muted);font-size:13px;font-weight:500}.admin-links a:hover{transform:translateY(-2px);border-color:var(--border-strong);box-shadow:var(--shadow-md)}

.admin-card{margin:0 0 21px;padding:clamp(17px,3vw,26px)}.admin-card h2{margin-bottom:17px}.admin-form{display:flex;flex-wrap:wrap;align-items:end;gap:12px}.admin-form label,.inline-admin-form label,.import-confirm label{display:flex;flex-direction:column;gap:6px;min-width:155px;color:var(--ink);font-size:12px;font-weight:700}.admin-form input,.admin-form select,.site-row input,.site-row select,.inline-admin-form input,.inline-admin-form select,.review-form input,.review-form select,.resolve-form select,.import-confirm input{min-height:44px;padding:9px 11px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);font:inherit}.admin-form input:focus,.admin-form select:focus,.site-row input:focus,.inline-admin-form input:focus,.inline-admin-form select:focus,.resolve-form select:focus,.import-confirm input:focus{outline:0;border-color:var(--blue);box-shadow:var(--focus)}.helper{margin:13px 0 0;color:var(--muted);font-size:13px}.admin-table-wrap{width:100%;overflow:auto}.admin-table{width:100%;border-collapse:collapse;font-size:13px}.admin-table th,.admin-table td{padding:11px 9px;border-bottom:1px solid var(--line);text-align:left;vertical-align:middle}.admin-table th{color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.07em}.inline-admin-form{display:flex;gap:7px;align-items:center;min-width:420px}.check-label{display:inline-flex;align-items:center;gap:7px;color:var(--muted);font-size:12px;white-space:nowrap}.check-label input{width:18px;height:18px;accent-color:var(--navy)}.site-row{display:grid;grid-template-columns:1fr 1fr auto auto;gap:9px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line)}.two-column{display:grid;grid-template-columns:1fr 1fr;gap:15px}.category-list{list-style:none;padding:0;margin:16px 0 0}.category-list li{padding:10px 0;border-bottom:1px solid var(--line);font-weight:650}.category-list li span{float:right;color:var(--muted);font-size:12px}.status-tabs{display:flex;gap:8px;margin:0 0 15px}.status-tabs a{padding:10px 14px;border-radius:10px;background:var(--surface);border:1px solid var(--line);color:var(--navy);text-decoration:none;font-size:13px;font-weight:700}.review-row{display:flex;justify-content:space-between;gap:16px;padding:17px 0;border-bottom:1px solid var(--line)}.review-row p{margin:7px 0;color:var(--muted)}.review-row small{color:var(--muted)}.review-form{display:flex;align-items:center;gap:7px;min-width:360px}.review-form input{flex:1;min-width:110px}.balance-banner{display:flex;justify-content:space-between;align-items:center;margin:18px 0;padding:15px 17px;border:1px solid #dbe6b1;border-radius:13px;background:linear-gradient(100deg,var(--accent-soft),var(--surface));color:var(--navy)}.balance-banner strong{font:750 22px Manrope,sans-serif}.ledger-entry{margin-top:13px}.import-row-list{display:grid;gap:9px;margin-top:17px}.import-row{display:flex;justify-content:space-between;gap:14px;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--surface-soft)}.import-row>div{min-width:0}.import-row p{margin:7px 0 4px;color:var(--muted);font-size:13px}.import-row small{color:var(--ink)}.pill{margin-left:8px;padding:4px 8px;border-radius:999px;background:var(--lime-soft);color:var(--navy);font-size:10px;font-weight:800}.warning-text{color:var(--warning-text);font-weight:650}.resolve-form{display:grid;grid-template-columns:160px 160px auto;gap:7px;align-items:center}.resolve-form select{max-width:180px;font-size:12px}.import-confirm{display:flex;justify-content:space-between;align-items:end;gap:18px;margin-top:19px;padding:17px;border-radius:14px;background:var(--surface-muted)}.import-confirm form{display:flex;align-items:end;gap:9px}.import-confirm label{min-width:220px}.purpose-field{display:grid;grid-template-columns:minmax(170px,.7fr) 1.3fr;gap:13px;margin:0;padding:15px;border:1px solid var(--line);border-radius:14px}.purpose-field legend{padding:0 8px;color:var(--navy);font-weight:750}.purpose-field label{display:flex;flex-direction:column;gap:8px}.purpose-field input,.purpose-field textarea,.purpose-field select,.form-stack select{width:100%;min-height:48px;padding:11px 13px;border:1px solid var(--line);border-radius:11px;background:var(--surface);color:var(--ink)}

@media(max-width:760px){.primary-nav{display:none}.metric-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.metric-grid article{padding:14px}.admin-links,.two-column{grid-template-columns:1fr}.site-row{grid-template-columns:1fr 1fr}.site-row .check-label{grid-column:1}.review-row{flex-direction:column}.review-form{min-width:0;flex-wrap:wrap}.review-form>*{flex:1}.import-row{flex-direction:column}.resolve-form{grid-template-columns:1fr}.resolve-form select{max-width:none}.import-confirm,.import-confirm form{align-items:stretch;flex-direction:column}.admin-form label{flex:1 1 100%}.admin-form .button{width:100%}.purpose-field{grid-template-columns:1fr}.admin-card{padding:16px}.admin-nav{margin-left:-2px;margin-right:-2px}.import-row{overflow:hidden}.admin-table{min-width:720px}}



.account-list,.archive-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,330px),1fr));gap:14px}

.account-card,.archive-card{min-width:0;padding:18px;border:1px solid var(--line);border-radius:15px;background:var(--surface);color:var(--ink);box-shadow:var(--shadow-soft)}

.account-card-main{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;align-items:center}.account-card-main h2,.archive-card h2{margin:0;font-size:18px}.account-card-main p,.archive-card p{margin:4px 0;color:var(--muted)}.account-card-main small{grid-column:1/-1;color:var(--muted)}

.role-tag{justify-self:start;padding:4px 8px;border:1px solid var(--line);border-radius:999px;color:var(--ink);font-size:11px;font-weight:750}.account-active{background:var(--success-bg);color:var(--success-text)}.account-inactive,.account-archived{background:var(--surface-alt);color:var(--muted)}

.account-actions{margin-top:14px;border-top:1px solid var(--line);padding-top:12px}.account-actions summary,.ledger-reversal summary{cursor:pointer;color:var(--link);font-weight:700}.account-action-panels{display:grid;gap:12px;margin-top:12px}.account-action-panels>.admin-form,.archive-form{align-items:end;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--surface-alt)}.archive-card{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}.archive-card form{flex:0 0 auto}.archive-card .eyebrow{color:var(--muted);font-size:10px;font-weight:800;letter-spacing:.08em}.audit-values{max-width:100%;overflow:auto;padding:13px;border:1px solid var(--line);border-radius:10px;background:var(--surface-alt);color:var(--ink);white-space:pre-wrap;overflow-wrap:anywhere}.audit-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.audit-detail-grid>div{padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--surface-alt)}.audit-detail-grid dt{color:var(--muted);font-size:11px;font-weight:800;text-transform:uppercase}.audit-detail-grid dd{margin:5px 0 0;overflow-wrap:anywhere}.ledger-reversal form{display:grid;gap:8px;min-width:180px;padding:10px}.ledger-reversal label{display:grid;gap:5px;color:var(--muted);font-size:11px}.ledger-reversal input{min-height:38px;max-width:220px;padding:8px;border:1px solid var(--line);border-radius:8px;background:var(--input-bg);color:var(--ink)}

@media(max-width:760px){.account-list,.archive-list{grid-template-columns:1fr}.account-card,.archive-card{padding:15px}.archive-card{flex-direction:column}.archive-card form,.archive-card form button{width:100%}.audit-detail-grid{grid-template-columns:1fr}.account-action-panels>.admin-form{display:grid}.account-action-panels>.admin-form label{min-width:0}}

.report-filter label{flex:1 1 150px}.report-filter .button{flex:0 0 auto}.report-groups{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px}.report-groups .admin-card{min-width:0}.total-line{display:flex;justify-content:space-between;gap:8px;padding:9px 0;margin:0;border-bottom:1px solid var(--line);font-size:13px}.total-line span{overflow-wrap:anywhere;color:var(--muted)}.total-line strong{white-space:nowrap;color:var(--navy)}.metric-date{font-size:21px!important}.admin-card h2 .muted{font:500 12px 'DM Sans',sans-serif;letter-spacing:0}

.admin-expenses-toolbar{display:block}.filter-bar.admin-expense-filters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-items:end;width:100%;gap:12px}.admin-expense-filters label{min-width:0;width:100%;font-size:12px}.admin-expense-filters .button{width:100%}

.two-column,.two-column>.admin-card,.category-manage{min-width:0;max-width:100%}.category-manage form{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:7px;padding:8px 0;border-bottom:1px solid var(--line)}.category-manage input:not([type=checkbox]){min-width:0;width:100%;min-height:42px;padding:8px 10px;border:1px solid var(--line);border-radius:9px;color:var(--ink);font:inherit}

.raw-source{margin-top:9px;color:var(--blue);font-size:12px}.raw-source summary{cursor:pointer;font-weight:700}.raw-source pre{max-width:70vw;overflow:auto;padding:10px;border-radius:9px;background:var(--surface-muted);color:var(--ink);font:11px/1.5 Consolas,monospace;white-space:pre-wrap}

@media(max-width:760px){.report-groups{grid-template-columns:1fr}.report-filter label{flex-basis:100%}}

@media(max-width:1050px){.filter-bar.admin-expense-filters{grid-template-columns:repeat(3,minmax(0,1fr))}}

@media(max-width:620px){.filter-bar.admin-expense-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.filter-bar.admin-expense-filters label:nth-of-type(3){grid-column:1/-1}}

@media(prefers-reduced-motion:reduce){.admin-links a{transition:none}}

/* Shared frozen header: identity/tools on the first line, primary links beneath. */
.site-header{position:sticky;top:0;z-index:1000;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto;align-items:center;gap:0 16px;overflow:visible;padding-block:7px;background:var(--surface);box-shadow:0 2px 12px rgb(24 38 54 / .06)}
.site-header>.brand{grid-column:1;grid-row:1;min-height:48px}
.site-header>.header-tools{grid-column:2;grid-row:1;min-width:0}
.site-header>.primary-nav{grid-column:1/-1;grid-row:2;display:flex;justify-content:flex-start;flex-wrap:wrap;gap:3px;margin:3px 0 0;padding-top:5px;border-top:1px solid var(--line);white-space:normal}
.primary-nav{overflow:visible}
.nav-group[open],.nav-group:focus-within{z-index:80}
.nav-popover{right:auto;left:0;max-width:min(280px,calc(100vw - 24px));max-height:min(70vh,520px);overflow:auto;overscroll-behavior:contain}
.overview-metrics{position:relative;z-index:1}
.metric-period{z-index:auto}
.metric-period[open]{grid-column:auto;z-index:120}
.metric-period[open]>summary{min-height:100%;padding:19px;border:0}
.metric-period[open]>summary::after{display:block}
.period-picker{position:absolute;z-index:140;top:calc(100% + 8px);right:0;width:min(410px,calc(100vw - 32px));max-height:min(76vh,620px);overflow:auto;align-items:end;flex-direction:row;flex-wrap:wrap;padding:16px;border:1px solid var(--line);border-radius:14px;background:var(--surface);box-shadow:var(--shadow-md)}
.period-picker label{flex:1 1 170px;min-width:0}
.period-picker .period-range{flex:1 1 100%}
.period-picker .period-actions{flex:1 1 100%}
.page-heading-row.register-heading{position:relative;z-index:auto;align-items:center;gap:14px}
.register-heading-actions{position:relative;z-index:100;display:flex;flex:0 0 auto;align-items:center;justify-content:flex-end;gap:8px;min-width:0}
.compact-filter-popover{position:relative;z-index:auto;min-width:0}
.compact-filter-popover>summary{min-height:44px;display:flex;align-items:center;gap:8px;padding:6px 10px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);font-size:12px;font-weight:750;cursor:pointer;list-style:none;white-space:nowrap}
.compact-filter-popover>summary::-webkit-details-marker{display:none}
.compact-filter-popover>summary:focus-visible{outline:0;box-shadow:var(--focus)}
.compact-filter-popover>summary:hover{background:var(--surface-soft)}
.filter-count{min-width:22px;height:22px;display:grid;place-items:center;padding:0 5px;border-radius:999px;background:var(--action-bg);color:var(--action-text);font-size:11px}
.compact-filter-popover>summary small{color:var(--muted);font-size:10px;font-weight:600}
.compact-filter-popover[open]{z-index:130}
.compact-filter-popover>.master-filter,.compact-filter-popover>.admin-expense-filters{position:absolute;z-index:150;top:calc(100% + 8px);right:0;width:min(920px,calc(100vw - 32px));max-height:min(78vh,700px);overflow:auto;overscroll-behavior:contain;padding:16px;border:1px solid var(--line);border-radius:14px;background:var(--surface);box-shadow:var(--shadow-md)}
.compact-filter-popover>.admin-expense-filters{grid-template-columns:repeat(3,minmax(0,1fr));align-items:end}
.compact-filter-popover>.admin-expense-filters label{min-width:0;width:auto}
.compact-filter-popover>.admin-expense-filters .button{width:auto}
.admin-expense-filters input,.admin-expense-filters select,.master-filter input,.master-filter select{background:var(--input-bg);color:var(--ink)}
.back-to-top{position:fixed;right:max(12px,calc((100vw - 1160px)/2 - 52px));bottom:max(16px,env(safe-area-inset-bottom));z-index:900;width:46px;height:46px;display:grid;place-items:center;border:1px solid var(--line);border-radius:50%;background:var(--action-bg);color:var(--action-text);box-shadow:var(--shadow-md);cursor:pointer}
.back-to-top[hidden]{display:none}
.back-to-top:hover{filter:brightness(.94)}
.back-to-top:focus-visible{outline:0;box-shadow:var(--focus)}
.back-to-top svg{width:20px;height:20px}
.admin-bill-upload{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px}
@media(max-width:850px){.site-header>.primary-nav{display:none}.site-header>.header-tools{grid-column:2;grid-row:1}.site-header>.brand{grid-column:1;grid-row:1}.register-heading-actions{flex-wrap:wrap}.compact-filter-popover>.admin-expense-filters{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){.page-heading-row.register-heading{align-items:flex-start;flex-direction:column}.register-heading-actions{width:100%;justify-content:flex-start}.compact-filter-popover>.master-filter,.compact-filter-popover>.admin-expense-filters{position:fixed;top:calc(var(--sticky-header-bottom, 72px) + 8px);left:14px;right:14px;width:auto;max-height:calc(100dvh - 100px);grid-template-columns:repeat(2,minmax(0,1fr));padding:13px}.compact-filter-popover>.master-filter .register-search{grid-column:1/-1}.compact-filter-popover>.admin-expense-filters label:nth-of-type(3){grid-column:1/-1}.compact-filter-popover>.admin-expense-filters .button{width:100%}.compact-filter-popover>summary{gap:6px}.compact-filter-popover>summary small{display:none}.period-picker{position:fixed;top:74px;left:14px;right:14px;width:auto;max-height:calc(100dvh - 100px);padding:13px}.metric-period[open]>summary{padding:14px}.back-to-top{right:max(12px,env(safe-area-inset-right));bottom:max(12px,env(safe-area-inset-bottom));width:42px;height:42px}.admin-bill-upload{justify-content:flex-start}.admin-bill-upload>*{flex:1 1 100%;width:100%}}
@media(prefers-reduced-motion:reduce){.back-to-top{scroll-behavior:auto}}


.archive-form{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:10px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--surface-alt)}.archive-form label{display:flex;flex-direction:column;gap:6px;min-width:min(260px,100%);color:var(--ink);font-size:12px;font-weight:700}.archive-form input{width:100%;min-width:0;min-height:42px;padding:9px 11px;border:1px solid var(--line);border-radius:9px;background:var(--input-bg);color:var(--ink)}.imported-expense-edit{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:end}.imported-expense-edit label{min-width:0}.imported-expense-edit input,.imported-expense-edit select{width:100%;min-height:44px;padding:9px 11px;border:1px solid var(--line);border-radius:10px;background:var(--input-bg);color:var(--ink)}@media(max-width:760px){.imported-expense-edit{grid-template-columns:1fr}}
.master-filter{display:grid;grid-template-columns:repeat(4,minmax(145px,1fr));gap:10px;align-items:end}.master-filter label{display:grid;min-width:0;gap:5px;color:var(--muted);font-size:11px;font-weight:750}.master-filter input,.master-filter select{width:100%;min-width:0;min-height:39px;padding:7px 9px;border:1px solid var(--line);border-radius:8px;background:var(--input-bg);color:var(--ink);font:inherit;font-size:12px}.master-filter .register-search{grid-column:span 2}.register-metrics{grid-template-columns:repeat(4,minmax(0,1fr))}.register-metrics article{padding:12px 14px;min-height:74px}.register-metrics article strong{font-size:20px}.register-category-totals>div{display:flex;flex-wrap:wrap;gap:8px}.register-category-totals>div>span{display:flex;gap:9px;align-items:center;padding:6px 9px;border:1px solid var(--line);border-radius:999px;background:var(--surface-alt);font-size:12px}.register-category-totals>div strong{white-space:nowrap}.master-register-card{padding:15px}.master-register-table{min-width:1460px;font-size:11px}.master-register-table th,.master-register-table td{padding:8px 9px;vertical-align:top}.master-register-table th a{color:var(--ink);text-decoration:none;white-space:nowrap}.master-register-table td{max-width:220px;overflow-wrap:anywhere}.master-register-table td:nth-child(7){white-space:nowrap;text-align:right;font-variant-numeric:tabular-nums}.master-register-table td:nth-child(12),.master-register-table td:nth-child(13){text-align:center;white-space:nowrap}.active-filter-label{color:var(--muted);font-size:12px;white-space:nowrap}

@media(max-width:980px){.master-filter{grid-template-columns:repeat(3,minmax(130px,1fr))}.register-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}

@media(max-width:620px){.master-filter{grid-template-columns:repeat(2,minmax(0,1fr))}.master-filter .register-search{grid-column:span 2}.master-filter>.button{width:100%}.register-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.master-register-card{padding:12px}.master-register-table{min-width:1300px}}


@media(max-width:850px){.primary-nav{display:none}.mobile-menu{display:block}}

@media(max-width:760px){form.archive-form{display:grid;grid-template-columns:minmax(0,1fr);align-items:stretch}form.archive-form>label{min-width:0}form.archive-form>button{width:100%}}

/* Final cascade guard: the period control is an overlay and never grows its grid track. */
.metric-period[open]{grid-column:auto;z-index:120}
.metric-period[open]>summary{min-height:100%;padding:19px;border:0}
.metric-period[open]>summary::after{display:block}
.period-picker{position:absolute;z-index:140;top:calc(100% + 8px);right:0;width:min(410px,calc(100vw - 32px));max-height:min(76vh,620px);overflow:auto;align-items:end;flex-direction:row;flex-wrap:wrap;padding:16px;border:1px solid var(--line);border-radius:14px;background:var(--surface);box-shadow:var(--shadow-md)}
.period-picker label{flex:1 1 170px;min-width:0}
.period-picker .period-range,.period-picker .period-actions{flex:1 1 100%}
@media(max-width:620px){.period-picker{position:fixed;top:74px;left:14px;right:14px;width:auto;max-height:calc(100dvh - 100px);padding:13px}.metric-period[open]>summary{padding:14px}}

/* One compact, accessible header navigation for every authenticated page. */
.site-header{position:sticky;top:0;z-index:1000}
.primary-nav{flex:1;min-width:0;justify-content:center;gap:3px;margin-left:12px;margin-right:6px;white-space:nowrap}
.primary-nav>a,.nav-group>summary{min-height:38px;display:flex;align-items:center;justify-content:center;padding:0 10px;border:0;border-radius:9px;background:transparent;color:var(--muted);font-size:12px;font-weight:750;text-decoration:none;cursor:pointer;list-style:none}
.primary-nav>a:hover,.primary-nav>a:focus-visible,.nav-group>summary:hover,.nav-group>summary:focus-visible{background:var(--blue-soft);color:var(--navy)}
.primary-nav>a.is-active,.nav-group.is-active>summary{background:var(--action-bg);color:var(--action-text)}
.nav-group{position:relative;flex:0 0 auto}
.nav-group>summary::-webkit-details-marker{display:none}
.nav-group>summary::after{content:"";width:6px;height:6px;margin:0 0 3px 8px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg)}
.nav-group[open]>summary::after{margin-bottom:-3px;transform:rotate(225deg)}
.nav-group>summary:focus-visible,.primary-nav>a:focus-visible,.nav-popover a:focus-visible{outline:0;box-shadow:var(--focus)}
.nav-popover{position:absolute;z-index:70;top:calc(100% + 7px);left:0;min-width:190px;display:grid;gap:3px;padding:7px;border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:var(--shadow-md)}
.nav-popover a{min-height:40px;display:flex;align-items:center;padding:0 11px;border-radius:8px;color:var(--ink);font-size:12px;font-weight:700;text-decoration:none}
.nav-popover a:hover,.nav-popover a.is-active{background:var(--blue-soft);color:var(--navy)}
.mobile-nav-identity,.mobile-nav-group{display:block;padding:8px 12px 4px;color:var(--muted);font-size:10px;font-weight:800;letter-spacing:.09em;text-transform:uppercase}
.mobile-menu nav a[aria-current=page]{background:var(--blue-soft);color:var(--navy)}
.mobile-menu nav{max-height:min(76vh,680px);overflow:auto;overscroll-behavior:contain}
.overview-metrics{align-items:stretch}
.metric-period{position:relative;min-width:0;border:1px solid var(--line);border-radius:var(--radius-md);background:var(--surface);box-shadow:var(--shadow-sm)}
.metric-period>summary{min-height:100%;display:block;padding:19px;cursor:pointer;list-style:none}
.metric-period>summary::-webkit-details-marker{display:none}
.metric-period>summary::after{content:"Choose period";display:block;margin-top:12px;color:var(--blue);font-size:11px;font-weight:750}
.metric-period>summary span,.metric-period>summary strong,.metric-period>summary small{display:block}
.metric-period>summary span{color:var(--muted);font-size:12px}
.metric-period>summary strong{margin-top:8px;color:var(--navy);font:750 clamp(18px,2.3vw,25px)/1.1 Manrope,sans-serif}
.metric-period>summary small{margin-top:6px;color:var(--muted);font-size:11px}
.metric-period>summary:hover{background:var(--surface-soft);border-radius:var(--radius-md)}
.metric-period>summary:focus-visible{outline:0;box-shadow:var(--focus);border-radius:var(--radius-md)}
.metric-period[open]{grid-column:1/-1}
.metric-period[open]>summary{min-height:0;padding:14px 18px;border-bottom:1px solid var(--line)}
.metric-period[open]>summary::after{display:none}
.period-picker{display:flex;align-items:end;flex-wrap:wrap;gap:10px;padding:14px 18px}
.period-picker [hidden]{display:none!important}
.period-picker label{display:grid;min-width:min(190px,100%);gap:5px;color:var(--muted);font-size:11px;font-weight:750}
.period-picker input,.period-picker select{width:100%;min-height:42px;padding:8px 10px;border:1px solid var(--line);border-radius:9px;background:var(--input-bg);color:var(--ink);font:inherit}
.period-range{display:flex;flex-wrap:wrap;gap:10px}
.period-actions{display:flex;flex-wrap:wrap;gap:8px}
.overview-report-links{display:flex;flex-wrap:wrap;gap:18px;margin:-16px 0 26px;font-size:13px;font-weight:700}
.overview-report-links a{color:var(--blue)}
.source-totals{grid-template-columns:repeat(3,minmax(0,1fr))}
.expense-row-actions,.register-row-actions{min-width:130px;white-space:nowrap}
.expense-row-actions a,.register-row-actions a{display:inline-flex!important;align-items:center;min-height:34px;margin:2px 3px 2px 0!important;padding:5px 8px;border:1px solid var(--line);border-radius:8px;background:var(--surface);font-size:11px}
.detail-heading-actions{display:flex;align-items:center;gap:10px}
.bill-summary-card{display:flex;align-items:center;justify-content:space-between;gap:16px}
.bill-summary-card h2{margin:7px 0 0}
.bill-file-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,230px),1fr));gap:14px}
.bill-file-card{min-width:0;overflow:hidden;border:1px solid var(--line);border-radius:14px;background:var(--surface);box-shadow:var(--shadow-sm)}
.bill-file-card>a:first-child{height:220px;display:grid;place-items:center;background:var(--surface-soft)}
.bill-file-card img{width:100%;height:220px;object-fit:contain}
.bill-file-icon{color:var(--muted);font-size:12px;font-weight:800;letter-spacing:.08em}
.bill-file-card>div{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px}
.bill-file-card strong{min-width:0;overflow-wrap:anywhere;font-size:12px}
.bill-message{margin-top:20px;text-align:left}
@media(max-width:850px){.primary-nav{display:none}.mobile-menu{display:block}}
@media(max-width:760px){.source-totals{grid-template-columns:repeat(2,minmax(0,1fr))}.source-totals article:first-child{grid-column:1/-1}.metric-period>summary{padding:14px}.period-picker{align-items:stretch;flex-direction:column}.period-picker label,.period-range{width:100%}.period-range label{flex:1 1 140px}.period-actions>*{flex:1}.bill-summary-card{align-items:stretch;flex-direction:column}.detail-heading-actions{flex-direction:column;align-items:flex-end}.expense-row-actions,.register-row-actions{white-space:normal}.bill-file-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.bill-file-card>div{align-items:stretch;flex-direction:column}.bill-file-card .button{width:100%;padding-inline:8px}}

/* Responsive release layout: broad desktop canvas, readable tables, and true mobile records. */
.page-shell,.site-footer{width:min(1800px,calc(100% - clamp(32px,5vw,112px)))}
.site-header{padding-inline:max(24px,calc((100vw - 1800px)/2));}
.page-shell>*{min-width:0}
.page-heading-row>div,.section-heading>div,.admin-card,.metric-grid article,.admin-links a,.report-groups>*{min-width:0}
.admin-summary-grid{grid-template-columns:repeat(6,minmax(0,1fr))}
.admin-summary-grid>article,.admin-summary-grid>.metric-period{min-width:0}
.admin-summary-grid article span,.metric-period>summary span{overflow-wrap:anywhere;line-height:1.4}
.admin-summary-grid article small{display:block;margin-top:6px;color:var(--muted);overflow-wrap:anywhere}
.overview-report-links{margin:0 0 26px;gap:12px 22px;line-height:1.5}
.admin-links{grid-template-columns:repeat(4,minmax(0,1fr))}
.import-summary>.metric-grid{grid-template-columns:repeat(auto-fit,minmax(200px,1fr));align-items:stretch;gap:12px}
.import-summary>.metric-grid article{display:flex;min-height:112px;flex-direction:column;justify-content:center;gap:4px;padding:16px}
.import-summary>.metric-grid article span{min-height:2.8em;overflow-wrap:normal;word-break:normal;line-height:1.4}
.import-summary>.metric-grid article strong{margin-top:2px;font-size:clamp(21px,2vw,27px);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.import-summary>.metric-grid article small{color:var(--muted);overflow-wrap:anywhere}
.master-register-wrap{overflow-x:auto;overscroll-behavior-inline:contain}
.master-register-table{width:100%;min-width:1690px;table-layout:fixed;font-size:12px}
.master-register-table th,.master-register-table td{padding:10px 8px;overflow-wrap:normal;word-break:normal}
.master-register-table th:nth-child(1),.master-register-table td:nth-child(1){width:100px}
.master-register-table th:nth-child(2),.master-register-table td:nth-child(2){width:120px}
.master-register-table th:nth-child(3),.master-register-table td:nth-child(3){width:105px}
.master-register-table th:nth-child(4),.master-register-table td:nth-child(4){width:110px}
.master-register-table th:nth-child(5),.master-register-table td:nth-child(5){width:320px}
.master-register-table th:nth-child(6),.master-register-table td:nth-child(6){width:115px}
.master-register-table th:nth-child(7),.master-register-table td:nth-child(7){width:105px}
.master-register-table th:nth-child(8),.master-register-table td:nth-child(8){width:90px}
.master-register-table th:nth-child(9),.master-register-table td:nth-child(9){width:90px}
.master-register-table th:nth-child(10),.master-register-table td:nth-child(10){width:145px}
.master-register-table th:nth-child(11),.master-register-table td:nth-child(11){width:110px}
.master-register-table th:nth-child(12),.master-register-table td:nth-child(12){width:100px}
.master-register-table th:nth-child(13),.master-register-table td:nth-child(13){width:75px}
.master-register-table th:nth-child(14),.master-register-table td:nth-child(14){width:155px}
.master-register-table td:nth-child(1),.master-register-table td:nth-child(2),.master-register-table td:nth-child(3),.master-register-table td:nth-child(4),.master-register-table td:nth-child(6),.master-register-table td:nth-child(8),.master-register-table td:nth-child(9),.master-register-table td:nth-child(12),.master-register-table td:nth-child(13){overflow-wrap:anywhere}
.master-register-table td.register-purpose{white-space:normal;overflow-wrap:anywhere;line-height:1.45}
.register-row-actions{min-width:0;white-space:normal}
.register-row-actions a{white-space:normal}
.register-source-details{display:none}
.admin-table th,.admin-table td{min-width:0}
.metric-grid article span,.admin-card p,.helper,.section-heading p,.page-heading-row p{overflow-wrap:anywhere}
.admin-form,.filter-bar,.report-filter,.button-row,.register-heading-actions{min-width:0;flex-wrap:wrap}
.admin-form label,.report-filter label{min-width:min(155px,100%)}
.report-groups{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:1399px){.admin-summary-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.admin-links{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:980px){.page-shell,.site-footer{width:calc(100% - 40px)}.admin-summary-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.admin-links{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.page-shell,.site-footer{width:calc(100% - 28px)}.admin-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.admin-summary-grid article,.admin-summary-grid>.metric-period{padding:13px}.admin-summary-grid article strong{font-size:clamp(18px,5vw,23px)}.admin-links{grid-template-columns:1fr}.report-groups{grid-template-columns:1fr}.import-summary>.section-heading{align-items:stretch;flex-direction:column}.import-summary>.section-heading .button-row{flex-wrap:wrap;justify-content:flex-start}.import-summary>.section-heading .button-row .button{flex:1 1 180px}.import-summary>.metric-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.import-summary>.metric-grid article{min-height:104px;padding:12px}.import-summary>.metric-grid article span{min-height:0;font-size:11px}.import-summary>.metric-grid article strong{font-size:21px}.master-register-card{padding:12px}.master-register-wrap{overflow:visible}.master-register-table,.master-register-table tbody,.master-register-table tr,.master-register-table td{display:block;width:100%;min-width:0}.master-register-table{table-layout:auto;border-collapse:separate;border-spacing:0}.master-register-table thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.master-register-table tbody{display:grid;gap:11px}.master-register-table tr{overflow:hidden;border:1px solid var(--line);border-radius:13px;background:var(--surface);box-shadow:var(--shadow-sm)}.master-register-table td,.master-register-table td:nth-child(n){display:grid;width:100%;max-width:none;min-width:0;align-items:start;grid-template-columns:minmax(86px,.34fr) minmax(0,1fr);gap:7px;padding:9px 11px;border-bottom:1px solid var(--line);text-align:left!important;white-space:normal!important;overflow-wrap:anywhere}.master-register-table td::before{content:attr(data-label);color:var(--muted);font-size:10px;font-weight:800;line-height:1.4;letter-spacing:.02em}.master-register-table td.register-date,.master-register-table td.register-amount{display:flex;justify-content:space-between;align-items:center;font-weight:800}.master-register-table td.register-date{background:var(--surface-soft)}.master-register-table td.register-amount{color:var(--navy);font-size:15px}.master-register-table td.register-purpose{display:block;width:100%;max-width:none;padding:12px;background:var(--surface-soft);font-size:14px;line-height:1.5}.master-register-table td.register-purpose::before{display:block;margin-bottom:5px}.master-register-table td:last-child{border-bottom:0}.master-register-table td.register-row-actions{display:flex;flex-wrap:wrap;gap:8px;padding:11px}.master-register-table td.register-row-actions::before{flex:0 0 100%}.register-row-actions a{min-height:40px;align-items:center;padding:7px 10px}.register-heading-actions{width:100%;justify-content:flex-start}}
@media(max-width:390px){.import-summary>.metric-grid{grid-template-columns:1fr}.import-summary>.metric-grid article{min-height:0}.master-register-table td{grid-template-columns:minmax(76px,.32fr) minmax(0,1fr);gap:6px;padding-inline:9px}.header-tools{gap:6px}.brand-logo{max-width:146px}}
@media(max-width:760px){.master-register-table td:nth-child(9),.master-register-table td:nth-child(10),.master-register-table td:nth-child(11),.master-register-table td:nth-child(12),.master-register-table td:nth-child(13){display:none}.register-action-links{display:flex;flex-wrap:wrap;gap:7px}.register-source-details{display:block;flex:1 1 100%;margin-top:4px}.register-source-details>summary{min-height:40px;display:flex;align-items:center;color:var(--blue);font-size:12px;font-weight:750;cursor:pointer}.register-source-details dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:5px 0 0;padding:10px;border:1px solid var(--line);border-radius:9px;background:var(--surface-soft)}.register-source-details dl div{min-width:0}.register-source-details dt{color:var(--muted);font-size:10px;font-weight:750}.register-source-details dd{margin:2px 0 0;color:var(--ink);font-size:11px;overflow-wrap:anywhere}}
@media(prefers-reduced-motion:reduce){.admin-links a,.button{transition:none}}

/* Keep the period card's dimensions unchanged while its controls overlay it. */
.overview-metrics>.metric-period[open]{grid-column:auto!important;align-self:stretch}
.overview-metrics>.metric-period[open]>summary{min-height:100%;padding:19px;border:0}
.overview-metrics>.metric-period[open]>summary::after{display:block!important;visibility:hidden}
.overview-metrics>.metric-period .period-picker{position:absolute;top:calc(100% + 8px);right:0;left:auto;width:min(410px,calc(100vw - 32px));z-index:140}
@media(max-width:760px){.overview-metrics>.metric-period[open]>summary{padding:14px}.overview-metrics>.metric-period .period-picker{position:fixed;top:74px;left:14px;right:14px;width:auto}}
