/* Zeta. Calm surfaces, one accent, real icons. Tokens first; every colour below comes from them. */
:root {
  --bg: #f6f5f2; --card: #ffffff; --raised: #fbfaf8; --label: #14171a; --label2: #5f636a; --label3: #a6a9ae;
  --sep: rgba(20, 23, 26, .1); --hair: rgba(20, 23, 26, .14); --fill: #efeee9; --press: rgba(20, 23, 26, .05);
  --green: #157a43; --red: #c8102e; --orange: #9e4c00; --orange-soft: rgba(230, 120, 0, .12);
  --shadow: 0 1px 2px rgba(20, 23, 26, .04), 0 6px 20px rgba(20, 23, 26, .05); --card-edge: rgba(20, 23, 26, .05);
  --spring: cubic-bezier(.32, .72, 0, 1); --ease: cubic-bezier(.25, .1, .25, 1);
  --side: 0px; --tabbar: calc(64px + max(12px, env(safe-area-inset-bottom)));
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  color: var(--label); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  --accent: var(--al); --ink: var(--il); --btn: var(--il); --on-btn: #fff;
}
:root[data-mode="dark"] {
  --bg: #0b0f14; --card: #141a21; --raised: #1b222b; --label: #f2f4f7; --label2: #9aa3ae; --label3: #5b6470;
  --sep: rgba(255, 255, 255, .08); --hair: rgba(255, 255, 255, .12); --fill: #222a34; --press: rgba(255, 255, 255, .05);
  --green: #3ddc7f; --red: #ff6b6b; --orange: #ffb340; --orange-soft: rgba(255, 179, 64, .14);
  --shadow: none; --card-edge: rgba(255, 255, 255, .045);
  --accent: var(--ad); --ink: var(--idk, var(--ad)); --btn: var(--bd, var(--ad)); --on-btn: var(--od, #0b0f14);
}
/* Accents: al/il = light fill and readable ink, ad = dark fill, bd/od = dark button fill and its text when the fill is too dark for black text. */
[data-accent="teal"] { --al: #0f9488; --il: #096a61; --ad: #14b8a6; }
[data-accent="blue"] { --al: #007aff; --il: #0062cc; --ad: #0a84ff; --bd: #0a6fd6; --od: #fff; }
[data-accent="green"] { --al: #34c759; --il: #1f7a35; --ad: #30d158; }
[data-accent="orange"] { --al: #ff9500; --il: #b35400; --ad: #ff9f0a; }
[data-accent="pink"] { --al: #ff2d55; --il: #c30d40; --ad: #ff375f; }
[data-accent="purple"] { --al: #af52de; --il: #8a35b8; --ad: #bf5af2; --bd: #9c3fd0; --od: #fff; }
[data-accent="indigo"] { --al: #5856d6; --il: #4b49c7; --ad: #5e5ce6; --idk: #8583ff; --bd: #5452d6; --od: #fff; }
[data-accent="graphite"] { --al: #6e6e73; --il: #55555a; --ad: #8e8e93; }
:root { --soft: color-mix(in srgb, var(--accent) 13%, transparent); }
:root[data-mode="dark"] { --soft: color-mix(in srgb, var(--accent) 20%, transparent); }

/* ---------- Liquid Glass material ----------
   Fill = the base colour (card, or bg for bars) faintly tinted by the accent, at 55-70% so the backdrop shows through.
   Rim = a 1px gradient border (bright top-left, dim middle, accent-tinted bottom-right) drawn by a masked pseudo-element.
   Sheen = a soft white gradient over the top third. Inner = a faint inner shadow along the bottom edge. */
:root {
  --g-a: 62%; --g-list-a: 58%; --g-bar-a: 66%; --g-solid-a: 80%;
  --g-tint: color-mix(in srgb, var(--card) 95%, var(--accent));
  --g-fill: color-mix(in srgb, var(--g-tint) var(--g-a), transparent);
  --g-list: color-mix(in srgb, var(--g-tint) var(--g-list-a), transparent);
  --g-solid: color-mix(in srgb, var(--g-tint) var(--g-solid-a), transparent);
  --g-bar: color-mix(in srgb, color-mix(in srgb, var(--bg) 94%, var(--accent)) var(--g-bar-a), transparent);
  --g-blur: blur(24px) saturate(180%); --g-blur-list: blur(16px) saturate(170%); --g-blur-bar: blur(26px) saturate(190%);
  --g-rim1: rgba(255, 255, 255, .95); --g-rim2: rgba(255, 255, 255, .22); --g-rim3: color-mix(in srgb, var(--accent) 30%, rgba(255, 255, 255, .5));
  --g-edge: rgba(20, 23, 26, .07);
  --g-sheen: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .14) 16%, rgba(255, 255, 255, 0) 34%);
  --g-inner: inset 0 -1px 0 rgba(20, 23, 26, .05), inset 0 -10px 18px -14px rgba(20, 23, 26, .16);
  --g-shadow: 0 1px 2px rgba(20, 23, 26, .05), 0 10px 30px -8px rgba(20, 23, 26, .14);
  --g-float: 0 2px 6px rgba(20, 23, 26, .06), 0 16px 40px -8px rgba(20, 23, 26, .22);
  --g-pill: rgba(20, 23, 26, .07); --g-lensrim: rgba(255, 255, 255, .85);
  --bounce: cubic-bezier(.34, 1.56, .64, 1);
  --blob1: 13%; --blob2: 10%; --blob3: 9%;
  --g-pop-a: 74%; --g-sheet-a: 84%; --dim: rgba(20, 23, 26, .3);
  --g-pop: color-mix(in srgb, var(--g-tint) var(--g-pop-a), transparent);
  --g-sheet: color-mix(in srgb, color-mix(in srgb, var(--bg) 96%, var(--accent)) var(--g-sheet-a), transparent);
  --g-handle: color-mix(in srgb, color-mix(in srgb, var(--bg) 96%, var(--accent)) 86%, transparent);
}
:root[data-mode="dark"] {
  --g-a: 58%; --g-list-a: 54%; --g-bar-a: 64%; --g-solid-a: 78%;
  --g-tint: color-mix(in srgb, var(--card) 93%, var(--accent));
  --g-rim1: rgba(255, 255, 255, .3); --g-rim2: rgba(255, 255, 255, .05); --g-rim3: color-mix(in srgb, var(--accent) 35%, rgba(255, 255, 255, .08));
  --g-edge: rgba(0, 0, 0, .45);
  --g-sheen: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .025) 18%, rgba(255, 255, 255, 0) 34%);
  --g-inner: inset 0 -1px 0 rgba(0, 0, 0, .35), inset 0 -12px 20px -14px rgba(0, 0, 0, .55);
  --g-shadow: 0 1px 1px rgba(0, 0, 0, .35), 0 12px 32px -10px rgba(0, 0, 0, .6);
  --g-float: 0 2px 6px rgba(0, 0, 0, .35), 0 18px 44px -8px rgba(0, 0, 0, .7);
  --g-pill: rgba(255, 255, 255, .1); --g-lensrim: rgba(255, 255, 255, .32);
  --blob1: 22%; --blob2: 16%; --blob3: 14%;
  --g-pop-a: 76%; --g-sheet-a: 76%; --dim: rgba(0, 0, 0, .5);
}
/* Reduced: for older phones. Fills nearly solid, no blur on cards and lists (the fixed bars and sheets keep theirs). */
:root[data-glass="reduced"] { --g-a: 92%; --g-list-a: 94%; --g-bar-a: 90%; --g-solid-a: 94%; --g-pop-a: 94%; --g-sheet-a: 95%; --g-blur-bar: blur(18px) saturate(160%); }
:root[data-mode="dark"][data-glass="reduced"] { --g-a: 90%; --g-list-a: 92%; --g-bar-a: 88%; --g-solid-a: 92%; --g-pop-a: 92%; --g-sheet-a: 94%; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body { margin: 0; min-height: 100dvh; font-size: 17px; line-height: 1.3; letter-spacing: -.01em; overflow-x: hidden; background: transparent; }
/* Backdrop: three large soft blobs (the accent, a hue +40deg, a hue -30deg, all at low chroma) and a faint grain,
   on fixed layers behind everything, so the glass has something to show through. Static on phones. */
:root { --hue-a: oklch(from var(--accent) l calc(c * .55) calc(h + 40)); --hue-b: oklch(from var(--accent) l calc(c * .55) calc(h - 30)); }
@supports not (color: oklch(from red l c h)) { :root { --hue-a: var(--accent); --hue-b: var(--accent); } }
body::before { content: ""; position: fixed; inset: -10%; z-index: -2; pointer-events: none;
  background: radial-gradient(48vmax 40vmax at 6% 4%, color-mix(in srgb, var(--accent) var(--blob1), transparent), transparent 70%),
    radial-gradient(44vmax 38vmax at 98% 42%, color-mix(in srgb, var(--hue-a) var(--blob2), transparent), transparent 70%),
    radial-gradient(52vmax 42vmax at 18% 96%, color-mix(in srgb, var(--hue-b) var(--blob3), transparent), transparent 70%); }
body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  body::before { will-change: transform; animation: drift 60s ease-in-out infinite alternate; }
}
@keyframes drift { to { transform: translate3d(4%, 3%, 0) scale(1.06); } }

button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button, a, input, label, .cell { touch-action: manipulation; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; }
a { color: var(--ink); }
h1, h2, p { margin: 0; }
svg { display: block; flex: 0 0 auto; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot img { border-radius: 22.5%; opacity: .9; }
.green { color: var(--green); } .red { color: var(--red); } .orange { color: var(--orange); } .tint { color: var(--ink); } .muted { color: var(--label2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- frame ---------- */
.shell { max-width: 640px; margin: 0 auto; padding: 0 16px calc(var(--tabbar) + 28px); }
@media (min-width: 768px) and (max-width: 1023px) { .shell { max-width: 720px; padding-left: 24px; padding-right: 24px; } }
.nav { position: sticky; top: 0; z-index: 6; margin: 0 -16px; padding: env(safe-area-inset-top) 8px 0; min-height: calc(52px + env(safe-area-inset-top));
  display: grid; grid-template-columns: minmax(92px, 1fr) minmax(0, auto) minmax(92px, 1fr); align-items: center; gap: 4px;
  /* Always glass: light at the top, stronger once content scrolls under it. */
  background-color: color-mix(in srgb, var(--bg) 8%, transparent); -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  box-shadow: inset 0 -.5px 0 transparent; transition: background-color .2s, box-shadow .2s; will-change: transform; }
html.scrolled .nav { background-color: var(--g-bar); -webkit-backdrop-filter: var(--g-blur-bar); backdrop-filter: var(--g-blur-bar);
  box-shadow: inset 0 -.5px 0 var(--g-rim2), inset 0 -1px 0 var(--g-edge), 0 6px 20px -12px rgba(0, 0, 0, .25); }
html.scrolled .nav::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--g-sheen); opacity: .7; }
.nav { isolation: isolate; }
:root[data-mode="light"] .nav-t { text-shadow: 0 1px 0 rgba(255, 255, 255, .5); }
.nav-l, .nav-r { display: flex; align-items: center; gap: 2px; min-width: 0; }
.nav-r { justify-content: flex-end; }
.nav-t { font-size: 17px; font-weight: 600; opacity: 0; transition: opacity .15s; min-width: 0; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.scrolled .nav-t { opacity: 1; }
.large-title { font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: -.4px; margin: 2px 0 4px; overflow-wrap: anywhere; }

/* Nav buttons: 44 hit area, a smaller drawn shape */
.nav-btn { position: relative; min-height: 44px; min-width: 44px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  color: var(--ink); font-size: 17px; white-space: nowrap; max-width: 100%; }
.nav-btn > span { overflow: hidden; text-overflow: ellipsis; }
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn.back { padding-left: 2px; }
.nav-btn.back svg { width: 24px; height: 24px; margin-right: -2px; }
.nav-btn.pill::before, .nav-btn.icon::before { content: ""; position: absolute; inset: 5px 2px; border-radius: 17px; background: var(--soft); z-index: -1;
  box-shadow: inset 0 1px 0 var(--g-rim2), inset 0 0 0 .5px color-mix(in srgb, var(--accent) 22%, transparent); }
.nav-btn.pill { padding: 0 14px; font-size: 15px; font-weight: 600; isolation: isolate; }
.nav-btn.pill .updown { width: 9px; height: 14px; opacity: .8; }
.nav-btn.icon { width: 44px; padding: 0; isolation: isolate; }
.nav-btn.icon::before { inset: 5px; border-radius: 50%; }
.nav-btn.add { isolation: isolate; color: var(--on-btn); width: 44px; padding: 0; transition: scale .45s var(--bounce); }
/* The + is a glass circle tinted with the accent; a highlight follows the finger (--mx/--my, set in app.js). */
.nav-btn.add::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; z-index: -1; background-color: color-mix(in srgb, var(--btn) 90%, transparent);
  background-image: radial-gradient(circle at var(--mx, 32%) var(--my, 22%), rgba(255, 255, 255, .42), rgba(255, 255, 255, 0) 58%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -1px 1px rgba(0, 0, 0, .18), inset 0 0 0 .5px rgba(255, 255, 255, .25), 0 4px 14px -2px color-mix(in srgb, var(--btn) 45%, transparent); }
.nav-btn.add svg { width: 20px; height: 20px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .15)); }
.nav-btn:active { opacity: .55; }
.nav-btn.add:active { opacity: 1; scale: 1.1; transition-duration: .14s; }
.text-btn { color: var(--ink); font-size: 17px; min-height: 44px; min-width: 44px; padding: 0 4px; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
.text-btn.bold { font-weight: 600; } .text-btn.red { color: var(--red); }
.text-btn:active { opacity: .55; }

/* ---------- tab bar (phones, tablets): a floating glass capsule, inset 12 from the edges, like iOS 26 ----------
   The glass layer is the ::before (so the bar itself is not a backdrop root and the lens pill can see the page),
   the ::after draws the rim. The active pill slides on transform and swells to 1.04 while pressed. */
.tabbar { position: fixed; left: max(12px, calc(50% - 270px)); right: max(12px, calc(50% - 270px)); bottom: max(12px, env(safe-area-inset-bottom)); z-index: 7;
  height: 64px; padding: 4px; border-radius: 32px; display: flex; isolation: isolate; will-change: transform; }
/* View transition names only while a transition runs: a named element is a backdrop root, which would stop the glass
   inside it from seeing the page behind. */
html[data-dir] .tabbar { view-transition-name: tabbar; }
html[data-dir] .content { view-transition-name: content; }
.tabbar::before { content: ""; position: absolute; inset: 0; z-index: -2; border-radius: inherit; pointer-events: none;
  background: var(--g-sheen), var(--g-bar); -webkit-backdrop-filter: var(--g-blur-bar); backdrop-filter: var(--g-blur-bar); box-shadow: var(--g-float), var(--g-inner), 0 0 0 .5px var(--g-edge); }
.tabbar::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; pointer-events: none; padding: 1px;
  background: linear-gradient(135deg, var(--g-rim1), var(--g-rim2) 38%, var(--g-rim2) 62%, var(--g-rim3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.tabbar button[data-view] { flex: 1 1 0; min-width: 0; height: 56px; display: grid; justify-items: center; align-content: center; gap: 2px; color: var(--label2); font-size: 12px; font-weight: 500; letter-spacing: 0; position: relative; border-radius: 28px; }
.tabbar svg { width: 24px; height: 24px; }
.tabbar button[aria-current="page"] { color: var(--ink); font-weight: 600; }
.tabbar button[aria-current="page"] svg { animation: tabpop .15s var(--ease); }
@keyframes tabpop { 50% { transform: scale(.86); } }
.tab-pill { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 6); border-radius: 28px; z-index: -1; pointer-events: none; overflow: hidden;
  translate: calc(var(--k, 0) * 100%) 0; transition: translate .42s var(--spring), scale .4s var(--bounce);
  background-color: var(--g-pill); box-shadow: inset 0 1px 0 var(--g-lensrim), inset 0 0 0 .5px var(--g-lensrim), inset 0 -1px 2px rgba(0, 0, 0, .06), 0 1px 4px rgba(0, 0, 0, .06); }
/* Lens: a brighter rim and a highlight that follows the finger, plus a swell while pressed. */
.tab-pill::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(60% 90% at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 70%); }
:root[data-mode="dark"] .tab-pill::after { background: radial-gradient(60% 90% at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 70%); }
.tabbar.press .tab-pill { scale: 1.04; transition: translate .3s var(--spring), scale .16s var(--ease); }
/* Real refraction only in desktop Chromium (backdrop-filter with an SVG displacement map), on this one small element. */
:root.lens:not([data-glass="reduced"]) .tab-pill { -webkit-backdrop-filter: url(#zlens) saturate(160%) brightness(1.06); backdrop-filter: url(#zlens) saturate(160%) brightness(1.06); }
.lens-svg { position: absolute; width: 0; height: 0; overflow: hidden; }
.tabbar .ico { position: relative; }
/* The + sits in the middle slot of the capsule (the slot keeps its width when the button is hidden), raised 10px above the top edge. */
.tab-slot { flex: 1 1 0; min-width: 0; height: 56px; position: relative; }
.tab-add { position: absolute; left: 50%; top: -14px; width: 56px; height: 56px; margin-left: -28px; display: grid; place-items: center; border-radius: 50%; z-index: 2; isolation: isolate;
  color: var(--on-btn); transition: scale .45s var(--bounce); }
.tab-add[hidden] { display: none; }
.tab-add::before { content: ""; position: absolute; inset: 0; border-radius: 50%; z-index: -1; background-color: color-mix(in srgb, var(--btn) 90%, transparent);
  background-image: radial-gradient(circle at var(--mx, 32%) var(--my, 22%), rgba(255, 255, 255, .42), rgba(255, 255, 255, 0) 58%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -1px 1px rgba(0, 0, 0, .18), inset 0 0 0 .5px rgba(255, 255, 255, .25), 0 6px 18px -2px color-mix(in srgb, var(--btn) 55%, transparent); }
.tab-add svg { width: 26px; height: 26px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .15)); }
.tab-add:active { scale: 1.1; transition-duration: .14s; }
.tab-add:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 3px; }
.dot { position: absolute; top: -2px; right: -5px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }

/* ---------- sidebar (desktop) ---------- */
.side { display: none; }
@media (min-width: 1024px) {
  :root { --side: 256px; --tabbar: 0px; }
  .tabbar { display: none; }
  .side { display: flex; flex-direction: column; gap: 6px; position: fixed; top: 0; bottom: 0; left: 0; width: var(--side); padding: 20px 14px; z-index: 6;
    background-color: var(--g-bar); -webkit-backdrop-filter: var(--g-blur-bar); backdrop-filter: var(--g-blur-bar); will-change: transform;
    box-shadow: inset -1px 0 0 var(--g-rim2), inset -.5px 0 0 var(--g-edge), inset 0 1px 0 var(--g-rim2), 8px 0 30px -18px rgba(0, 0, 0, .25); overflow-y: auto; }
  .shell { max-width: calc(1100px + 64px); margin: 0 0 0 var(--side); padding: 0 32px 48px; }
  @media (min-width: 1420px) { .shell { margin-left: calc(var(--side) + (100vw - var(--side) - 1164px) / 2); } }
  .nav { margin: 0 -32px; padding: 0 24px; }
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.brand img { width: 32px; height: 32px; border-radius: 22.5%; }
.side .acct { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 14px; background: var(--g-solid); font-size: 15px; font-weight: 600; text-align: left;
  box-shadow: inset 0 1px 0 var(--g-rim1), inset 0 0 0 .5px var(--g-rim2), 0 1px 3px rgba(0, 0, 0, .06); }
.side .acct span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .acct .updown { width: 10px; height: 16px; color: var(--label2); }
.side .btn { margin: 6px 0 12px; width: 100%; }
.side .items { display: grid; gap: 2px; }
.side .items button { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; color: var(--label); font-size: 15px; font-weight: 500; text-align: left; position: relative; }
.side .items svg { width: 20px; height: 20px; color: var(--label2); }
.side .items .ico { position: relative; }
.side .items button[aria-current="page"] { background: var(--soft); color: var(--ink); font-weight: 600; box-shadow: inset 0 1px 0 var(--g-lensrim), inset 0 0 0 .5px color-mix(in srgb, var(--accent) 25%, transparent); }
.side .items button[aria-current="page"] svg { color: var(--ink); }
.side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--sep); font-size: 13px; color: var(--label2); min-width: 0; }
.side .me span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .me b { display: block; color: var(--label); font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kbd { margin-left: auto; font-size: 12px; color: inherit; border: 1px solid color-mix(in srgb, currentColor 35%, transparent); border-radius: 5px; padding: 0 5px; line-height: 18px; }

/* ---------- desktop layout helpers ---------- */
.cols { display: block; }
@media (min-width: 1024px) {
  .cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 28px; align-items: start; }
}

@media (max-width: 1023.98px) { .d-only { display: none !important; } }
@media (min-width: 1024px) {
  .m-only { display: none !important; }
  .cols > div > .group-title:first-child, .cols > div > .group-title[data-first] { margin-top: 8px; }
}
.entry-block { position: relative; }
.entry-block + .cell::before, * + .entry-block > .cell::before { content: ""; position: absolute; top: 0; right: 0; left: 64px; height: .5px; background: var(--sep); }

/* ---------- month stepper ---------- */
.stepper { display: flex; align-items: center; gap: 2px; margin: 0 0 8px; }
.stepper b { font-size: 17px; font-weight: 600; padding: 0 2px; white-space: nowrap; }
.stepper button { width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink); border-radius: 50%; }
.stepper svg { width: 20px; height: 20px; }
.stepper button:disabled { color: var(--label3); }
.stepper .text-btn { margin-left: auto; font-size: 15px; }

/* ---------- segmented control: 44 tall to touch, 36 drawn, thumb slides on transform ---------- */
.seg { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); isolation: isolate; margin: 4px 0; }
/* Glass track (blurred where it sits on the page, plain translucent inside a card or a sheet), solid-ish thumb with a lens rim. */
.seg::before { content: ""; position: absolute; inset: 4px 0; border-radius: 12px; background: color-mix(in srgb, var(--fill) 70%, transparent); z-index: -2;
  -webkit-backdrop-filter: var(--g-blur-list); backdrop-filter: var(--g-blur-list); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05), inset 0 -1px 0 var(--g-rim2), 0 0 0 .5px var(--g-edge); }
.seg .thumb { position: absolute; top: 6px; bottom: 6px; left: 2px; width: calc((100% - 4px) / var(--n)); border-radius: 10px; background: rgba(255, 255, 255, .94); z-index: -1;
  box-shadow: inset 0 1px 0 #fff, inset 0 0 0 .5px rgba(255, 255, 255, .8), 0 1px 3px rgba(0, 0, 0, .12), 0 3px 8px -2px rgba(0, 0, 0, .08); translate: calc(var(--k) * 100%) 0;
  transition: scale .4s var(--bounce); }
:root[data-mode="dark"] .seg .thumb { background: rgba(70, 80, 94, .9); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 0 0 .5px rgba(255, 255, 255, .1), 0 1px 3px rgba(0, 0, 0, .4); }
.seg:has(button[aria-pressed="true"]:active) .thumb { scale: 1.04; transition-duration: .16s; }
.seg .thumb[data-from] { animation: segslide .18s var(--ease); }
@keyframes segslide { from { translate: calc(var(--from) * 100%) 0; } }
.seg button { min-height: 44px; font-size: 14px; font-weight: 500; color: var(--label); padding: 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg button[aria-pressed="true"] { font-weight: 600; }

/* ---------- chips: 44 to touch, 32 drawn ---------- */
.chips { display: flex; gap: 6px; overflow-x: auto; margin: 2px -16px 0; padding: 0 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; justify-content: center; overflow: visible; margin: 4px 0 0; padding: 0; gap: 0 6px; }
.chip { position: relative; flex: 0 0 auto; min-height: 44px; min-width: 44px; padding: 0 14px; font-size: 15px; color: var(--label2); white-space: nowrap; isolation: isolate; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip::before { content: ""; position: absolute; inset: 6px 0; border-radius: 16px; background: var(--g-list); z-index: -1;
  box-shadow: inset 0 1px 0 var(--g-rim1), inset 0 0 0 .5px var(--g-rim2), 0 0 0 .5px var(--g-edge), 0 1px 3px rgba(0, 0, 0, .05); }
.chip[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.chip[aria-pressed="true"]::before { background: color-mix(in srgb, var(--accent) 16%, var(--g-solid)); box-shadow: inset 0 1px 0 var(--g-lensrim), inset 0 0 0 .5px color-mix(in srgb, var(--accent) 35%, transparent), 0 1px 3px rgba(0, 0, 0, .06); }
dialog .chip::before { background: var(--fill); box-shadow: none; }
dialog .chip[aria-pressed="true"]::before { background: var(--soft); }
.chip:active { opacity: .6; }

/* ---------- search ---------- */
.search { position: relative; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px; margin-top: 4px; color: var(--label2); isolation: isolate; }
.search::before { content: ""; position: absolute; inset: 4px 0; border-radius: 12px; background: color-mix(in srgb, var(--fill) 72%, transparent); z-index: -1;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05), inset 0 -1px 0 var(--g-rim2), 0 0 0 .5px var(--g-edge); }
.search svg { width: 17px; height: 17px; }
.search input { flex: 1; min-width: 0; min-height: 36px; border: 0; outline: 0; background: none; padding: 0; color: var(--label); font-size: 17px; }
.search input::placeholder { color: var(--label2); }

/* ---------- grouped lists ---------- */
.group-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; font-weight: 600; letter-spacing: .4px; color: var(--label2); text-transform: uppercase; margin: 24px 16px 8px; }
.group-title b { font-weight: 600; text-transform: none; letter-spacing: 0; white-space: nowrap; }
.group-title span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-note { font-size: 13px; color: var(--label2); margin: 8px 16px 0; }
.group { border-radius: 18px; overflow: hidden; }

/* ---------- glass cards: grouped lists (lighter, blur 16), balance card, tiles, ledgers, notices (blur 24) ----------
   contain: paint keeps each card's repaint to itself; ::before is the gradient rim (on top), ::after the sheen (underneath the content). */
.group, .balance, .tile, .ledger, .notice { position: relative; isolation: isolate; contain: paint; background-color: var(--g-fill);
  -webkit-backdrop-filter: var(--g-blur); backdrop-filter: var(--g-blur); box-shadow: var(--g-shadow), var(--g-inner), 0 0 0 .5px var(--g-edge); }
.group { background-color: var(--g-list); -webkit-backdrop-filter: var(--g-blur-list); backdrop-filter: var(--g-blur-list); }
:is(.group, .balance, .tile, .ledger, .notice)::before { content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none; padding: 1px;
  background: linear-gradient(135deg, var(--g-rim1), var(--g-rim2) 34%, var(--g-rim2) 64%, var(--g-rim3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
:is(.group, .balance, .tile, .ledger, .notice)::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; background: var(--g-sheen); }
/* No nested blur: glass inside glass (a list in a sheet, the preview card in Settings) gets a plain translucent fill. */
:is(dialog, .group, .balance, .tile, .menu) :is(.group, .balance, .tile, .ledger, .notice) { -webkit-backdrop-filter: none; backdrop-filter: none; background-color: var(--g-solid); box-shadow: 0 0 0 .5px var(--g-edge), 0 1px 3px rgba(0, 0, 0, .04); }
:is(dialog, .group, .tile, .balance) .seg::before { -webkit-backdrop-filter: none; backdrop-filter: none; }
/* Performance budget: long day-by-day lists (Entries, ledgers, khatay, reports: up to 300 rows) keep the glass fill, rim and
   sheen but skip the blur, so scrolling a thousand entries stays smooth. During a page transition the content is a
   snapshot anyway, so blur inside it is skipped too (capturing blurred layers made tab taps slow). */
.group.day, html[data-dir] .content :is(.group, .balance, .tile, .ledger, .notice) { -webkit-backdrop-filter: none; backdrop-filter: none; }
html[data-dir] .content .seg::before { -webkit-backdrop-filter: none; backdrop-filter: none; }
:root[data-glass="reduced"] :is(.group, .balance, .tile, .ledger, .notice) { -webkit-backdrop-filter: none; backdrop-filter: none; }
:root[data-glass="reduced"] .seg::before { -webkit-backdrop-filter: none; backdrop-filter: none; }
.cell { position: relative; width: 100%; min-height: 52px; display: flex; align-items: center; gap: 12px; padding: 8px 16px; text-align: left; color: var(--label); }
.cell + .cell::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; height: .5px; background: var(--sep); }
.cell.ic + .cell::before { left: 64px; }
button.cell { transition: background-color .18s; }
button.cell:active { background: var(--press); transition: none; }
@media (hover: hover) { button.cell:hover { background: var(--press); } .chip:hover::before { background: var(--fill); } .nav-btn:hover { opacity: .8; } .side .items button:hover:not([aria-current]) { background: var(--press); } }
.cell .grow { flex: 1; min-width: 0; }
.cell .t { display: block; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell .t .tag { margin-left: 6px; vertical-align: 2px; }
.cell .s { display: block; font-size: 13px; color: var(--label2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.cell .s.wrap { white-space: normal; overflow-wrap: anywhere; }
.cell .v { color: var(--label2); white-space: nowrap; display: flex; align-items: center; gap: 6px; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cell .amt { flex: 0 0 auto; white-space: nowrap; font-weight: 600; font-size: 17px; text-align: right; }
.cell .end { flex: 0 0 auto; display: grid; justify-items: end; gap: 2px; }
.cell .end .tag { margin: 0; }
.cell input, .cell textarea { flex: 1; min-width: 0; min-height: 36px; border: 0; outline: 0; background: none; padding: 0; text-align: right; color: var(--label2); font-size: 17px; }
.cell input.left { text-align: left; color: var(--label); }
.cell input::placeholder { color: var(--label3); }
.cell input[type="date"] { flex: 0 1 auto; min-width: 0; color: var(--ink); }
.chev { width: 8px; height: 14px; color: var(--label3); }
.updown { width: 10px; height: 16px; color: var(--label2); }
.check { width: 20px; height: 20px; color: var(--ink); }

/* Icon circles: neutral, one outline set */
.ic-c { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--label2); font-size: 15px; font-weight: 600; }
.ic-c svg { width: 19px; height: 19px; }
.ic-c.sm { width: 28px; height: 28px; } .ic-c.sm svg { width: 16px; height: 16px; }
.ic-c.lg { width: 56px; height: 56px; font-size: 21px; }
.ic-c.green { color: var(--green); } .ic-c.tint { color: var(--ink); } .ic-c.orange { color: var(--orange); }
.av { background: color-mix(in srgb, var(--accent) 14%, var(--card)); color: var(--ink); letter-spacing: 0; }
.avs { display: flex; padding-left: 8px; }
.avs .ic-c { width: 30px; height: 30px; font-size: 12px; margin-left: -8px; box-shadow: 0 0 0 2px var(--card); }

.tag { display: inline-block; flex: 0 0 auto; font-size: 12px; font-weight: 600; line-height: 18px; padding: 1px 8px; border-radius: 9px; background: var(--fill); color: var(--label2); white-space: nowrap; letter-spacing: 0; }
.tag.accent { background: var(--soft); color: var(--ink); }
.tag.pend, .tag.disputed { background: var(--orange-soft); color: var(--orange); }
[data-enter] .tag.pend { animation: pulse 1.1s var(--ease) .3s 1; }
@keyframes pulse { 40% { transform: scale(1.08); } }

/* Empty states */
.empty { padding: 36px 24px; display: grid; justify-items: center; gap: 6px; text-align: center; }
.empty svg { width: 56px; height: 56px; color: var(--label3); margin-bottom: 6px; }
.empty b { font-size: 17px; font-weight: 600; }
.empty p { font-size: 15px; color: var(--label2); max-width: 300px; }
.empty .btn { margin-top: 10px; }

/* Buttons: sized to the label, full width only at the bottom of a sheet */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 22px; border-radius: 14px; background: var(--btn); color: var(--on-btn);
  font-size: 17px; font-weight: 600; text-decoration: none; white-space: nowrap; max-width: 100%; }
.btn svg { width: 19px; height: 19px; }
.btn.soft { background: var(--soft); color: var(--ink); }
.btn.small { min-height: 44px; padding: 0 16px; font-size: 15px; border-radius: 12px; }
.btn.mini { min-height: 44px; padding: 0 14px; font-size: 15px; border-radius: 22px; position: relative; background: none; isolation: isolate; color: var(--on-btn); }
.btn.mini::before { content: ""; position: absolute; inset: 6px 0; border-radius: 16px; background: var(--btn); z-index: -1; }
.btn.mini.soft { color: var(--ink); } .btn.mini.soft::before { background: var(--soft); }
.btn.mini.warn { color: var(--orange); } .btn.mini.warn::before { background: var(--orange-soft); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; }
.btn:active:not(:disabled) { opacity: .75; }
@media (hover: hover) { .btn:hover:not(:disabled) { filter: brightness(1.06); } }
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 8px; padding: 0 16px 6px 64px; }
.entry-block > .cell { padding-bottom: 0; min-height: 0; padding-top: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 0 10px; margin-top: 8px; }

/* ---------- balance card ---------- */
.balance { overflow: hidden; border-radius: 22px; padding: 20px 20px 8px; margin-top: 4px; }
.balance .cap { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--label2); }
.balance .cap::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.balance .big { font-size: 40px; line-height: 48px; font-weight: 700; letter-spacing: -1px; margin: 4px 0 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 359px) { .balance .big { font-size: 34px; line-height: 42px; } }
.balance .line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 0; border-top: .5px solid var(--sep); font-size: 15px; }
.balance .line span { color: var(--label2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.balance .line b { font-weight: 600; white-space: nowrap; }
/* Money model: the Savings line with its move button, the month-end leftover cell, the carry switch */
.balance .line.sav { padding: 4px 0; align-items: center; min-height: 52px; }
.balance .line .rt { display: flex; align-items: center; gap: 4px; min-width: 0; }
.sw-btn { position: relative; flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink); isolation: isolate; }
.sw-btn::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--soft); z-index: -1; }
.sw-btn svg { width: 18px; height: 18px; }
.sw-btn:active { opacity: .55; }
.leftover { margin-top: 12px; }
.switch { position: relative; flex: 0 0 auto; width: 51px; height: 31px; border-radius: 16px; background: color-mix(in srgb, var(--label3) 55%, transparent); transition: background-color .18s; }
.switch i { position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .18s var(--ease); }
[aria-checked="true"] > .switch { background: var(--btn); }
[aria-checked="true"] > .switch i { transform: translateX(20px); }
.cell > .rowbtn { align-self: stretch; display: grid; align-content: center; min-width: 0; min-height: 44px; text-align: left; color: inherit; }
/* Balance card: glass with an accent-tinted refraction (a caustic band and a corner glow) under the sheen. */
.balance.hero::after { background: var(--g-sheen),
    radial-gradient(90% 70% at 100% 0%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 65%),
    linear-gradient(155deg, transparent 38%, color-mix(in srgb, var(--hue-a) 12%, transparent) 58%, transparent 74%),
    radial-gradient(70% 60% at 0% 100%, color-mix(in srgb, var(--hue-b) 12%, transparent), transparent 70%); }
:root[data-mode="dark"] .balance.hero::after { background: var(--g-sheen),
    radial-gradient(90% 70% at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 65%),
    linear-gradient(155deg, transparent 38%, color-mix(in srgb, var(--hue-a) 14%, transparent) 58%, transparent 74%),
    radial-gradient(70% 60% at 0% 100%, color-mix(in srgb, var(--hue-b) 14%, transparent), transparent 70%); }
/* Accent style = tinted glass: the accent at 92% so text keeps 4.5:1, with a brighter sheen and refraction band. */
:root[data-card="accent"] .balance.hero { background-color: color-mix(in srgb, var(--btn) 92%, transparent); color: var(--on-btn);
  box-shadow: 0 12px 32px -6px color-mix(in srgb, var(--btn) 40%, transparent), inset 0 -1px 0 rgba(0, 0, 0, .15), inset 0 -14px 24px -16px rgba(0, 0, 0, .35); }
:root[data-card="accent"] .balance.hero::after { background: linear-gradient(180deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, .06) 18%, rgba(255, 255, 255, 0) 36%),
    linear-gradient(155deg, transparent 40%, rgba(255, 255, 255, .1) 56%, transparent 70%), radial-gradient(80% 70% at 100% 0%, rgba(255, 255, 255, .14), transparent 60%); }
:root[data-card="accent"] .balance.hero::before { background: linear-gradient(135deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, .12) 36%, rgba(255, 255, 255, .08) 64%, rgba(255, 255, 255, .3)); }
:root[data-card="accent"][data-mode="light"] .balance.hero { text-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
:root[data-card="accent"] .balance.hero .cap, :root[data-card="accent"] .balance.hero .line span { color: inherit; opacity: .9; }
:root[data-card="accent"] .balance.hero .cap::before { background: currentColor; }
:root[data-card="accent"] .balance.hero .line { border-top-color: color-mix(in srgb, currentColor 22%, transparent); }
:root[data-card="accent"] .balance.hero .sw-btn { color: inherit; }
:root[data-card="accent"] .balance.hero .sw-btn::before { background: color-mix(in srgb, currentColor 22%, transparent); }

.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.tile { display: grid; gap: 8px; text-align: left; border-radius: 18px; padding: 14px; min-width: 0; color: var(--label); }
.tile .cap { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--label2); min-width: 0; }
.tile .cap span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .val { font-size: 20px; font-weight: 600; letter-spacing: -.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Glass presses: a short springy squeeze and a brighter fill, never a delay. */
button.tile, button.ledger { transition: scale .4s var(--bounce), background-color .18s; }
button.tile:active, button.ledger:active { scale: .97; background-color: var(--g-solid); transition-duration: .12s; }
@media (hover: hover) { button.tile:hover, button.ledger:hover { background-color: var(--g-solid); } }
.tile.today { margin-top: 12px; }
.today .of { font-size: 14px; font-weight: 400; color: var(--label2); }
.today .note { font-size: 13px; color: var(--label2); }
.today .note.red { color: var(--red); }

.chart { padding: 16px 16px 12px; }
.bars { display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 96px; }
.bars div { flex: 1; min-width: 2px; max-width: 14px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; }
.bars i { display: block; border-radius: 3px; background: var(--accent); transform-origin: bottom; }
.bars i.inc { background: var(--label3); opacity: .7; }
[data-enter] .bars i { animation: grow .4s var(--spring) both; }
@keyframes grow { from { transform: scaleY(0); } }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--label2); margin-top: 10px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.legend i.inc { background: var(--label3); }
.meter { display: block; height: 4px; border-radius: 2px; background: var(--fill); margin-top: 8px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 2px; background: var(--accent); transform-origin: left; }
.meter i.inc { background: var(--label3); }
.meter i.over { background: var(--red); }
[data-enter] .meter i { animation: fill .45s var(--spring) both; }
@keyframes fill { from { transform: scaleX(0); } }

