/* Page background, the app frame, header and icon rail. */
/* Background: three soft colour glows drifting behind everything, and on the budgets page a
   grid of faint icons that fades out from the bottom-right corner. Both are built by
   js/decor.js; each icon's --fade is set there. They never react to the pointer. */
.bg-glows{position:fixed;inset:0;z-index:-2;overflow:hidden;pointer-events:none}
.bg-glows i{position:absolute;width:46rem;height:46rem;border-radius:50%;filter:blur(90px);
  background:radial-gradient(circle,color-mix(in srgb,var(--g) var(--glow-strength),transparent),transparent 68%)}
.bg-glows i:nth-child(1){--g:var(--glow-1);top:-18rem;right:-8rem}
.bg-glows i:nth-child(2){--g:var(--glow-2);top:25%;left:-22rem}
.bg-glows i:nth-child(3){--g:var(--glow-3);bottom:-24rem;right:20%}
/* Stepped, about five moves a second: each is under a pixel on a 90px blur, so it still reads
   as a smooth drift, but every glass card's backdrop blur is redone 5 times a second, not 60+.
   Animating it every frame was most of the planner's idle CPU (and laptop fans). */
@media(prefers-reduced-motion:no-preference){
  .bg-glows i{animation:glow-drift 26s steps(130) infinite alternate}
  .bg-glows i:nth-child(2){animation-duration:32s;animation-delay:-8s}
  .bg-glows i:nth-child(3){animation-duration:38s;animation-delay:-16s}
}
@keyframes glow-drift{to{transform:translate(6rem,4rem) scale(1.12)}}
.bg-icons{display:none;position:fixed;inset:0;z-index:-1;pointer-events:none;grid-template-columns:repeat(var(--cols,24),1fr);grid-auto-rows:var(--cell,4rem);padding:.5rem;align-content:start}
.bg-icons.on-budgets{display:grid}
.bg-icons span{display:grid;place-items:center;font-size:1.15rem;color:color-mix(in srgb,var(--grid-icon) calc(var(--fade,1) * 100%),transparent)}
.bg-icons .ui-icon{width:1em;height:1em}

/* App frame. On a big enough window the app fills it exactly and the page never scrolls;
   long lists scroll inside their own card instead. */
#app{display:flex;flex-direction:column;height:100vh;height:100dvh;padding:0 2rem 0 7.375rem;overflow:clip}
#app.no-rail{padding-left:2rem}
.app-main{flex:1;min-height:0;display:flex;flex-direction:column;padding-bottom:.875rem}

/* Header */
.top{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.75rem 1.5rem;padding:1.125rem 0 .875rem}
.brand h1{font-size:1.25rem;font-weight:600;line-height:1.2}
.brand p{margin:.25rem 0 0;color:var(--muted);font-size:.75rem}
.savebar{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem}
.status{font-size:.75rem;color:var(--ink-2);display:inline-flex;align-items:center;gap:.375rem}
.status::before{content:"";width:.5rem;height:.5rem;border-radius:50%;background:var(--good)}
.status.none{color:var(--bad)}
.status.none::before{background:var(--bad)}

/* Icon rail (desktop) and dock (phones) */
.sidebar{position:fixed;z-index:4;left:1rem;top:.875rem;bottom:.875rem;width:4.5rem;border-radius:1.625rem;padding:1.75rem .5rem 1.5rem;border:1px solid transparent;
  background:var(--grain) padding-box,var(--pane) padding-box,linear-gradient(160deg,var(--rim-a),var(--rim) 30%,var(--rim) 70%,var(--rim-b)) border-box;backdrop-filter:blur(1.125rem) saturate(115%);-webkit-backdrop-filter:blur(1.125rem) saturate(115%)}
.rail-logo{display:block;width:100%;border:0;background:transparent;padding:.25rem 0;margin:0 0 1rem;cursor:pointer;border-radius:.875rem}
.rail-logo img{display:block;width:2.25rem;height:2.25rem;margin:0 auto;object-fit:contain}
.rail-logo:hover{background:var(--surface-2)}
.tabs{position:relative;display:flex;flex-direction:column;gap:1.5625rem}
.tab{display:flex;align-items:center;justify-content:center;position:relative;border:0;background:transparent;padding:.875rem;min-height:3rem;border-radius:.9375rem;font-weight:600;color:var(--muted)}
.tab:hover{color:var(--ink)}
.tab .ui-icon{width:1.4375rem;height:1.4375rem}
.tab[aria-selected="true"]{color:var(--glide-text)}
/* The glider: a hairline track down the rail's left edge and a glowing segment that slides
   to the chosen tab (js/decor.js adds both and sets --gy/--gh, or --gx/--gw in the dock). */
.tabs>.glide-track{position:absolute;left:-.5rem;top:0;bottom:0;width:1px;pointer-events:none;
  background:linear-gradient(0deg,transparent 0%,var(--glide-track) 50%,transparent 100%)}
.tabs>.glide-thumb{position:absolute;left:-.5rem;top:0;width:1px;height:var(--gh,3rem);pointer-events:none;
  transform:translateY(var(--gy,0));background:linear-gradient(0deg,transparent 0%,var(--glide) 50%,transparent 100%)}
.tabs>.glide-thumb::before{content:"";position:absolute;height:60%;width:300%;top:50%;transform:translateY(-50%);background:var(--glide);filter:blur(10px)}
.tabs>.glide-thumb::after{content:"";position:absolute;left:0;height:100%;width:4rem;
  background:linear-gradient(90deg,color-mix(in srgb,var(--glide) 11%,transparent) 0%,transparent 100%)}
@media(prefers-reduced-motion:no-preference){
  .glider-on>.glide-thumb{transition:transform .5s cubic-bezier(.37,1.95,.66,.56),width .3s ease,height .3s ease}
}
.tab span{position:absolute;left:4rem;white-space:nowrap;background:var(--ink);color:var(--on-ink);border-radius:.5625rem;padding:.5rem .75rem;opacity:0;visibility:hidden;pointer-events:none;font-size:.8125rem;z-index:5}
.tab:hover span,.tab:focus-visible span{opacity:1;visibility:visible}
/* The budgets page heading is the wordmark itself. The alt text keeps it a real heading for
   anything that cannot see the image, and the intrinsic size reserves the space so the
   tagline below does not jump when it loads. */
.brand h1.wordmark{line-height:0}
.brand h1.wordmark img{display:block;height:1.75rem;width:auto;max-width:100%}
