/* A quieter hierarchy: current balance, commitments, then exploration. */
:root{--bg:#f7f8f6;--line:#dfe5e1;--soft:#eef3f0;--surface-soft:#f4f6f4}
body{background:var(--bg)}
.card,.future-page .card,.closing-page .card{box-shadow:none;border-color:var(--line)}
.shell>header{background:#f7f8f6f5}
.amount,.value,.projection-amount,.focus-amount,.focus-breakdown dd,.daily-forecast-summary strong{font-variant-numeric:tabular-nums lining-nums}
.amount-heading,td.amount{text-align:right}
.dashboard-focus.card{background:#194f58;box-shadow:none}
.dashboard-focus .focus-balances{grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);align-items:center;gap:32px}
.dashboard-focus .focus-primary .focus-amount{font-size:clamp(36px,4.2vw,58px);font-weight:500;letter-spacing:-1.6px;margin:12px 0}
.dashboard-focus .focus-primary .focus-amount.is-large{font-size:clamp(28px,3.1vw,42px)}
.dashboard-focus .focus-primary .focus-amount.is-very-large{font-size:clamp(23px,2.5vw,34px)}
.focus-primary h3{font-size:12px;font-weight:400;color:#d1e2de}
.focus-primary .focus-caption{max-width:48ch;line-height:1.65}
.focus-projection{min-width:0;border-left:1px solid #ffffff26;padding-left:28px}
.focus-projection summary{cursor:pointer;list-style:none;display:flex;flex-direction:column;gap:10px;min-height:44px;color:#deebe6;font-size:12px;line-height:1.6}
.focus-projection summary::-webkit-details-marker{display:none}
.projection-amount{font-size:clamp(23px,2.4vw,32px);font-weight:500;color:#f0f6f3;overflow-wrap:anywhere;line-height:1.35}
.projection-toggle{display:flex;align-items:center;gap:6px;font-size:11px;text-decoration:underline;text-underline-offset:4px}
.projection-toggle .icon{width:14px;height:14px;transform:rotate(90deg)}
.focus-projection[open] .projection-toggle .icon{transform:rotate(-90deg)}
.focus-projection .focus-caption{margin:14px 0 0;font-size:12px}
.dashboard-focus .focus-footer{margin-top:24px;padding-top:18px}
.focus-breakdown summary{min-height:44px;display:flex;align-items:center}
.dashboard-focus .focus-breakdown .free-total{background:#ffffff0c;color:#fff}
.dashboard-focus .focus-breakdown .free-total dd{color:#fff}
.overview-due{margin:14px 0 20px}
.overview-due .due-overview{margin:0;border-radius:12px;box-shadow:none}
.overview-due .due-overview.calm{background:transparent;border-color:var(--line)}
.overview-due .due-overview p{line-height:1.65}
.overview-cards .metric{box-shadow:none;min-height:118px;background:#fff}
.overview-cards .metric .value{font-size:26px}
.dashboard-customize{padding:0 0 8px;margin-bottom:12px}
.transaction-card{box-shadow:none;border-color:var(--line)}
.transaction-meta{line-height:1.7}
.entry-primary-actions>button,.transaction-actions button{min-height:44px}
#mobile-nav button{min-width:0}
#mobile-nav button.active{background:#e9f1ed;color:#194f58}
#mobile-nav button.active .icon{stroke-width:2.2}
#toast{bottom:calc(154px + env(safe-area-inset-bottom));max-width:calc(100vw - 32px)}
@media(min-width:801px){#toast{bottom:24px}}
@media(max-width:800px){
  .shell>main{padding-top:20px;padding-bottom:calc(150px + env(safe-area-inset-bottom))}
  body[data-view=overview] .pagehead{border-bottom:0;padding-bottom:0;margin-bottom:14px;align-items:center}
  body[data-view=overview] .pagehead h1{font-size:25px;line-height:1.25;margin:0 0 6px}
  body[data-view=overview] .pagehead .eyebrow{display:none}
  body[data-view=overview] .pagehead p{font-size:12px;line-height:1.6;margin:0}
  body[data-view=overview] .pagehead #add{padding:9px 12px;min-height:44px}
  body[data-view=overview] .toolbar{margin-bottom:16px}
  .dashboard-focus.card{padding:22px!important}
  .dashboard-focus .focus-balances{grid-template-columns:minmax(0,1fr);gap:18px;margin-top:18px}
  .dashboard-focus .focus-primary .focus-amount{font-size:clamp(35px,9.5vw,46px);margin:10px 0}
  .dashboard-focus .focus-primary .focus-amount.is-large{font-size:29px}
  .dashboard-focus .focus-primary .focus-amount.is-very-large{font-size:22px}
  .focus-primary .focus-caption{font-size:12px;line-height:1.65}
  .focus-projection{border-left:0;border-top:1px solid #ffffff26;padding:15px 0 0}
  .focus-projection summary{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:4px 12px;align-items:center}
  .projection-amount{font-size:22px;text-align:right;grid-column:2;grid-row:1 / span 2}
  .projection-toggle{font-size:10px}
  .dashboard-focus .focus-footer{margin-top:18px;padding-top:14px;gap:10px}
  .dashboard-focus .focus-footer>span{font-size:10px;line-height:1.65}
  .focus-link{min-height:44px}
  .overview-due{margin:12px 0 16px}
  .overview-due .due-overview{padding:15px;gap:10px;flex-wrap:wrap}
  .overview-due .due-overview>div{flex:1;min-width:0}
  .overview-due .due-overview>button{min-height:44px}
  .overview-cards .metric{padding:16px;min-height:0}
  .overview-cards .metric .value{font-size:24px}
  .overview-cards .metric .label{font-size:12px}
  .daily-quick-add:not([hidden]){bottom:calc(82px + env(safe-area-inset-bottom));min-height:48px;padding:12px 20px;background:#194f58;box-shadow:0 4px 16px #194f5826}
  #mobile-nav{padding-bottom:env(safe-area-inset-bottom);background:#fffffff5;border-top-color:var(--line)}
  #mobile-nav button{min-height:54px;font-size:10px}
  #mobile-more{bottom:calc(74px + env(safe-area-inset-bottom))}
  .transaction-top{gap:12px;align-items:flex-start}
  .transaction-top>strong{min-width:0;overflow-wrap:anywhere}
  .transaction-top>.amount{margin-left:auto;text-align:right;max-width:55%;overflow-wrap:anywhere}
}
@media(max-width:360px){
  .dashboard-focus.card{padding:18px!important}
  .focus-projection summary{grid-template-columns:1fr}
  .projection-amount{grid-column:1;grid-row:auto;text-align:left}
  .projection-toggle{grid-row:3}
  .overview-cards .metric .value{font-size:22px}
}

.focus-breakdown summary::after{content:"+";margin-left:auto;font-size:18px;padding-left:12px}
.focus-breakdown[open] summary::after{content:"−"}
.dashboard-section:empty{display:none}

/* Phone layout: one persistent action, less chrome and single-column forms. */
@media(max-width:800px){
  .shell>header{height:56px;padding-inline:16px;gap:8px}
  .headerend{gap:8px;min-width:0}
  .headerend .reminder-header{display:none}
  .headerend .localbadge{font-size:10px;padding:4px 6px;max-width:132px;line-height:1.5}
  .brand-header{font-size:23px;gap:6px}
  .brand-header img{width:27px;height:27px}
  .shell>main{padding-top:14px;padding-bottom:calc(96px + env(safe-area-inset-bottom))}
  .pagehead{margin-bottom:12px;padding-bottom:12px}
  .pagehead #add{display:none}
  body[data-view=overview] .pagehead h1{font-size:23px;margin-bottom:4px}
  body[data-view=overview] #quicktabs{display:none}
  body[data-view=overview] .toolbar{justify-content:flex-end;margin:0 0 12px}
  .monthcontrol{padding:0 2px;gap:0;min-height:44px}
  .monthcontrol button{min-width:44px;min-height:44px}
  .monthcontrol input{width:145px;max-width:calc(100vw - 140px);min-height:44px;font-size:16px}
  .overview-cards,.overview-cards.has-large-values{display:flex;flex-direction:column;gap:0;border-block:1px solid var(--line);padding-block:6px}
  .overview-cards .monthly-summary-heading{margin:0;padding:10px 0 12px;align-items:flex-start;flex-wrap:wrap;gap:4px}
  .overview-cards .metric{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:4px 12px;align-items:center;border:0;border-radius:0;border-top:1px solid var(--line);padding:13px 0;background:transparent;min-height:0}
  .overview-cards .metric .label{font-size:12px;gap:8px;justify-content:flex-start}
  .overview-cards .metric .value,.overview-cards .metric .long-value,.overview-cards .metric .compact-value{grid-column:2;grid-row:1 / span 2;font-size:clamp(17px,4.6vw,22px)!important;margin:0;letter-spacing:-.5px;text-align:right;overflow-wrap:anywhere}
  .overview-cards .metric .hint{font-size:11px;line-height:1.5;margin:0;grid-column:1}
  .overview-cards .metricicon{width:26px;height:26px;padding:4px;flex-shrink:0}
  .overview-cards .metricicon .icon{width:16px;height:16px}
  .daily-quick-add{display:none!important}
  #mobile-nav{padding:5px 5px calc(5px + env(safe-area-inset-bottom));gap:3px}
  #mobile-nav button{font-size:10px;min-height:54px;gap:4px;overflow-wrap:anywhere}
  #mobile-nav button.mobile-add{background:#194f58;color:white;font-weight:600;border-radius:12px}
  #mobile-nav button.mobile-add:disabled{opacity:.5}
  #mobile-nav button.mobile-add .icon{width:23px;height:23px}
  #mobile-more{max-height:calc(100dvh - 140px - env(safe-area-inset-bottom));overflow:auto;overscroll-behavior:contain;width:min(310px,calc(100vw - 24px));bottom:calc(76px + env(safe-area-inset-bottom))}
  .mobile-utilities{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding-bottom:12px;border-bottom:1px solid var(--line);margin-bottom:8px}
  #mobile-more .mobile-utilities button{display:flex;align-items:center;justify-content:center;gap:7px;background:#eef3f0;border-radius:8px;font-size:12px;padding:10px 7px;min-height:44px}
  #mobile-more .mobile-utilities .icon{width:17px;height:17px;flex-shrink:0}
  #toast{bottom:calc(82px + env(safe-area-inset-bottom))}
  body:has(#dialog[open],#studio-dialog[open]) #mobile-nav,body:has(#dialog[open],#studio-dialog[open]) #mobile-more{visibility:hidden}
  dialog#dialog,dialog#studio-dialog{position:fixed;top:calc(var(--mobile-viewport-top,0px) + 8px);bottom:auto;margin:0 auto;width:calc(100% - 16px);max-width:540px;max-height:calc(var(--mobile-viewport-height,100dvh) - 16px);padding:18px 16px 0;border-radius:14px;overflow-y:auto;overscroll-behavior:contain;scroll-padding-block:16px 90px}
  dialog .formgrid,dialog .entry-basics{grid-template-columns:minmax(0,1fr);gap:0}
  dialog input:not([type=checkbox]):not([type=radio]):not([type=hidden]),dialog select,dialog textarea{min-height:48px;font-size:16px;width:100%}
  dialog input[type=checkbox],dialog input[type=radio]{flex-shrink:0}
  dialog label{line-height:1.5}
  dialog .modalhead{margin-bottom:16px;padding-bottom:14px;gap:12px}
  dialog .modalhead .iconbtn{min-height:44px;min-width:44px}
  dialog .modalactions{position:sticky;bottom:0;margin:18px -16px 0;padding:12px 16px max(12px,env(safe-area-inset-bottom));background:#fffefb;border-top:1px solid var(--line);box-shadow:0 -6px 14px #194f5808;z-index:3;display:flex;flex-wrap:nowrap;gap:10px}
  dialog .modalactions button{min-height:48px;font-size:14px;flex:1;min-width:0;padding:10px;white-space:normal}
}
@media(max-width:360px){
  .headerend .localbadge{max-width:110px;font-size:9px}
  #mobile-nav button{font-size:9px}
  .overview-cards .metric .value{font-size:17px!important}
}

@media(max-width:800px){
  .overview-cards:has(.compact-value) .metric{grid-template-columns:minmax(0,1fr) minmax(0,1fr);min-height:0;gap:4px 12px;padding:13px 0}
  .overview-cards .metric .value{white-space:normal}
  html[data-density=compact] .overview-cards .metric{padding:10px 0}
}

/* Help remains available on every financial screen, above the mobile navigation. */
@media(max-width:800px){
  .floating-help-button{display:grid;right:16px;bottom:calc(82px + env(safe-area-inset-bottom));width:44px;height:44px;min-height:44px}
  .shell>main{padding-bottom:calc(140px + env(safe-area-inset-bottom))}
  #floating-help-panel{bottom:calc(136px + env(safe-area-inset-bottom));max-height:calc(100dvh - 158px - env(safe-area-inset-bottom))}
  #toast{bottom:calc(138px + env(safe-area-inset-bottom))}
}
