/* The frame: sidebar at 1024 px and wider, an icon rail on tablets, a tab bar on phones. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
/* An app, not a document: two quick taps are two taps, not a zoom (pinching still zooms). On every
   element, as WebKit starts again at each scrolling sheet; a chart or a grip that sets its own keeps it */
html,html *{touch-action:manipulation}
body.w{font-family:var(--w-font);color:var(--w-ink);font-size:var(--fs-sub);line-height:1.45}
:where(.w) a{color:inherit}
.w .pos{color:var(--w-good)}
.vh{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.tx-wait{background:var(--w-accent-soft);color:var(--w-accent-ink)}
:where(.w) button,:where(.w) input,:where(.w) select,:where(.w) textarea{font:inherit}
/* A field that takes its size from where it sits is still never under the smallest a field can be */
:where(.w) input,:where(.w) select,:where(.w) textarea{font-size:max(var(--field-min),1em)}
.w-boot{position:fixed;inset:0;display:grid;place-items:center;background:var(--w-canvas);z-index:5}
/* Only when nothing can be shown for a good while (a first visit on a very slow connection) */
.w-boot .w-mark{width:44px;height:44px;opacity:0;animation:w-pulse 1.4s var(--ease) 2s infinite forwards}
@keyframes w-pulse{0%,100%{opacity:.35;transform:scale(.96)}50%{opacity:1;transform:scale(1)}}
.w-mark.lg{width:44px;height:44px}
.w-banner{position:sticky;top:0;z-index:30;background:linear-gradient(var(--w-accent-soft),var(--w-accent-soft)) var(--w-canvas);color:var(--w-accent-ink);font-size:var(--fs-foot);font-weight:500;text-align:center;padding:7px 16px;padding-top:calc(7px + env(safe-area-inset-top,0px))}
.w-gatecard{max-width:420px;margin:12vh auto;padding:28px;background:var(--w-panel);border:1px solid var(--w-line);border-radius:var(--r-card);display:grid;gap:12px;justify-items:start}
.w-gatecard h1{font-size:var(--fs-title);font-weight:600;letter-spacing:-.02em}
.w-gatecard p{color:var(--w-ink2)}

/* ---------- app frame ---------- */
.w-app{display:grid;grid-template-columns:212px minmax(0,1fr);min-height:calc(100dvh - var(--banner-h,0px));background:var(--w-canvas)}
.w-app > .w-side{position:sticky;z-index:20;top:var(--banner-h,0px);height:calc(100vh - var(--banner-h,0px));height:calc(100dvh - var(--banner-h,0px));overflow-y:auto;overscroll-behavior:contain;gap:18px}
.w-app > .w-main{width:100%;max-width:1600px;margin-inline:auto;padding:28px 30px 40px;outline:0}
.w-brand{text-decoration:none}
.w-tabbar{display:none}
.w-pchips{display:none}
.w-ponly{display:none!important}

/* The top of the sidebar: Wally, and the button that folds it to an icon rail */
.w-sidehead{display:flex;align-items:center;justify-content:space-between;gap:6px}
.w-sidetog{width:30px;height:30px;display:grid;place-items:center;border-radius:var(--r-ctl);color:var(--w-ink3);flex:none}
.w-sidetog:hover{background:var(--w-fill);color:var(--w-ink)}
.w-sidetog svg.i{width:18px;height:18px}

/* The name of a place on the rail, in a small card beside it */
.w-sidehint{position:fixed;z-index:60;pointer-events:none;transform:translate(-4px,-50%);opacity:0;display:grid;gap:1px;padding:7px 12px;background:var(--w-raised);color:var(--w-ink);border:1px solid var(--w-line);border-radius:var(--r-card);box-shadow:var(--w-shadow);font-family:var(--w-font);font-size:var(--fs-sub);white-space:nowrap;transition:opacity .12s,transform .12s var(--ease)}
.w-sidehint.on{opacity:1;transform:translate(0,-50%)}
.w-sidehint b{font-weight:600}
.w-sidehint span{font-size:var(--fs-foot);color:var(--w-ink2)}
[dir="rtl"] .w-sidehint{transform:translate(4px,-50%)}
[dir="rtl"] .w-sidehint.on{transform:translate(0,-50%)}
@media (prefers-reduced-motion:reduce){.w-sidehint,.w-sidehint.on{transition:opacity .12s;transform:translate(0,-50%)}}

/* The foot of the sidebar: Settings, and who is signed in */
.w-sidefoot{margin-top:auto;display:grid;gap:6px}
.w-me{position:relative;border-top:1px solid var(--w-line);padding-top:10px}
.w-meb{display:flex;align-items:center;gap:6px;width:100%;padding-block:7px;padding-inline:6px 10px;border-radius:var(--r-ctl);font-weight:500;color:var(--w-ink);text-decoration:none;text-align:start}
.w-meb:hover{background:var(--w-fill)}
.w-meb .w-av{width:24px;height:24px}
/* Appearance, under Settings: a row like a place, with the theme on the right; its menu opens upward */
.w-thw{position:relative}
.w-thb{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border-radius:var(--r-ctl);color:var(--w-ink2);font-weight:500;text-align:start}
.w-thb:hover,.w-thb[aria-expanded="true"]{color:var(--w-ink)}
.w-thb svg.i{color:var(--w-accent)}
.w-thb .w-thv{margin-inline-start:auto;font-size:var(--fs-foot);font-weight:400;color:var(--w-ink3)}
/* On phones, the person menu: the three as a switch, drawn as every other one (.w-seg) */
.w-menuseg{gap:2px;padding:3px;margin:4px 4px 6px;border-radius:9px;background:var(--w-fill)}
.w-menuseg > button{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;padding:6px 4px;border-radius:7px;font-size:var(--fs-cap);color:var(--w-ink2)}
.w-menuseg > button svg.i{width:18px;height:18px}
.w-menuseg > button[aria-checked="true"]{background:var(--w-knob);color:var(--w-ink);font-weight:500;box-shadow:var(--w-knob-shadow)}
.w-menu.w-memenu{bottom:calc(100% + 4px);top:auto;inset-inline:0;min-width:0}

/* Menus: the person switch, the sidebar's person, the period and ••• menus */
.w-menu{position:absolute;z-index:30;top:calc(100% + 6px);inset-inline-end:0;min-width:220px;display:grid;gap:1px;padding:6px;background:var(--w-raised);border:1px solid var(--w-line);border-radius:var(--r-card);box-shadow:var(--w-shadow);text-align:start}
.w-menu:not(.w-memenu){border-radius:12px}
.w-menu[hidden]{display:none}
.w-menu > button,.w-menu > a{display:flex;align-items:center;gap:10px;min-height:34px;padding:0 10px;border-radius:7px;font-size:14px;font-weight:400;color:var(--w-ink);text-align:start;text-decoration:none;white-space:nowrap;width:100%}
.w-menu > button:hover,.w-menu > a:hover,.w-menu > :focus-visible{background:var(--w-fill)}
.w-menu > button svg.i,.w-menu > a svg.i{color:var(--w-ink2)}
.w-menu > button span:nth-child(3){margin-inline-start:auto;font-size:var(--fs-foot);color:var(--w-ink3);font-weight:400;padding-inline-start:12px}
.w-menu > [aria-checked="true"]{color:var(--w-accent-ink);font-weight:500}
.w-menu > [aria-checked="true"]::after{content:"";width:10px;height:6px;border-left:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(-45deg) translateY(-2px);margin-inline-start:auto;flex:none}
.w-menu > [aria-checked="true"] span:nth-child(3){display:none}
.w-menu > button .w-av{width:24px;height:24px}
/* A menu whose choices don't apply on this page (the person menu on Budget): the people greyed out, and why */
.w-menu > button:disabled{color:var(--w-ink3);cursor:default}
.w-menu > button:disabled:hover{background:none}
.w-menu > button:disabled .w-av{opacity:.45}
.w-menunote{margin:4px 0 0;padding:8px 10px 4px;border-top:1px solid var(--w-line2);font-size:var(--fs-foot);color:var(--w-ink2);max-width:240px}
.w-menusep{height:1px;background:var(--w-line2);margin:5px 8px}
/* With two faces for Everyone, each name starts where Everyone does, and an icon sits centred over a face */
.w-menu:has(.w-avpair) > :is(button,a) > .w-av:first-child{margin-inline-end:18px}
.w-menu:has(.w-avpair) > :is(button,a) > svg.i:first-child{margin-inline:4px 22px}

/* A page's own actions, top right: the person menu, then Add */
.w-hact{margin-inline-start:auto;display:flex;align-items:center;gap:8px;flex:none}
.w-hadd{height:40px;border-radius:999px;padding:0 16px;gap:6px}
.w-hadd svg.i{width:18px;height:18px;stroke-width:2.2}
.w-pswitch{position:relative;flex:none}
.w-pswitch-b{display:flex;align-items:center;gap:8px;height:40px;padding:0 12px 0 6px;border-radius:999px;background:var(--w-fill);color:var(--w-ink);font-weight:500}
.w-pswitch-b:hover{background:var(--w-fill2)}
.w-pswitch-b > svg.i{width:18px;height:18px;color:var(--w-ink2)}
.w-pswitch-b[aria-expanded="true"]{background:var(--w-fill2)}
.w-pswitch-b .w-av{width:22px;height:22px}

/* Everyone: two avatars, the second tucked under the first */
.w-avpair{display:inline-flex;flex:none}
.w-avpair > .w-av{box-shadow:0 0 0 2px var(--w-canvas)}
.w-avpair > .w-av + .w-av{margin-inline-start:-6px}
.w-menu .w-avpair > .w-av,.w-pchips .w-avpair > .w-av{box-shadow:0 0 0 2px var(--w-raised)}

/* ---------- folded by the person, at 1024 px and wider: the same icon rail as on tablets ---------- */
@media (min-width:1024px){
  .w-rail .w-app{grid-template-columns:64px minmax(0,1fr)}
  .w-rail .w-app > .w-side{padding:16px 8px;align-items:center}
  .w-rail .w-side .w-lbl,.w-rail .w-side .w-brand-t{display:none}
  .w-rail .w-sidehead{flex-direction:column;gap:12px}
  .w-rail .w-side .w-brand{padding:4px}
  .w-rail .w-sidetog{width:44px;height:44px}
  .w-rail .w-side .w-nav a{width:44px;height:44px;justify-content:center;padding:0}
  .w-rail .w-sidefoot{justify-items:center}
  .w-rail .w-meb{width:44px;height:44px;justify-content:center;padding:0}
  .w-rail .w-meb .w-av{width:28px;height:28px}
  .w-rail .w-thb{width:44px;height:44px;justify-content:center;padding:0}
  .w-rail .w-menu.w-memenu{position:fixed;inset-inline:72px auto;bottom:16px;min-width:200px}
}

/* With a mouse the top of the rail is just Wally: hovering it turns the mark into the expand button, named beside it.
   Without one (a touch screen) the button stays in view, or nobody would find it. */
@media (min-width:1024px) and (hover:hover){
  .w-rail .w-sidehead{position:relative;width:44px;height:44px;justify-content:center}
  .w-rail .w-side .w-mark{transition:opacity .12s}
  .w-rail .w-sidetog{position:absolute;inset:0;opacity:0;transition:opacity .12s}
  .w-rail .w-sidetog:hover{background:none}
  .w-rail .w-sidehead:hover .w-sidetog,.w-rail .w-sidetog:focus-visible{opacity:1}
  .w-rail .w-sidehead:hover .w-mark,.w-rail .w-sidehead:has(.w-sidetog:focus-visible) .w-mark{opacity:0}
}

/* ---------- 768 to 1023 px: an icon rail ---------- */
@media (max-width:1023px){
  .w-sidetog{display:none}
  .w-app{grid-template-columns:64px minmax(0,1fr)}
  .w-app > .w-side{padding:16px 8px;align-items:center}
  .w-side .w-lbl,.w-side .w-brand-t{display:none}
  .w-side .w-brand{padding:4px}
  .w-side .w-nav a{width:44px;height:44px;justify-content:center;padding:0}
  .w-sidefoot{justify-items:center}
  .w-meb{width:44px;height:44px;justify-content:center;padding:0}
  .w-meb .w-av{width:28px;height:28px}
  .w-thb{width:44px;height:44px;justify-content:center;padding:0}
  /* The rail is narrow: the person's menu opens beside it */
  .w-menu.w-memenu{position:fixed;inset-inline:72px auto;bottom:16px;min-width:200px}
  .w-app > .w-main{padding:20px 20px 40px}
}

/* ---------- under 768 px: a tab bar, large titles, sheets from the bottom ---------- */
@media (max-width:767px){
  :root{--fs-large:34px}
  body.w{font-size:var(--fs-sub)}
  .w-app{display:block}
  .w-app > .w-side{display:none}
  .w-ponly{display:flex!important}
  .w-menusep.w-ponly{display:block!important}
  .w-hadd{display:none}
  .w-app > .w-main{padding:8px 16px calc(var(--tabbar) + 40px + env(safe-area-inset-bottom,0px));padding-top:calc(8px + env(safe-area-inset-top,0px))}
  /* Four tabs in a frosted pill, with Add as a round button in the middle, inside the safe area */
  .w-tabbar{display:block;position:fixed;left:max(10px,env(safe-area-inset-left,0px));right:max(10px,env(safe-area-inset-right,0px));bottom:calc(10px + env(safe-area-inset-bottom,0px));z-index:40}
  /* Under an alert or a sheet the tab bar steps aside, as on iOS */
  body:has(#dlg:not([hidden])) .w-tabbar{visibility:hidden}
  .w-tabpill{display:flex;align-items:center;height:62px;padding:4px;border-radius:31px;background:color-mix(in srgb,var(--w-raised) 80%,transparent);-webkit-backdrop-filter:blur(18px) saturate(1.6);backdrop-filter:blur(18px) saturate(1.6);box-shadow:0 0 0 .5px var(--w-line),0 8px 24px -10px rgba(0,0,0,.35)}
  .w-tabpill a{flex:1;height:100%;display:grid;justify-items:center;align-content:center;gap:2px;font-size:10px;font-weight:600;letter-spacing:-.01em;color:var(--w-ink);text-decoration:none;border-radius:27px;min-width:0}
  .w-tabpill a svg.i{width:22px;height:22px}
  .w-tabpill a.on{color:var(--w-accent-ink);background:var(--w-fill)}
  .w-tabpill a span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;padding:0 2px}
  .w-tabadd{flex:none;width:50px;height:50px;margin:0 4px;border-radius:50%;background:var(--w-accent);color:var(--w-on-accent);display:grid;place-items:center;box-shadow:0 6px 16px -6px var(--w-accent)}
  .w-tabadd svg.i{width:24px;height:24px;stroke-width:2.3}
  .w-pchips{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;margin:0 -16px;padding:0 16px}
  .w-pchips::-webkit-scrollbar{display:none}
  .w-pchips button{display:inline-flex;align-items:center;gap:7px;padding:6px 12px 6px 7px;border-radius:999px;background:var(--w-panel);border:1px solid var(--w-line);color:var(--w-ink2);font-weight:500;white-space:nowrap;min-height:36px}
  .w-pchips button span:last-child{display:none}
  .w-pchips button[aria-pressed="true"]{background:var(--w-accent-soft);border-color:var(--w-accent-line);color:var(--w-accent-ink)}
  /* The person menu: avatars only, menus open as wide as they need */
  .w-pswitch-b{height:36px;padding:0 8px 0 4px;background:var(--w-fill)}
  .w-pswitch-b .w-av{width:26px;height:26px}
  .w-pswitch-b > svg.i{display:none}
  .w-pswho{display:none}
  .w-menu > button,.w-menu > a{min-height:46px;padding:0 12px;gap:12px;font-size:var(--fs-body)}
  .w-toast{bottom:calc(var(--tabbar) + 30px + env(safe-area-inset-bottom,0px))}
  /* Over a dialog or a sheet, at the top, clear of their buttons */
  .w-toast{width:max-content;max-width:calc(100vw - 32px)}
  .w-toast.top{top:calc(12px + env(safe-area-inset-top,0px));bottom:auto;transform:translate(-50%,-20px)}
  .w-toast.top.on{transform:translate(-50%,0)}
  /* Dialogs and sheets come up from the bottom */
  .w-dlgwrap{place-items:end stretch;padding:0}
  .w-dialog,.w-dialog.wide{max-width:none;animation:w-up 260ms var(--ease)}
  /* A sheet takes the whole screen, as the new-transaction one does: Cancel · title · action on top */
  .w-sheetd{height:100vh;height:100dvh;max-height:none;border-radius:0;padding:max(8px,env(safe-area-inset-top,0px)) 16px calc(24px + env(safe-area-inset-bottom,0px))}
  .w-shh{font-size:var(--fs-body);min-height:44px;margin-bottom:10px}
  .w-shh h5,.w-shh .w-dlgx,.w-shh .w-dlgok{font-size:var(--fs-body)}
  .w-sheetd .w-gr{font-size:var(--fs-body);min-height:46px}
  /* An alert becomes an action sheet: the question and the action in one card, Cancel apart */
  .w-alert,.w-alert.wide{background:none;box-shadow:none;border-radius:0;display:grid;grid-template-columns:1fr;gap:8px;padding:0 8px calc(8px + env(safe-area-inset-bottom,0px))}
  .w-alg{display:grid;background:var(--w-raised);border-radius:14px;overflow:hidden;padding-top:14px}
  .w-alg > *{padding:0 16px}
  .w-alg > .w-altop{margin-bottom:6px}
  .w-alg h5{font-size:13px;font-weight:600;color:var(--w-ink2)}
  .w-alg > p{font-size:13px;color:var(--w-ink3);margin:2px 0 0}
  .w-alg > :is(.w-gl,.w-sinput,label,.w-shb){margin:10px 16px 0;padding:0}
  .w-alg > .w-dlgerr{padding-top:6px}
  .w-alg > .w-dlgok,.w-alg > .w-dlgok.danger{order:3;margin:14px 0 0;height:56px;border-radius:0;background:none;color:var(--w-accent-ink);font-size:20px;font-weight:400;border-top:1px solid var(--w-line2)}
  .w-alg > .w-dlgok.danger{color:var(--w-bad)}
  .w-alg > .w-dlgok[disabled]{color:var(--w-ink3);opacity:1}
  .w-alert > .w-dlgx{order:4;margin:0;height:56px;border-radius:14px;background:var(--w-raised);color:var(--w-accent-ink);font-size:20px;font-weight:600}
  /* Touch targets are at least 44 px */
  .w-btn{min-height:40px}
  .w-btn.ghost{min-height:36px}
}
@keyframes w-up{from{transform:translateY(24px);opacity:.4}to{transform:none;opacity:1}}
@keyframes w-fade{from{opacity:0}to{opacity:1}}
.w-main > *{animation:w-fade 300ms var(--ease)}
.w-main.w-still > *{animation:none}  /* Opening Wally: the page is there at once, the fade is for moving between pages */


/* Empty states */
.w-empty{display:grid;justify-items:center;gap:6px;text-align:center;padding:28px 16px;color:var(--w-ink2)}
.w-empty b{color:var(--w-ink);font-weight:600}
.w-empty p{max-width:340px;font-size:var(--fs-foot)}
.w-empty-i{width:40px;height:40px;border-radius:var(--r-card);display:grid;place-items:center;background:var(--w-fill);color:var(--w-ink2);margin-bottom:4px}
.w-empty .w-btn{margin-top:8px}

/* Right to left: the layout mirrors, amounts and chart time axes stay left to right */
[dir="rtl"] .w-app > .w-side{border-right:0;border-left:1px solid var(--w-line)}
[dir="rtl"] svg.i use[href="#i-left"],[dir="rtl"] svg.i use[href="#i-right"],[dir="rtl"] svg.i use[href="#i-back"]{transform:scaleX(-1);transform-origin:center}
[dir="rtl"] .chart{direction:ltr}
.amt,.num{unicode-bidi:isolate}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:120ms!important;animation-iteration-count:1!important;transition-duration:120ms!important}
}
/* ‹ ›: on wider screens they keep one place at the end of the header, before the person menu, so they don't
   move as the month's name changes */
@media (min-width:768px){
  .w-head .w-steps{gap:6px;margin-inline:auto 0}
  .w-head .w-steps ~ .w-hact{margin-inline-start:12px}
}
