/* Hourmark 5.0 — purpose-built work and money companion.
   Four separate destinations; Settings is a utility. Entry dialogs retain their mobile safety layout. */
:root {
 --hm5-bg:#0b1216;--hm5-side:#101a1e;--hm5-surface:#131f23;--hm5-panel:#172529;
 --hm5-raised:#1b2b30;--hm5-line:#2c3a3e;--hm5-text:#f5f2e8;--hm5-muted:#a9b8b6;
 --hm5-gold:#e9c487;--hm5-green:#9fbfaf;--hm5-red:#ecaa9b;--hm5-radius:15px;
 --gold:#e9c487;--line:#34433f;--shadow:none;
}
html,body{background:var(--hm5-bg)!important;color:var(--hm5-text);font-family:Inter,Manrope,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.app-shell{grid-template-columns:220px minmax(0,1fr);background:var(--hm5-bg);min-width:0}
.sidebar{
 padding:29px 16px 18px!important;background:var(--hm5-side)!important;border-right:1px solid var(--hm5-line)!important;
 box-shadow:none!important;display:flex;flex-direction:column;min-width:0;
}
.sidebar:after,.sidebar .side-bottom,.sidebar .nav-section-label{display:none!important}
.sidebar .brand{padding:0 5px 34px;margin:0;min-height:70px}
.sidebar .brand strong{font-size:17px;letter-spacing:.15em;color:var(--hm5-text)}
.sidebar .brand small{font-size:9px;letter-spacing:.11em;color:var(--hm5-muted)}
.sidebar .brand-symbol{border:1px solid #e9c48739;background:#e9c4870e}
.side-nav{display:grid;gap:6px;margin:8px 0;flex:0 0 auto}
.sidebar .side-nav button{
 display:flex!important;align-items:center;justify-content:flex-start;gap:13px;
 width:100%;min-height:49px;padding:12px 16px!important;text-align:left;
 font-size:13px!important;font-weight:650!important;border:1px solid transparent;border-radius:10px;
 color:var(--hm5-muted);background:transparent!important;letter-spacing:0;white-space:nowrap;
}
.sidebar .side-nav button .nav-icon{display:grid;place-items:center;flex:0 0 22px;font-size:22px;line-height:1;color:inherit}
.sidebar .side-nav button:hover,.sidebar .side-nav button:focus-visible{background:#ffffff0b!important;color:#fff}
.sidebar .side-nav button.active,.sidebar .side-nav button[aria-current=page]{
 color:var(--hm5-text)!important;background:#e9c48715!important;border-color:#e9c48732!important;
}
.sidebar .side-nav button.active .nav-icon{color:var(--hm5-gold)}
.hm-sidebar-utility{margin-top:auto;border-top:1px solid var(--hm5-line);padding:17px 0 0}
.hm-sidebar-utility button{width:100%;padding:13px 16px;text-align:left;border:0;border-radius:10px;color:var(--hm5-muted);background:transparent;display:flex;align-items:center;gap:13px;font-weight:650;font-size:13px}
.hm-sidebar-utility button span{font-size:19px;width:22px;text-align:center}
.hm-sidebar-utility button:hover,.hm-sidebar-utility button[aria-current=page]{background:#ffffff0c;color:var(--hm5-text)}
.sidebar .nav-secondary{margin-top:12px}
.app-main{min-width:0;background:var(--hm5-bg);height:100%;overflow:hidden}
.topbar{
 min-height:69px;height:69px;flex:0 0 69px;padding:0 clamp(17px,3vw,46px);
 background:#0c1519!important;border-bottom:1px solid var(--hm5-line)!important;box-shadow:none!important
}
.topbar-title{font-size:12px;color:var(--hm5-muted);font-weight:650}
#pageCrumb{color:var(--hm5-text);letter-spacing:.01em}
.topbar-title .separator{opacity:.24}
.topbar .icon-button{border-color:transparent!important;background:transparent!important;color:#c4d1c8!important;border-radius:10px}
.topbar .icon-button:hover,.topbar .icon-button:focus-visible{border-color:var(--hm5-line)!important;background:#ffffff0b!important;color:var(--hm5-gold)!important}
.topbar .global-settings-button[aria-current=page]{color:var(--hm5-gold)!important;background:#e9c4871b!important}
.topbar .top-version{color:var(--hm5-muted);opacity:.65;font-size:10px}
.topbar-actions{gap:8px}
#mainArea{max-width:none;padding:34px clamp(18px,4vw,58px) 70px;min-width:0;overflow-x:clip}
#mainArea>.page{max-width:1180px;margin:0 auto;min-width:0}
#mainArea>.topo-art{display:none!important}
.footer{font-size:10px;color:#8ca19b;border-color:var(--hm5-line)}
.page.active{animation:hm5-enter .14s ease-out}
@keyframes hm5-enter{from{opacity:.8}to{opacity:1}}
.hm-overline{font-size:10px;font-weight:800;letter-spacing:.17em;text-transform:uppercase;color:var(--hm5-gold)}
.hm-page-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin:0 0 29px}
.hm-page-heading>div:first-child{min-width:0}
.hm-page-heading h1{font-weight:750;letter-spacing:-.045em;font-size:clamp(32px,4vw,49px);line-height:1.1;margin:9px 0 8px;color:var(--hm5-text)}
.hm-page-heading h1 em{font-style:normal;font-weight:450;color:var(--hm5-text)}
.hm-page-heading p{font-size:14px;line-height:1.55;color:var(--hm5-muted);margin:0;max-width:550px}
.hm-heading-actions{display:flex;align-items:center;gap:9px;flex-shrink:0;flex-wrap:wrap}
.hm-action-primary,.hm-action,.hm-text-action{
 display:inline-flex;align-items:center;justify-content:center;gap:7px;cursor:pointer;
 font-family:inherit;font-size:13px;font-weight:750;line-height:1.25;text-decoration:none;
 border-radius:10px;min-height:43px;padding:12px 17px;white-space:nowrap
}
.hm-action-primary{background:var(--hm5-gold);color:#1a211d;border:1px solid var(--hm5-gold);box-shadow:none}
.hm-action-primary:hover,.hm-action-primary:focus-visible{background:#f5d49c;border-color:#f5d49c}
.hm-action{background:var(--hm5-raised);border:1px solid #3a4b4e;color:var(--hm5-text)}
.hm-action:hover,.hm-action:focus-visible{background:#26383b}
.hm-text-action{padding:9px 4px;min-height:38px;color:var(--hm5-gold);background:transparent;border:0;border-radius:4px}
.hm-text-action:hover,.hm-text-action:focus-visible{text-decoration:underline}
.hm-section-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0 0 19px}
.hm-section-heading h2{font-size:clamp(19px,2.2vw,24px);line-height:1.25;letter-spacing:-.025em;margin:5px 0 0;color:var(--hm5-text)}
.hm-stat-grid{display:grid;gap:11px;margin-bottom:23px;min-width:0}
.hm-stat-three{grid-template-columns:repeat(3,minmax(0,1fr))}
.hm-stat-four{grid-template-columns:repeat(4,minmax(0,1fr))}
.hm-stat-two{grid-template-columns:repeat(2,minmax(0,1fr))}
.hm-stat{padding:21px 23px;min-width:0;border:1px solid var(--hm5-line);border-radius:var(--hm5-radius);background:var(--hm5-surface);display:flex;flex-direction:column;gap:9px}
.hm-stat>span{font-size:12px;font-weight:650;color:#b8c6c1}
.hm-stat>strong{font-size:clamp(22px,2.6vw,32px);line-height:1.22;color:var(--hm5-text);font-variant-numeric:tabular-nums;letter-spacing:-.03em;overflow-wrap:anywhere}
.hm-stat>small{font-size:11px;line-height:1.5;color:var(--hm5-muted);margin-top:auto}
.hm-stat-accent{background:#1b322b;border-color:#537363}
.hm-stat-accent>strong{color:#f0d59b}
.hm-surface{padding:23px 24px;background:var(--hm5-surface);border:1px solid var(--hm5-line);border-radius:var(--hm5-radius);min-width:0;margin:18px 0}
.hm-detail-note,.hm-disclaimer{font-size:12px;color:var(--hm5-muted);line-height:1.65;margin:12px 0 22px;max-width:810px}
.hm-disclaimer{font-size:11px;color:#90a7a0}
.hm-list-count{font-size:11px;color:var(--hm5-muted);margin:16px 0 7px}
.hm-filter-bar{display:flex;flex-wrap:wrap;gap:10px;align-items:end;margin:0 0 10px}
.hm-filter-bar>label,.hm-period-picker>label,.hm-trends-controls>label{font-size:11px;color:var(--hm5-muted);font-weight:650;display:grid;gap:7px;min-width:0}
.hm-filter-bar :is(input,select),.hm-period-picker select,.hm-trends-controls select{
 min-height:43px;border:1px solid #415256;border-radius:9px;
 color:var(--hm5-text);background:#101c20;font-size:14px;padding:9px 11px;max-width:100%;box-sizing:border-box;
}
.hm-filter-bar :is(input,select):focus-visible,.hm-period-picker select:focus-visible{outline:2px solid var(--hm5-gold);outline-offset:2px}
.hm-details{border:1px solid var(--hm5-line);border-radius:12px;margin:14px 0;background:#101b1f;min-width:0;overflow:clip}
.hm-details>summary{cursor:pointer;list-style:none;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:14px 18px;font-size:13px;font-weight:750;color:#d7e0db;min-height:43px}
.hm-details>summary::-webkit-details-marker{display:none}
.hm-details>summary:after{content:'+';color:var(--hm5-gold);font-size:20px}
.hm-details[open]>summary:after{content:'−'}
.hm-work-details-content{padding:4px 18px 19px}
.hm-extra-actions{display:flex;gap:10px;flex-wrap:wrap;padding-top:9px}
/* Home is the overview; no pay-period cards or expense ledger are mixed into it. */
.hm-period-picker{display:flex;gap:9px;align-items:flex-end;flex-wrap:wrap}
.hm-period-picker select{width:155px}
.hm-period-picker label:last-child select{width:135px}
.hm-position{
 position:relative;display:flex;align-items:center;justify-content:space-between;
 min-height:233px;padding:32px clamp(23px,4vw,47px);border-radius:19px;
 background:linear-gradient(120deg,#1b342e 3%,#203d34 69%,#1a302b 100%);
 border:1px solid #5c81634d;overflow:hidden;margin-bottom:12px
}
.hm-position-content{position:relative;z-index:1;min-width:0;max-width:690px}
.hm-position h2{font-size:14px;font-weight:550;color:#d7e5d7;margin:16px 0 12px}
.hm-position-number{display:block;font-size:clamp(39px,6.6vw,66px);letter-spacing:-.065em;line-height:1.1;font-variant-numeric:tabular-nums;font-weight:750;color:#f7e8c5;overflow-wrap:anywhere}
.hm-position-number.flow-negative{color:#f1ad9b}
.hm-position p{font-size:13px;line-height:1.6;color:#d0dfd1;margin:16px 0 7px}
.hm-position small{font-size:11px;line-height:1.55;color:#bed4c4}
.hm-position-mark{position:absolute;right:-30px;bottom:-5px;width:240px;color:#b6cea7;opacity:.18;pointer-events:none}
.hm-position-mark svg{display:block;width:100%;height:auto}
.hm-overview-strip{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;border:1px solid var(--hm5-line);border-radius:12px;background:#111c20;min-width:0;margin:5px 0 33px}
.hm-overview-strip>div{padding:15px 20px;display:flex;align-items:center;justify-content:space-between;gap:9px;min-width:0}
.hm-overview-strip>div:not(:last-child){border-right:1px solid var(--hm5-line)}
.hm-overview-strip span{font-size:11px;color:var(--hm5-muted)}
.hm-overview-strip strong{color:var(--hm5-text);font-size:14px;overflow-wrap:anywhere;text-align:right;font-variant-numeric:tabular-nums}
.hm-quick-section{margin:28px 0}
.hm-action-row{display:flex;gap:10px;flex-wrap:wrap}
.hm-next-step{display:flex;gap:15px;align-items:center;border-top:1px solid var(--hm5-line);border-bottom:1px solid var(--hm5-line);padding:19px 2px;min-width:0}
.hm-next-mark{border:1px solid #425a50;border-radius:11px;padding:13px;color:var(--hm5-gold);font-size:23px;line-height:1}
.hm-next-step>div:nth-child(2){min-width:0;flex:1 1 auto}
.hm-next-step h2{margin:5px 0;font-size:17px;color:var(--hm5-text)}
.hm-next-step p{font-size:12px;line-height:1.5;color:var(--hm5-muted);margin:0}
.hm-next-step>.hm-text-action{flex-shrink:0}
/* Work: summary, actual pay history, then logs. */
.hm-work-stats{margin-bottom:0}
.hm-pay-history{margin-top:18px}
.hm-pay-items{display:grid}
.hm-pay-item{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:17px;align-items:center;padding:16px 0;min-width:0;border-top:1px solid #ffffff17}
.hm-pay-item:first-child{border-top:0}
.hm-pay-item>div:first-child{min-width:0}
.hm-pay-item strong{display:block;font-size:13px;color:var(--hm5-text);font-weight:750}
.hm-pay-item small{font-size:11px;color:var(--hm5-muted);line-height:1.55;display:block;margin-top:5px}
.hm-pay-item .hm-pay-amount{font-size:17px;font-variant-numeric:tabular-nums;color:#ead09e;text-align:right}
.hm-pay-item button{color:var(--hm5-gold);background:transparent;border:1px solid #506454;border-radius:8px;padding:9px 12px;cursor:pointer;min-height:39px;font-size:12px}
.hm-pay-item button:hover{background:#ffffff0c}
.hm-work-history{padding-bottom:15px}
.hm-work-history .work-row{border-bottom:1px solid #ffffff1d!important;background:transparent;border-radius:0}
.hm-work-history .work-table-head{border-bottom:1px solid #ffffff24}
.hm-work-history .work-list,.hm-work-history .stack{min-width:0}
.hm-work-history .work-row .row-left>span:last-child{min-width:0;overflow-wrap:anywhere}
.hm-work-history .work-row .value{font-variant-numeric:tabular-nums}
.hm-work-history .work-match-count{font-size:11px;color:var(--hm5-muted)}
.hm-work-history .work-history-tools{display:flex;flex-wrap:wrap;align-items:end;gap:10px}
.hm-work-history .work-history-tools>label{min-width:0;flex:1 1 150px}
.hm-work-history .work-history-tools :is(input,select){width:100%;min-width:0}
.hm-work-breakdown{margin-top:25px}
.hm-work-breakdown .work-payment-breakdown{background:transparent;border:0;margin:15px 0 0}
.hm-work-breakdown .work-status-box{min-width:0}
.hm-work-breakdown .hm-stat{padding:15px}
.hm-work-breakdown .hm-stat strong{font-size:22px}
/* Expenses: focused entry and list rather than another Money workspace. */
.hm-expense-filters label:first-child{flex:2 1 190px}
.hm-expense-filters label:nth-child(2){flex:1 1 140px}
.hm-expense-filters label:last-child{flex:1 1 155px}
.hm-expense-filters :is(input,select){width:100%}
.hm-expense-list{min-width:0;display:grid;padding:0}
.hm-expense-list .tool-list-row{display:flex;align-items:center;min-height:69px;border-top:1px solid #ffffff19;padding:13px 5px;background:transparent;color:var(--hm5-text);border-bottom:0;border-radius:0;gap:14px}
.hm-expense-list .tool-list-row:first-child{border-top:0}
.hm-expense-list .tool-list-row:hover{background:#ffffff09}
.hm-expense-list .tool-list-row span{min-width:0}
.hm-expense-list .tool-list-row b{font-size:14px;letter-spacing:-.01em}
.hm-expense-list .tool-list-row small{font-size:11px;color:var(--hm5-muted);line-height:1.6;margin-top:4px}
.hm-expense-list .tool-list-row strong{font-size:15px;white-space:nowrap;font-variant-numeric:tabular-nums}
.hm-expense-history #expenseLoadMore{margin:15px auto 0;display:flex}
.hm-expense-history #expenseLoadMore[hidden]{display:none}
/* Trends: readable visualization up front, details after. */
.hm-trends-controls{display:flex;align-items:end;gap:13px;flex-wrap:wrap}
.hm-trends-controls .hm-text-action{min-height:42px}
.hm-trend-chart{margin:13px 0 19px;padding-bottom:18px}
.hm-trend-chart .trends-chart{min-height:220px;margin:20px 0 8px}
.hm-trend-chart .trends-legend{font-size:11px;gap:12px}
.hm-trend-chart .trends-legend span{white-space:nowrap}
.hm-trend-metrics .hm-stat{padding:17px 18px}
.hm-trend-metrics .hm-stat strong{font-size:clamp(19px,2.2vw,28px)}
.hm-trend-details{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:17px;align-items:start}
.hm-trend-details .hm-surface{margin:4px 0}
.hm-trend-details .trends-item{border-top:1px solid #ffffff17}
.hm-trend-projects>.hm-surface{margin:0;border:0;background:transparent;padding:0 17px 19px}
.hm-trend-projects>summary{color:var(--hm5-text)}
/* Settings utility, not a fifth bottom tab. */
#settings>h1{font-size:clamp(30px,3.6vw,44px);letter-spacing:-.035em;margin:10px 0 10px}
.hm-settings-intro>p{font-size:13px;color:var(--hm5-muted);margin:0 0 22px}
.hm-settings-shortcuts{display:flex;flex-wrap:wrap;gap:8px;max-width:770px;padding-bottom:20px;border-bottom:1px solid var(--hm5-line);margin-bottom:22px}
.hm-settings-shortcuts :is(button,a){border:1px solid var(--hm5-line);background:var(--hm5-panel);color:var(--hm5-text);font-size:12px;font-weight:650;text-decoration:none;padding:12px 15px;min-height:42px;border-radius:9px;cursor:pointer}
.hm-settings-shortcuts :is(button,a):hover{background:var(--hm5-raised)}
#settings .settings-list{max-width:820px}
#settings .settings-item{border:1px solid var(--hm5-line);border-radius:12px;background:var(--hm5-surface)}
#settings .settings-item summary{padding:18px 20px}
#settings .setting-body{background:transparent}
#settings .settings-icon{background:color-mix(in srgb,var(--hm-accent) 10%,transparent);color:var(--hm-accent)}
/* Mobile: breathable one-column layout, no sideways sliding. */
@media(max-width:960px) and (min-width:641px){
 .app-shell{grid-template-columns:76px minmax(0,1fr)}
 .sidebar{padding:23px 9px!important}
 .sidebar .brand{padding:0 0 20px;justify-content:center}
 .sidebar .brand>div:nth-child(2){display:none}
 .sidebar .side-nav button{font-size:0!important;justify-content:center;gap:0;padding:12px 4px!important}
 .sidebar .side-nav button .nav-icon{font-size:24px}
 .hm-sidebar-utility button{font-size:0;justify-content:center;padding:12px 4px}
 .hm-sidebar-utility button span{font-size:22px}
 .hm-stat-three{grid-template-columns:repeat(2,minmax(0,1fr))}
 .hm-stat-three>.hm-stat:last-child:nth-child(odd){grid-column:1/-1}
 .hm-stat-four{grid-template-columns:repeat(2,minmax(0,1fr))}
 .hm-trend-details{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:640px){
 .app-shell{display:block!important;background:var(--hm5-bg);height:auto}
 .sidebar{display:none!important}
 .app-main{height:100%!important;min-height:0}
 /* The top bar owns the notch inset. Body does not add it again. */
 .topbar{display:flex!important;flex-direction:row!important;align-items:center;justify-content:space-between;gap:8px!important;padding:env(safe-area-inset-top,0px) calc(12px + env(safe-area-inset-right,0px)) 0 calc(12px + env(safe-area-inset-left,0px))!important;min-height:calc(56px + env(safe-area-inset-top,0px))!important;height:calc(56px + env(safe-area-inset-top,0px))!important;flex:0 0 calc(56px + env(safe-area-inset-top,0px))!important;z-index:45;overflow:visible!important}
 .topbar-title{width:auto!important;min-width:0;display:flex;flex-direction:row;align-items:center;gap:5px}
 .topbar-title time,.topbar-title .separator{display:none!important}
 .topbar-actions{width:auto!important;min-width:0;display:flex!important;align-items:center;justify-content:flex-end;gap:1px!important;flex-wrap:nowrap!important}
 .topbar .icon-button{width:35px!important;height:35px!important;min-width:35px!important;display:grid}
 .topbar .global-settings-button{display:grid!important}
 .topbar .avatar{width:35px!important;height:35px!important;min-width:35px!important}
 .topbar .top-version{display:none!important}
 #mainArea{padding:21px 14px calc(94px + env(safe-area-inset-bottom))!important;scroll-padding-bottom:calc(94px + env(safe-area-inset-bottom));overflow-x:clip}
 #mainArea>.page{width:100%;min-width:0;max-width:100%}
 .hm-page-heading{display:flex;flex-direction:column;align-items:stretch;gap:17px;margin-bottom:19px}
 .hm-page-heading h1{font-size:34px;margin:9px 0 7px}
 .hm-page-heading p{font-size:13px}
 .hm-heading-actions{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .hm-heading-actions button{min-width:0;width:100%;white-space:normal}
 .hm-period-picker{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;gap:8px}
 .hm-period-picker label,.hm-period-picker select,.hm-period-picker label:last-child select{width:100%;min-width:0}
 .hm-position{padding:24px 20px;min-height:217px;border-radius:15px}
 .hm-position-number{font-size:clamp(37px,9vw,53px)}
 .hm-position h2{font-size:13px}
 .hm-position p{font-size:12px;margin-top:13px}
 .hm-position-mark{width:185px;right:-48px}
 .hm-stat-grid.hm-stat-three{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
 .hm-stat-grid.hm-stat-three>.hm-stat:last-child:nth-child(odd){grid-column:1/-1}
 .hm-stat-grid.hm-stat-four{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
 .hm-stat{padding:16px 15px;gap:7px}
 .hm-stat>strong{font-size:clamp(19px,5.8vw,27px)}
 .hm-stat>span{font-size:11px}
 .hm-overview-strip{grid-template-columns:minmax(0,1fr);margin-bottom:23px}
 .hm-overview-strip>div{padding:12px 15px}
 .hm-overview-strip>div:not(:last-child){border-right:0;border-bottom:1px solid var(--hm5-line)}
 .hm-action-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
 .hm-action-row button{width:100%;min-width:0;white-space:normal;padding:11px}
 .hm-action-row button:first-child{grid-column:1/-1}
 .hm-quick-section{margin:23px 0}
 .hm-next-step{display:grid;grid-template-columns:42px minmax(0,1fr);gap:11px;padding:16px 0}
 .hm-next-step>.hm-text-action{grid-column:2;justify-self:start}
 .hm-next-mark{padding:9px;font-size:20px}
 .hm-surface{padding:17px 15px;border-radius:13px;margin:15px 0}
 .hm-section-heading{margin:0 0 16px;flex-wrap:wrap}
 .hm-section-heading h2{font-size:21px}
 .hm-pay-item{grid-template-columns:minmax(0,1fr) auto;gap:7px;padding:14px 0}
 .hm-pay-item button{grid-column:1/-1;justify-self:start}
 .hm-pay-item .hm-pay-amount{font-size:15px}
 .hm-work-history .work-table-head{display:none}
 .hm-work-history .work-row{grid-template-columns:minmax(0,1fr) auto!important;gap:7px}
 .hm-work-history .work-row .row-left{grid-column:1;grid-row:1}
 .hm-work-history .work-row .value{grid-column:2;grid-row:1}
 .hm-work-history .work-row .hours{grid-column:1;grid-row:2;margin-left:0}
 .hm-work-history .work-row .status{grid-column:1;grid-row:3;text-align:left}
 .hm-work-history .work-row .work-edit-button{grid-column:2;grid-row:3}
 .hm-filter-bar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
 .hm-filter-bar label{min-width:0;width:100%}
 .hm-filter-bar :is(input,select){width:100%;min-width:0}
 .hm-expense-filters label:first-child{grid-column:1/-1}
 .hm-expense-filters label:last-child{grid-column:1/-1}
 .hm-trends-controls{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:end}
 .hm-trends-controls select{width:100%}
 .hm-trend-chart .trends-chart{min-height:174px;gap:4px}
 .hm-trend-chart .trends-legend{gap:8px;flex-wrap:wrap}
 .hm-trend-details{grid-template-columns:1fr}
 .hm-trend-metrics .hm-stat>strong{font-size:19px}
 .hm-settings-shortcuts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
 .hm-settings-shortcuts :is(a,button){min-width:0;text-align:center;white-space:normal}
 .mobile-nav{
  position:fixed;display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;
  left:env(safe-area-inset-left);right:env(safe-area-inset-right);bottom:0;z-index:60;
  padding:7px 8px calc(8px + env(safe-area-inset-bottom));
  background:var(--hm5-side);border-top:1px solid var(--hm5-line);
  box-shadow:0 -12px 25px #04090977;backdrop-filter:blur(16px)
 }
 .mobile-nav button{
  min-width:0;min-height:49px;display:grid;justify-items:center;align-content:center;gap:2px;
  border-radius:10px;color:var(--hm5-muted);background:transparent;font-size:10px;font-weight:750;padding:5px 1px
 }
 .mobile-nav button>span{font-size:22px;line-height:1.15;height:25px;display:grid;place-items:center}
 .mobile-nav button.active,.mobile-nav button[aria-current=page]{background:color-mix(in srgb,var(--hm-accent) 9%,transparent);color:var(--hm5-gold)}
 .hm-work-breakdown .work-payment-breakdown{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
 .hm-work-breakdown .work-status-box{padding:10px 8px}
 .hm-work-breakdown .work-status-box strong{font-size:16px;overflow-wrap:anywhere}
}
@media(max-width:380px){
 .hm-stat-grid.hm-stat-three,.hm-stat-grid.hm-stat-four{grid-template-columns:minmax(0,1fr)!important}
 .hm-stat-grid.hm-stat-three>.hm-stat:last-child:nth-child(odd){grid-column:1}
 .hm-position-number{font-size:36px}
 .hm-filter-bar{grid-template-columns:1fr}
 .hm-trend-metrics .hm-stat{padding:12px}
}
@media(prefers-reduced-motion:reduce){.page.active{animation:none!important}}

/* 5.0.1 — Mobile viewport and topbar Giving utility.
   Match the screen under Safari's bottom safe area, not an old 100vh canvas. */
.topbar .hm-giving-shortcut{
  width:auto;min-width:41px;display:inline-flex;align-items:center;gap:8px;
  padding:0 12px;border:1px solid var(--hm5-line)!important;border-radius:10px!important;
  background:var(--hm-soft)!important;color:var(--hm-accent)!important;
}
.topbar .hm-giving-shortcut:hover,.topbar .hm-giving-shortcut:focus-visible,
.topbar .hm-giving-shortcut[aria-current="page"]{
  background:color-mix(in srgb,var(--hm-accent) 15%,transparent)!important;border-color:var(--hm-accent)!important;
}
.hm-giving-label{font-size:11px;font-weight:750;letter-spacing:.015em}
@media(max-width:640px){
  html,body{
    width:100%;height:100%!important;height:100dvh!important;
    min-height:0!important;padding:0!important;margin:0!important;box-sizing:border-box;
    background:var(--hm5-bg)!important;
    overflow:hidden!important;overscroll-behavior:contain;
  }
  body{display:flex!important;flex-direction:column!important}
  .preview-ribbon{display:none!important}
  .app-shell{
    display:flex!important;flex-direction:column!important;
    background:var(--hm5-bg)!important;flex:1 1 0%!important;
    height:auto!important;min-height:0!important;max-height:none!important;
    overflow:hidden!important;
  }
  .app-main{
    display:flex!important;flex-direction:column!important;flex:1 1 0%!important;
    height:auto!important;min-height:0!important;background:var(--hm5-bg)!important;
  }
  #mainArea{
    flex:1 1 0%!important;min-height:0!important;
    background:var(--hm5-bg)!important;
    /* Reserve exactly the bottom bar height, not an extra full inset. */
    padding-bottom:calc(59px + env(safe-area-inset-bottom,0px))!important;
    scroll-padding-bottom:calc(59px + env(safe-area-inset-bottom,0px))!important;
    overflow-y:auto!important;-webkit-overflow-scrolling:touch;
    overscroll-behavior-y:contain;
  }
  #mainArea>.page.active{min-height:100%;min-width:0}
  .app-main>.footer{display:none!important}
  /* The bar background reaches the physical viewport edge. Its tap targets remain
     above the home indicator, without the old extra vertical padding. */
  .mobile-nav{
    position:fixed!important;left:0!important;right:0!important;bottom:0!important;z-index:60;
    box-sizing:border-box;width:100%;min-height:0!important;
    padding:3px calc(8px + env(safe-area-inset-right,0px)) max(4px,env(safe-area-inset-bottom,0px)) calc(8px + env(safe-area-inset-left,0px))!important;
    background:var(--hm5-side)!important;
    box-shadow:0 -2px 12px #00000026!important;backdrop-filter:none!important;
  }
  .mobile-nav button{min-height:44px!important;padding:2px 1px!important}
  .alert-panel{top:calc(60px + env(safe-area-inset-top,0px))!important;max-height:calc(100dvh - 80px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))!important}
  .toast{bottom:calc(59px + env(safe-area-inset-bottom,0px))!important}
  #mainArea>.topo-art{pointer-events:none;opacity:.09!important}
  .page.active{animation:none!important;opacity:1!important}
  .topbar .hm-giving-shortcut{
    flex:0 0 35px;min-width:35px!important;
    width:35px!important;height:35px!important;padding:0!important;
    justify-content:center;border-radius:10px!important;
  }
  .topbar .hm-giving-shortcut .hm-giving-label{display:none}
  .topbar-actions{min-width:0!important}
}
/* 5.0.5: measured PWA layout height replaces the brittle safe-area expansion.
   The iOS home indicator is protected inside the navigation, never by an extra
   page-sized spacer or a hard-coded negative inset. */
@media(max-width:640px){
 html,body{
  height:var(--hm-mobile-height,100dvh)!important;
  max-height:var(--hm-mobile-height,100dvh)!important;
 }
 .app-shell{
  height:var(--hm-mobile-height,100dvh)!important;
  max-height:var(--hm-mobile-height,100dvh)!important;
 }
 .mobile-nav{
  bottom:calc(-1 * var(--hm-mobile-gap,0px))!important;
  padding-bottom:max(8px,env(safe-area-inset-bottom,0px))!important;
 }
 /* Compact phone header: one readable row, not seven desktop controls. */
 .topbar{
  height:calc(52px + env(safe-area-inset-top,0px))!important;
  min-height:calc(52px + env(safe-area-inset-top,0px))!important;
  flex-basis:calc(52px + env(safe-area-inset-top,0px))!important;
 }
 .topbar-title{
  flex:1 1 auto!important;width:auto!important;min-width:0!important;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
 }
 .topbar-actions{
  width:auto!important;flex:0 0 auto!important;
  gap:4px!important;justify-content:flex-end!important;
 }
 .topbar .icon-button,.topbar .avatar{
  height:34px!important;width:34px!important;min-width:34px!important;
 }
 .topbar .hm-giving-shortcut{
  width:34px!important;min-width:34px!important;flex-basis:34px!important;
 }
 .topbar .topbar-verse-button,.topbar [data-admin-nav]{display:none!important}
 .topbar [hidden]{display:none!important}
 #mainArea{
  padding-bottom:calc(72px + env(safe-area-inset-bottom,0px))!important;
  scroll-padding-bottom:calc(72px + env(safe-area-inset-bottom,0px))!important;
 }
 .alert-panel{
  top:calc(56px + env(safe-area-inset-top,0px))!important;
 }
}
@media(max-width:359px){
 #quickFindButton{display:none!important}
}

@media(max-width:380px){
  #quickFindButton{display:none!important}
  .topbar .hm-giving-shortcut{width:32px!important;min-width:32px!important;flex-basis:32px}
}
