/* Shared responsive layer, loaded after the desktop styles in both documents. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
#workspace{display:flex;flex-direction:column;height:100vh;height:100dvh;min-height:0;overflow:hidden}
#workspace>.cloudbar,#workspace>#accessNotice,#workspace>#syncAlert{flex:none}
#workspace>#budgetFrame{flex:1 1 0%;min-height:0;height:auto}
#workspaceMenu{display:none}
@media(max-width:960px){
  /* 16px controls avoid Safari focus zoom without disabling pinch zoom. */
  input,select,textarea{font-size:16px!important;min-width:0;max-width:100%}
  input[type=date]{min-height:44px}
  button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}
  button{touch-action:manipulation}
  p,small,label,b,strong,h1,h2,h3{overflow-wrap:break-word}
  .panel{width:calc(100% - 24px);margin:24px auto;padding:24px 20px;border-radius:20px;min-width:0}
  .panel h1{font-size:30px;line-height:1.15}.panel .wordmark{margin-bottom:18px}
  .panel p,#signedAs{overflow-wrap:anywhere}
  .panel button{min-height:44px;max-width:100%;white-space:normal}
  #createForm>button,#joinOffer>button{width:100%;margin:8px 0 0}
  .spaceRow{align-items:stretch}.spaceRow>[data-space]{min-width:0;overflow-wrap:anywhere}
  .cloudbar{display:grid;grid-template-columns:minmax(0,1fr) auto 48px;column-gap:8px;row-gap:2px;padding:8px 12px;min-height:78px}
  .cloudbar>label{grid-column:1;grid-row:1/3;min-width:0;font-size:10px;line-height:1.2;margin:0}
  .cloudbar select{width:100%;max-width:100%;min-height:42px;margin-top:4px;padding:7px 26px 7px 9px}
  .cloudbar>#role{grid-column:2;grid-row:1;justify-self:end;font-size:10px;padding:4px 7px;white-space:nowrap}
  .cloudbar>#saveStatus{grid-column:2;grid-row:2;justify-self:end;max-width:90px;text-align:right;font-size:10px;line-height:1.3;overflow-wrap:break-word}
  #workspaceMenu{display:block;grid-column:3;grid-row:1/3;min-height:44px;padding:6px 2px;font-size:11px;border-radius:10px;background:#f3f7f1}
  .cloudbar>.barActions{display:none;position:absolute;right:12px;top:calc(100% - 2px);z-index:30;grid-template-columns:1fr;width:230px;max-width:calc(100vw - 24px);margin:0;padding:8px;background:#fff;border:1px solid #dce5d8;border-radius:14px;box-shadow:0 12px 35px #173b3126;gap:4px}
  .cloudbar.menu-open>.barActions{display:grid}
  .barActions button{width:100%;text-align:left;min-height:44px;font-size:14px;padding:10px 12px;border:0;white-space:normal}
  .accessNotice,#syncAlert{padding:10px 12px;font-size:12px;max-height:30dvh;overflow:auto}
  .accessNotice button,#syncAlert button{min-height:40px;font-size:12px}
  dialog{width:calc(100% - 24px);padding:22px 18px;border-radius:18px;max-height:calc(100dvh - 24px);overflow:auto}
  dialog h2{font-size:23px;margin:0 35px 12px 0;line-height:1.2}.dialogClose{min-width:40px;min-height:40px;margin:-8px -6px 0 0}
  dialog button{min-height:44px;white-space:normal}.memberRow{gap:8px}.memberRow>div{min-width:0;flex-basis:100%;overflow-wrap:anywhere}.memberRow select{flex:1;max-width:none;min-height:44px}
  #inviteLink{font-size:16px!important}#deleteForm>button,#restoreDialog>button{margin-top:8px}
  .app,.main,.grid>div,.layout>div,.v2-flow,.v2-start-inner,.v2-pane,.v2-form>*,.v2-summary>div{min-width:0;max-width:100%}
  .app{display:block}.side{display:none}.main{padding:16px 14px calc(94px + env(safe-area-inset-bottom))}
  .top{display:block;margin-bottom:20px}.breadcrumbs{font-size:11px;margin-bottom:12px}.top-actions{display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:8px;align-items:center}
  .top-actions #v2Mode{display:block;grid-column:1/-1;grid-row:2;justify-self:start;font-size:11px;padding:7px 10px;white-space:normal}
  .top-actions #period.chip{display:block;width:100%;max-width:none;min-width:0;min-height:44px;padding:8px 5px;font-size:16px!important}
  .bills-bell{height:44px;min-width:44px}.top-actions .primary{min-height:44px;padding:10px 12px;font-size:12px}
  .heading{gap:12px;align-items:flex-start;flex-wrap:wrap}.heading h1{font-size:27px;line-height:1.2;letter-spacing:-.8px}.heading .preview{font-size:10px}
  .grid,.layout,.dual{grid-template-columns:minmax(0,1fr);gap:16px}
  .hero{padding:22px 20px;min-height:0}.hero-top{align-items:flex-start;gap:10px}.hero-top>span:last-child{font-size:10px;flex:none}
  .hero .big{font-size:clamp(36px,11vw,52px);letter-spacing:-1.5px;overflow-wrap:anywhere;margin-top:25px}.hero .big small{font-size:16px}
  .hero p{line-height:1.6;margin-bottom:18px}.hero-bottom{gap:8px}.hero-pill{white-space:normal;line-height:1.5}.hero-link{padding:8px 0;min-height:40px}
  .card{padding:19px 17px;border-radius:18px}.sectionhead{gap:10px;align-items:flex-start;flex-wrap:wrap}.sectionhead>div{min-width:0}.sectionhead button{min-height:36px;padding:6px 0;flex-shrink:0}.sectionnote{line-height:1.5}
  .summary{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.metric{padding:12px 9px;min-width:0}.metric strong{font-size:clamp(15px,4.6vw,20px);overflow-wrap:anywhere}.metric label{font-size:10px;line-height:1.4}.metric small{font-size:10px;line-height:1.4}
  .wide-grid{grid-template-columns:minmax(0,1fr);gap:10px}.wide-grid .tile{padding:17px 18px}.tile strong{font-size:26px;overflow-wrap:anywhere}
  .cat-left{min-width:0}.cat-left>div{min-width:0}.cat-icon{flex:none}.cat-sub{line-height:1.5}.cat-amount{flex:none;max-width:45%;white-space:normal}.cat-amount strong{overflow-wrap:anywhere}
  .debt-mini>span,.itemrow>div,.activityrow .grow{min-width:0}.debt-mini b,.itemrow strong{overflow-wrap:anywhere}.activityrow{flex-wrap:wrap;gap:9px}.activityrow .grow{flex:1 1 120px}.activityrow .amt{margin-left:auto}.activityrow small{line-height:1.5}
  .v2-activity-actions{flex-basis:100%;justify-content:flex-end}.v2-activity-actions button{min-height:40px;padding:8px 12px}.v2-toolbar button{min-height:42px;white-space:normal}
  .savings-hero{padding:20px 16px;flex-wrap:wrap}.savings-hero strong{font-size:30px;overflow-wrap:anywhere}.card-details{grid-template-columns:minmax(0,1fr)}.card-details strong{overflow-wrap:anywhere}
  .v2-start{padding:16px 12px 28px;overscroll-behavior-y:contain}.v2-start-top{gap:12px;margin:0 4px 16px;align-items:center}.v2-start-top>.v2-caption{max-width:120px;text-align:right;font-size:9px;line-height:1.5}
  .v2-flow{display:block}.v2-steps{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:4px;padding:7px;margin-bottom:12px;overflow:visible;border-radius:14px}.v2-step{font-size:0;gap:0;padding:6px 0;justify-content:center;min-width:0}.v2-step b{font-size:11px;width:26px;height:26px}
  .v2-pane{padding:23px 18px;border-radius:18px;min-height:0}.v2-pane h1{font-size:28px;line-height:1.16;letter-spacing:-.9px}.v2-pane p{font-size:14px;line-height:1.6}.v2-caption{font-size:10px;line-height:1.5}
  .v2-form,.v2-checkin-grid,.v2-budgets,.v2-summary{grid-template-columns:minmax(0,1fr)}.v2-form label{font-size:12px}.v2-form input,.v2-form select{height:46px;line-height:normal}.v2-field-help{font-size:12px;line-height:1.5}
  .v2-choice-grid{grid-template-columns:minmax(0,1fr)}.v2-choice{padding:17px 15px;min-width:0;white-space:normal}.v2-choice b{font-size:15px}.v2-choice small{font-size:12px}.v2-note{font-size:12px;line-height:1.6}
  .v2-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;align-items:stretch}.v2-actions button{min-width:0;min-height:46px;padding:10px;white-space:normal}.v2-actions>.v2-mini{grid-column:1/-1;grid-row:1;font-size:11px;text-align:center}.v2-actions>#v2Next{grid-column:1/-1}.v2-actions>#v2Back:only-of-type{grid-column:1/-1}
  .v2-budget-summary{position:static}.v2-allocation-totals{gap:5px}.v2-allocation-totals>div{padding:11px 7px;border-radius:9px}.v2-allocation-totals strong{font-size:16px}.v2-allocation-totals small{font-size:10px}.v2-budget-period{line-height:1.6}.v2-budget-status{font-size:12px}
  .v2-budgets .v2-budget{grid-template-columns:minmax(0,1fr) 92px;padding:12px 10px;min-width:0}.v2-budget input{width:92px;height:44px!important}.v2-budget>button{min-height:38px}.v2-setup-item,.v2-extra-card{padding:14px 12px}
  .modal,.v2-overlay{padding:10px;align-items:center;overscroll-behavior:contain}.modal-panel,.v2-dialog{max-width:100%;width:100%;max-height:calc(100dvh - 20px);padding:22px 18px;border-radius:18px;overscroll-behavior:contain;scroll-padding:16px}
  .formgrid{grid-template-columns:minmax(0,1fr);gap:15px}.field input,.field select{height:46px}.field{font-size:12px}.modalhead h2{font-size:24px}.close{width:40px;height:40px;flex:none}
  .types{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:18px 0}.types button{min-height:44px;font-size:12px;padding:10px 8px}
  .form-actions{display:grid;grid-template-columns:1fr 1fr}.form-actions button{min-height:46px;white-space:normal}
  .bills-presets{grid-template-columns:minmax(0,1fr)}.bills-presets button{min-height:58px;padding:15px}.bills-check{font-size:13px}.bills-check input{min-width:20px;min-height:20px}.bills-row-actions button{min-height:40px;font-size:11px}.bills-entry-link{min-height:40px;max-width:none}
  .mobilebar{display:flex;position:fixed;bottom:0;left:0;right:0;background:#fff;border-top:1px solid var(--line);justify-content:space-around;align-items:center;height:calc(66px + env(safe-area-inset-bottom));padding:0 5px env(safe-area-inset-bottom);gap:2px;z-index:8}.mobilebar button{min-width:0;flex:1;min-height:52px;font-size:10px;line-height:1.3}.mobilebar .add-circle{margin-top:-16px;width:42px;height:42px}
  .toast{left:14px;right:14px;bottom:calc(80px + env(safe-area-inset-bottom));font-size:13px;line-height:1.5;padding:12px 14px}.v2-banner{font-size:12px;line-height:1.6}.v2-banner button{min-height:40px;margin-top:5px}
}
.mobile-pages{border:1px solid #dce5d8;background:#fff;color:#173b31}.mobile-pages::backdrop{background:#102d2380}.mobile-pages header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.mobile-pages h2{margin:0;font-size:23px}.mobile-pages #mobileClose{border:0;background:#f3f7f1;border-radius:10px;min-width:40px;min-height:40px;font-size:23px;color:#173b31}.mobile-pages nav{display:grid;gap:8px;margin-top:18px}.mobile-pages nav button{display:block;width:100%;text-align:left;background:#f4f8f4;color:#173b31;border:1px solid #dfe9e2;border-radius:12px;padding:14px}.mobile-pages nav b{display:block;font-size:14px}.mobile-pages nav small{display:block;font-size:12px;color:#607772;line-height:1.5;margin-top:5px}
@media(max-width:960px){
  /* Only the active setup/dialog scrolls; the covered dashboard stays still. */
  body:has(#v2Start:not(.v2-hidden)),body:has(.modal.open),body:has(.v2-overlay),body:has(dialog[open]){overflow:hidden}
  body:has(#v2Start:not(.v2-hidden)) .mobilebar{display:none}
}

@media(min-width:761px) and (max-width:960px){.mobilebar button{display:grid;justify-items:center;gap:5px;border:0;background:none;color:#879491;font-weight:700}.mobilebar button.active{color:#186b65}.mobilebar svg{width:20px;height:20px}.mobilebar .add-circle{background:#176b62;color:#fff;border-radius:50%;display:grid;place-items:center;font-size:25px}}
@media(max-width:960px){
  /* The save indicator and More menu already cover these dashboard hints. */
  #overview>.v2-banner,#overview>.heading .preview,#overview>.heading .eyebrow{display:none}
  #overview>.heading{margin-bottom:18px}#overview>.heading h1{font-size:25px}#overview>.heading .sub{font-size:12px}
}