/* Shared ledgers */
.ledger { display: grid; gap: 4px; width: 100%; text-align: left; padding: 16px; margin-top: 12px; border-radius: 18px; color: var(--label); }
.ledger .row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ledger .t { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger .s { font-size: 13px; color: var(--label2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.ledger .pos { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger .fig { font-size: 13px; color: var(--label2); white-space: nowrap; }
.ledger .fig b { color: var(--label); font-weight: 600; }
.ledger .foot { margin-top: 8px; padding-top: 10px; border-top: .5px solid var(--sep); }
@media (min-width: 1024px) { .ledgers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; } }

/* Calm notice card (partner access, paused plan) */
.notice { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 28px 24px; margin-top: 12px; border-radius: 22px; }
.notice .ic-c { margin-bottom: 4px; }
.notice b { font-size: 17px; font-weight: 600; }
.notice p { font-size: 15px; color: var(--label2); max-width: 320px; }
.notice .btn { margin-top: 8px; }

/* Desktop entries: one wide row per entry with columns */
.c-note, .c-acct, .c-date, .thead { display: none; }
@media (min-width: 1024px) {
  .table .cell { display: grid; grid-template-columns: 36px minmax(120px, 1.1fr) minmax(0, 1.6fr) minmax(0, .9fr) 92px minmax(110px, auto); }
  .table .cell .s.sub { display: none; }
  .table .c-note, .table .c-acct, .table .c-date { display: block; font-size: 15px; color: var(--label2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .table .thead { display: grid; grid-template-columns: 36px minmax(120px, 1.1fr) minmax(0, 1.6fr) minmax(0, .9fr) 92px minmax(110px, auto); gap: 12px; padding: 16px 16px 0;
    font-size: 12px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--label2); }
  .table .thead span:last-child { text-align: right; }
}

/* Skeleton while shared or udhaar loads the first time */
.sk { position: relative; overflow: hidden; background: var(--fill); border-radius: 8px; }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--card) 60%, transparent), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-card { height: 132px; border-radius: 20px; margin-top: 4px; }
.sk-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.sk-row .sk.c { width: 36px; height: 36px; border-radius: 50%; }
.sk-row .sk.l { flex: 1; height: 14px; }
.sk-row .sk.r { width: 70px; height: 14px; }

/* Appearance */
.preview { display: grid; gap: 6px; padding: 16px; }
.preview .balance { margin: 0; padding: 16px 16px 4px; box-shadow: inset 0 0 0 1px var(--sep); }
.preview .balance .big { font-size: 28px; line-height: 34px; margin: 2px 0 8px; }
.dots { display: grid; grid-template-columns: repeat(4, minmax(44px, 1fr)); justify-items: center; padding: 2px 0; }
@media (min-width: 440px) { .dots { grid-template-columns: repeat(8, minmax(44px, 1fr)); } }
.dots button { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }
.dots i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.dots button[aria-pressed="true"] i { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--c); }
.dots i svg { width: 16px; height: 16px; opacity: 0; }
.dots button[aria-pressed="true"] i svg { opacity: 1; }
.cell.stack { display: grid; gap: 4px; padding-top: 10px; padding-bottom: 6px; }
.cell.stack > span { font-size: 15px; color: var(--label2); }
.profile .ic-c.lg { font-size: 22px; }
.profile .t { font-size: 20px; font-weight: 600; }

/* ---------- menus ---------- */
.menu { position: fixed; inset: auto; margin: 0; padding: 6px; min-width: 220px; max-width: min(320px, calc(100vw - 24px)); max-height: 60dvh; overflow: auto; border-radius: 18px; color: var(--label); border: 0;
  background: var(--g-sheen), var(--g-pop); -webkit-backdrop-filter: blur(28px) saturate(190%); backdrop-filter: blur(28px) saturate(190%);
  box-shadow: inset 0 1px 0 var(--g-rim1), inset 0 0 0 .5px var(--g-rim2), 0 0 0 .5px var(--g-edge), 0 16px 44px -6px rgba(0, 0, 0, .28); }
.menu:popover-open { animation: pop .2s var(--spring); }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
.menu button { width: 100%; min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border-radius: 9px; text-align: left; font-size: 17px; }
.menu button span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu button.danger { color: var(--red); }
.menu button:hover, .menu button:active { background: var(--press); }
.menu .mk { width: 18px; display: grid; place-items: center; color: var(--ink); }
.menu .mk svg { width: 16px; height: 16px; }
.menu::backdrop { background: transparent; }

/* ---------- sheets: bottom sheet on phones, centred dialog from tablet up ---------- */
/* Glass sheet: the dimmed page shows through, blurred. Lists inside it get plain translucent fills (no nested blur). */
dialog.sheet { border: 0; padding: 0; color: var(--label); width: 100%; max-width: 560px; max-height: 94dvh; margin: auto auto 0; border-radius: 22px 22px 0 0; overflow: auto; overscroll-behavior: contain;
  background-color: var(--g-sheet); -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%);
  box-shadow: inset 0 1px 0 var(--g-rim1), inset 0 0 0 .5px var(--g-rim2), 0 -10px 40px rgba(0, 0, 0, .22); transition: transform .32s var(--spring), opacity .2s; }
dialog.sheet[open] { animation: rise .32s var(--spring); }
dialog.sheet.closing { transform: translateY(105%); }
dialog.sheet.dragging { transition: none; }
dialog.sheet::backdrop { background: var(--dim); animation: fade .25s ease; transition: opacity .25s; }
dialog.sheet.closing::backdrop { opacity: 0; }
@keyframes rise { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
@keyframes zoom { from { transform: scale(.95); opacity: 0; } }
@media (min-width: 768px) {
  dialog.sheet { margin: auto; max-width: 520px; max-height: 86dvh; border-radius: 24px; box-shadow: inset 0 1px 0 var(--g-rim1), inset 0 0 0 .5px var(--g-rim2), 0 0 0 .5px var(--g-edge), 0 24px 80px rgba(0, 0, 0, .3); }
  dialog.sheet[open] { animation: zoom .22s var(--spring); }
  dialog.sheet.closing { transform: scale(.96); opacity: 0; }
  .grabber { visibility: hidden; height: 0 !important; margin: 0 !important; }
}
.handle { position: sticky; top: 0; z-index: 4; background-color: var(--g-handle); touch-action: none; cursor: grab; box-shadow: inset 0 1px 0 var(--g-rim1); }
.handle::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--g-sheen); }
.handle { isolation: isolate; }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--label3); margin: 6px auto 0; }
.sheet-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 0 8px; min-height: 52px; }
.sheet-bar b { font-size: 17px; font-weight: 600; max-width: 56vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.sheet-bar .text-btn:last-child { justify-self: end; } .sheet-bar .text-btn:first-child { justify-self: start; }
.sheet-body { padding: 4px 16px calc(28px + env(safe-area-inset-bottom)); }
.sheet-body .group + .group, .sheet-body .seg + .group { margin-top: 16px; }
.amount { display: flex; justify-content: center; align-items: baseline; gap: 6px; padding: 18px 0 14px; max-width: 100%; overflow: hidden; }
.amount span { font-size: 22px; font-weight: 600; color: var(--label2); }
.amount input { border: 0; outline: 0; background: none; padding: 0; min-width: 1.6ch; max-width: calc(100% - 48px); font-size: 44px; font-weight: 700; letter-spacing: -1px; text-align: center; caret-color: var(--accent); field-sizing: content; }
.amount input::placeholder { color: var(--label3); }
.err { color: var(--red); font-size: 13px; margin: 12px 16px 0; text-align: center; animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.sheet-foot { margin-top: 20px; }

/* ---------- sign in, paywall ---------- */
.signin { min-height: 100dvh; display: grid; align-content: center; justify-items: center; padding: calc(24px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); }
.signin > div { width: min(100%, 360px); display: grid; gap: 12px; text-align: center; }
.signin img { width: 72px; height: 72px; border-radius: 22.5%; margin: 0 auto 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .16); }
.signin h1 { font-size: 34px; font-weight: 700; letter-spacing: -.4px; }
.signin .sub { color: var(--label2); font-size: 15px; margin-bottom: 16px; }
.signin form { display: grid; gap: 12px; }
.signin .btn { width: 100%; }
.google { background: #fff !important; color: #1f1f1f !important; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14); }
.or { display: flex; align-items: center; gap: 12px; color: var(--label2); font-size: 13px; margin: 4px 0; }
.or::before, .or::after { content: ""; flex: 1; height: .5px; background: var(--hair); }
.field { display: flex; align-items: center; min-height: 50px; padding: 0 14px; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 1px var(--hair); }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 17px; color: var(--label); min-height: 48px; }
.field input::placeholder { color: var(--label2); }
.field:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
.signin .err { margin: 0; text-align: left; animation: none; }
.signin .hint { font-size: 15px; color: var(--label2); }
.signin .hint b { color: var(--label); }

/* ---------- toast and connection pill ---------- */
#toast { position: fixed; left: 50%; top: calc(10px + env(safe-area-inset-top)); z-index: 40; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 32px); padding: 10px 18px; border-radius: 22px;
  font-size: 15px; font-weight: 600; background: var(--g-sheen), var(--g-pop); -webkit-backdrop-filter: blur(24px) saturate(190%); backdrop-filter: blur(24px) saturate(190%);
  box-shadow: inset 0 1px 0 var(--g-rim1), inset 0 0 0 .5px var(--g-rim2), 0 0 0 .5px var(--g-edge), 0 10px 30px -4px rgba(0, 0, 0, .2);
  transform: translate(-50%, calc(-100% - 20px)); opacity: 0; transition: transform .18s var(--ease), opacity .18s; pointer-events: none; }
#toast.show { transform: translate(-50%, 0); opacity: 1; }
#toast svg { width: 18px; height: 18px; }
#toast .ok { color: var(--green); }
#toast .ok path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: tick .3s var(--ease) .08s forwards; }
#toast .warn { color: var(--orange); }
@keyframes tick { to { stroke-dashoffset: 0; } }
#net { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 12px); z-index: 5; padding: 6px 14px; border-radius: 16px; font-size: 13px; font-weight: 600; white-space: nowrap; pointer-events: none;
  background: var(--g-pop); -webkit-backdrop-filter: var(--g-blur-bar); backdrop-filter: var(--g-blur-bar); box-shadow: inset 0 1px 0 var(--g-rim1), 0 0 0 .5px var(--g-edge), 0 6px 18px -4px rgba(0, 0, 0, .2); transform: translate(-50%, 8px); opacity: 0; transition: transform .2s var(--ease), opacity .2s; }
#net.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- motion ---------- */
.fx { animation: up .24s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
@keyframes up { from { opacity: 0; transform: translateY(8px); } }
.cell.ins { animation: slidein .26s var(--spring); }
@keyframes slidein { from { opacity: 0; transform: translateX(-12px); } }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-group(*) { animation-duration: .18s; }
::view-transition-old(content) { animation: .09s ease-out both vt-out; }
::view-transition-new(content) { animation: .18s var(--spring) both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translate(var(--out-x, 0), 0); } }
@keyframes vt-in { from { opacity: 0; transform: translate(var(--in-x, 0), var(--in-y, 6px)); } }
html[data-dir="next"] { --out-x: -32px; --in-x: 32px; --in-y: 0px; }
html[data-dir="prev"] { --out-x: 32px; --in-x: -32px; --in-y: 0px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after, ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; transition: none !important; }
  .nav-btn.add:active, .tab-add:active, .tabbar.press .tab-pill, .seg .thumb, button.tile:active, button.ledger:active { scale: none !important; } }

/* receipts */
.cam { width: 14px; height: 14px; display: inline-block; margin-left: 6px; vertical-align: -1px; color: var(--label2); }
.cell.receipt { justify-content: center; padding: 12px 16px; }
.receipt img { display: block; max-width: 100%; max-height: 180px; border-radius: 12px; }
