/* Ekdesk design system ("ek"), look "Ink & Brass". Linked first on every page; section stylesheets add only what is theirs.
   Warm paper in light (readable in sunlight), warm near-black in dark. Brass is the private area and money colour; each section has
   one accent (--sec, set from <html data-sec> by js/ek-boot.js). Light follows the system unless data-theme pins one. */
/* Self-hosted fonts (/fonts, SIL OFL 1.1, see docs/vendor.md). swap: text shows at once in the fallback. */
@font-face{font-family:"Sora";font-style:normal;font-weight:600;font-display:swap;src:url(/fonts/sora-latin-600-normal.woff2?v=1) format("woff2")}
@font-face{font-family:"Sora";font-style:normal;font-weight:700;font-display:swap;src:url(/fonts/sora-latin-700-normal.woff2?v=1) format("woff2")}
@font-face{font-family:"Sora";font-style:normal;font-weight:800;font-display:swap;src:url(/fonts/sora-latin-800-normal.woff2?v=1) format("woff2")}
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/ibm-plex-sans-latin-400-normal.woff2?v=1) format("woff2")}
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-weight:500;font-display:swap;src:url(/fonts/ibm-plex-sans-latin-500-normal.woff2?v=1) format("woff2")}
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-weight:600;font-display:swap;src:url(/fonts/ibm-plex-sans-latin-600-normal.woff2?v=1) format("woff2")}
@font-face{font-family:"IBM Plex Mono";font-style:normal;font-weight:500;font-display:swap;src:url(/fonts/ibm-plex-mono-latin-500-normal.woff2?v=1) format("woff2")}
@font-face{font-family:"IBM Plex Mono";font-style:normal;font-weight:600;font-display:swap;src:url(/fonts/ibm-plex-mono-latin-600-normal.woff2?v=1) format("woff2")}
/* The rupee sign a size smaller than the digits beside it, everywhere: a face that only covers U+20B9. */
@font-face{font-family:"ek-rupee";src:local("Roboto"),local("Segoe UI"),local("Noto Sans"),local("Arial");unicode-range:U+20B9;size-adjust:82%}
:root{
  /* dark: warm near-black */
  --bg:#0E0F12;--panel:#17181C;--panel2:#202127;--line:#2E3036;--fg:#ECE8DF;--muted:#A29D92;
  --ink:#17181C;--paper:#F6F4EF;--brass:#D9B25F;--brass-bg:#2A2414;
  --accent:#ECE8DF;--accent-fg:#17181C;--on-sec:#0E0F12;--info-bg:#18202E;
  --good:#5CCB8A;--good-bg:#13261B;--bad:#FF8A80;--bad-bg:#2E1513;--warn:#D9B25F;--warn-bg:#2A2414;--priv:var(--brass);
  --c-day:#F2994A;--c-bills:#45C4B5;--c-projects:#B39AF2;--c-inbox:#8EA9F2;--c-rose:#F28AA6;--c-basket:#78C77E;--c-amber:#D9B25F;--c-news:#9AA7BA;
  --display:"ek-rupee","Sora",system-ui,sans-serif;--body:"ek-rupee","IBM Plex Sans",system-ui,sans-serif;--mono:"IBM Plex Mono",Consolas,monospace;
  /* type scale 32/24/18/15/13/11 */
  --t1:32px;--t2:24px;--t3:18px;--t4:15px;--t5:13px;--t6:11px;
  /* radius: 16 cards, 10 controls, 22 sheets and tiles */
  --r:16px;--r-sm:10px;--r-lg:22px;--r-pill:999px;--tab-h:56px;--side-w:220px;
  /* elevation: none in dark (borders carry the shape) */
  --shadow:0 18px 50px rgba(0,0,0,.5);--e1:none;--e2:none;
  color-scheme:dark;
}
@media (prefers-color-scheme:light){
  :root:not([data-theme="dark"]){
    --bg:#F6F4EF;--panel:#FFFDF9;--panel2:#EEEAE1;--line:#DCD5C7;--fg:#17181C;--muted:#5C584F;
    --brass:#82600F;--brass-bg:#F5EBD3;
    --accent:#17181C;--accent-fg:#F6F4EF;--on-sec:#FFFFFF;--info-bg:#E8ECF4;
    --good:#1D6B3F;--good-bg:#E2F1E6;--bad:#A8281F;--bad-bg:#F9E3DF;--warn:#7A5710;--warn-bg:#F5EBD3;
    --c-day:#A84B0C;--c-bills:#0E6B64;--c-projects:#6A3DB8;--c-inbox:#2A4A99;--c-rose:#A6224B;--c-basket:#2C7333;--c-amber:#82600F;--c-news:#475569;
    --shadow:0 14px 40px rgba(23,24,28,.16);--e1:0 1px 2px rgba(23,24,28,.06),0 2px 8px rgba(23,24,28,.04);--e2:0 6px 20px rgba(23,24,28,.10);
    color-scheme:light;
  }
}
:root[data-theme="light"]{
  --bg:#F6F4EF;--panel:#FFFDF9;--panel2:#EEEAE1;--line:#DCD5C7;--fg:#17181C;--muted:#5C584F;
  --brass:#82600F;--brass-bg:#F5EBD3;
  --accent:#17181C;--accent-fg:#F6F4EF;--on-sec:#FFFFFF;--info-bg:#E8ECF4;
  --good:#1D6B3F;--good-bg:#E2F1E6;--bad:#A8281F;--bad-bg:#F9E3DF;--warn:#7A5710;--warn-bg:#F5EBD3;
  --c-day:#A84B0C;--c-bills:#0E6B64;--c-projects:#6A3DB8;--c-inbox:#2A4A99;--c-rose:#A6224B;--c-basket:#2C7333;--c-amber:#82600F;--c-news:#475569;
  --shadow:0 14px 40px rgba(23,24,28,.16);--e1:0 1px 2px rgba(23,24,28,.06),0 2px 8px rgba(23,24,28,.04);--e2:0 6px 20px rgba(23,24,28,.10);
  color-scheme:light;
}
/* Section accent: buttons, links, active tabs take the section's colour inside a section. */
:root[data-sec="day"]{--sec:var(--c-day)}:root[data-sec="bills"]{--sec:var(--c-bills)}:root[data-sec="projects"]{--sec:var(--c-projects)}
:root[data-sec="inbox"]{--sec:var(--c-inbox)}:root[data-sec="notes"]{--sec:var(--c-amber)}:root[data-sec="reminders"]{--sec:var(--c-day)}:root[data-sec="basket"]{--sec:var(--c-basket)}

:root[data-sec]:not([data-sec="home"]){--accent:var(--sec);--accent-fg:var(--on-sec)}

/* ---------- base ---------- */
*{box-sizing:border-box}
html,body{height:100%;margin:0}
html{-webkit-text-size-adjust:100%}
body{background:var(--bg);color:var(--fg);font-family:var(--body);font-size:var(--fs,15px);line-height:1.45}
/* Text size: localStorage "ek-text" = normal | large, applied as <html data-text="large"> before first paint (js/ek-theme-boot.js). */
:root[data-text="large"]{--fs:17px}
:root[data-text="large"] body{zoom:1.08}
[hidden]{display:none!important}
a{color:var(--accent)}
h1{font-family:var(--display);font-size:var(--t2);letter-spacing:-.01em;font-weight:700;margin:0 0 4px;text-wrap:balance}
h2{font-family:var(--display);font-size:15px;font-weight:700;margin:0 0 10px}
h3{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:600;margin:14px 0 6px}
.sub{color:var(--muted);margin:0 0 14px}
.muted{color:var(--muted)}
.num{font-variant-numeric:tabular-nums}
.pos{color:var(--good);font-weight:600}.neg{color:var(--bad);font-weight:600}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* ---------- buttons ---------- */
.btn{font:inherit;font-weight:600;background:var(--accent);color:var(--accent-fg);border:1px solid transparent;border-radius:var(--r-sm);padding:9px 14px;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;white-space:nowrap;line-height:1.2}
.btn.sec{background:var(--panel2);color:var(--fg);border-color:var(--line)}
.btn.danger{background:var(--bad-bg);color:var(--bad);border-color:var(--line)}
.btn.sm{padding:5px 12px;font-size:13px;min-height:44px}
.btn.block{width:100%}
.btn:disabled{opacity:.5;cursor:default}
.btn:focus-visible{outline:2px solid var(--fg);outline-offset:2px}
.icon-btn{font:inherit;border:0;background:transparent;color:var(--muted);font-size:18px;min-width:44px;min-height:44px;display:inline-grid;place-items:center;border-radius:var(--r-sm);cursor:pointer;padding:0}
.icon-btn:hover{background:var(--panel2);color:var(--fg)}
.actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px;align-items:center}

/* ---------- inputs ---------- */
label{display:grid;gap:3px;font-size:12px;color:var(--muted);font-weight:600}
input,select,textarea{font:inherit;font-size:15px;width:100%;padding:8px 10px;border:1px solid var(--line);border-radius:var(--r-sm);background:var(--bg);color:var(--fg);min-height:40px;min-width:0}
textarea{resize:vertical;min-height:70px}
input[type=checkbox],input[type=radio]{width:20px;height:20px;min-height:0;padding:0;accent-color:var(--accent)}
input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.row{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px}
.row .full{grid-column:1/-1}
.chips{display:flex;gap:6px;flex-wrap:wrap}
.chip,.chips button{font:inherit;cursor:pointer;padding:6px 12px;border-radius:var(--r-pill);font-size:13px;font-weight:600;background:var(--panel);border:1px solid var(--line);color:var(--muted);min-height:44px;display:inline-flex;align-items:center;gap:4px;line-height:1}
.chip.on,.chips button.on,.chip.active,.chips button[aria-pressed="true"]{background:var(--panel2);color:var(--accent);border-color:var(--accent)}

/* ---------- cards, tiles, pills ---------- */
.card{background:var(--panel);border:1px solid var(--line);border-radius:var(--r);padding:14px;margin-bottom:14px;min-width:0}
.tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin-bottom:14px}
.tile{background:var(--panel);border:1px solid var(--line);border-radius:var(--r);padding:12px;min-width:0;color:var(--fg);text-decoration:none;display:block}
.tile.head{grid-column:1/-1}
.tile .k{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:600}
.tile .v{font-family:var(--display);font-size:var(--t2);font-weight:700;margin-top:4px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.tile.head .v{font-size:26px}
.tile small{display:block;color:var(--muted);font-size:12px;margin-top:3px}
.tile.good .v{color:var(--good)}.tile.bad .v{color:var(--bad)}.tile.warn .v{color:var(--warn)}
.pill{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:var(--r-pill);font-size:12px;font-weight:600;letter-spacing:.03em;white-space:nowrap;font-family:var(--body);background:var(--panel2);color:var(--muted)}
.pill.ok{background:var(--good-bg);color:var(--good)}
.pill.no{background:var(--bad-bg);color:var(--bad)}
.pill.wait{background:var(--warn-bg);color:var(--warn)}
.pill.info{background:var(--info-bg);color:var(--accent)}
.pill.neutral{background:var(--panel2);color:var(--muted)}
.note{background:var(--info-bg);border-radius:var(--r-sm);padding:10px 12px;font-size:13px;margin-top:10px}
.warnbox{background:var(--bad-bg);color:var(--bad);border-radius:var(--r-sm);padding:10px 12px;font-weight:600;margin-top:10px}
.okbox{background:var(--good-bg);color:var(--good);border-radius:var(--r-sm);padding:10px 12px;font-weight:600;margin-top:10px}
.empty b{color:var(--fg)}

/* ---------- dialog ---------- */
.dlg{background:var(--panel);color:var(--fg);border:1px solid var(--line);border-radius:var(--r-lg);padding:20px;width:min(92vw,420px);max-height:calc(100dvh - 24px);box-shadow:var(--shadow)}
.dlg::backdrop{background:rgba(14,15,18,.55)}
.dlg h1,.dlg h2{margin:0 0 8px;font-size:18px}
.dlg .dlgbody,.dlg p{font-size:14px;line-height:1.5}
.dlg .actions{justify-content:flex-end;margin-top:16px}
.dlg .actions .btn{min-height:44px}
@media (max-width:560px){
  .dlg{width:100vw;max-width:100vw;margin:auto 0 0;border-radius:var(--r-lg) var(--r-lg) 0 0;max-height:92dvh;padding-bottom:calc(18px + env(safe-area-inset-bottom,0px))}
  .dlg .actions .btn{min-height:44px;flex:1}
}

/* ---------- toast ---------- */
#toast{position:fixed;left:50%;bottom:calc(24px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);background:var(--ink);color:#F6F4EF;padding:10px 16px;border-radius:var(--r-pill);border:1px solid rgba(217,178,95,.25);font-weight:600;opacity:0;pointer-events:none;max-width:92vw;width:max-content;z-index:60;display:flex;align-items:center;gap:12px;box-shadow:0 6px 24px rgba(0,0,0,.3)}
#toast.show{opacity:1;pointer-events:auto}
#toast.err{background:#A8281F;color:#fff;border-color:transparent}
#toast.act{cursor:pointer}
#toast button{font:inherit;font-weight:700;background:#D9B25F;color:#17181C;border:0;border-radius:7px;padding:6px 12px;min-height:32px;cursor:pointer;margin-left:auto;flex:none}
#toast.err button{background:#fff;color:var(--bad)}
#toast button:focus-visible{outline:2px solid var(--bg)}

/* ---------- frame: sidebar on wide screens, tab bar on the phone ---------- */
.shell{display:grid;grid-template-columns:var(--side-w) minmax(0,1fr);min-height:100%}
.shell>main{padding:calc(18px + env(safe-area-inset-top,0px)) max(16px,env(safe-area-inset-right,0px)) 40px max(16px,env(safe-area-inset-left,0px));max-width:1080px;width:100%;min-width:0}
.sidebar{background:var(--panel);border-right:1px solid var(--line);padding:calc(18px + env(safe-area-inset-top,0px)) 14px calc(14px + env(safe-area-inset-bottom,0px)) max(14px,env(safe-area-inset-left,0px));display:flex;flex-direction:column;gap:6px;position:sticky;top:0;height:100vh;height:100dvh;overflow:auto}
.brand{display:flex;align-items:center;gap:10px;font-family:var(--display);font-weight:800;font-size:18px;color:var(--fg);text-decoration:none;margin-bottom:10px;user-select:none;-webkit-user-select:none}
.brand .logo{width:30px;height:30px;border-radius:8px;background:var(--accent);color:#fff;display:grid;place-items:center;font-size:16px;flex:none}
.brand .dot{width:10px;height:10px;border-radius:50%;background:var(--muted);flex:none;margin-left:auto}
.brand .dot.synced,.brand .dot.ok{background:var(--good)}.brand .dot.err{background:var(--bad)}.brand .dot.demo{background:var(--warn)}
.sidebar .nav{display:grid;gap:2px}
.sidebar .nav button,.sidebar .nav a{all:unset;display:flex;align-items:center;gap:10px;width:100%;padding:9px 10px;border-radius:var(--r-sm);cursor:pointer;color:var(--muted);font-weight:500;box-sizing:border-box;min-height:44px}
.sidebar .nav .ic{width:18px;text-align:center;font-size:15px;flex:none}
.sidebar .nav .home{color:var(--fg);border-bottom:1px solid var(--line);border-radius:0;margin-bottom:6px;padding-bottom:12px}
.sidebar .nav .on,.sidebar .nav [aria-current="page"]{background:var(--panel2);color:var(--fg)}
.sidebar .nav button:focus-visible,.sidebar .nav a:focus-visible{outline:2px solid var(--accent)}
.sidebar .cnt{font-style:normal;margin-left:auto;font-size:12px;font-weight:700;min-width:20px;text-align:center;padding:1px 6px;border-radius:var(--r-pill);background:var(--panel2);color:var(--muted)}
.sidebar .cnt:empty{display:none}
.sync{margin-top:auto;font-size:12px;color:var(--muted);border:1px solid var(--line);border-radius:var(--r-sm);padding:9px 10px;line-height:1.4}
.sync b{display:block;font-weight:600;color:var(--fg)}
.topline{display:none}
.tabbar{display:none}
.sheet{position:fixed;inset:0;background:rgba(14,15,18,.5);z-index:50;display:flex;align-items:flex-end}
.sheetbox{background:var(--panel);border:1px solid var(--line);border-radius:var(--r-lg) var(--r-lg) 0 0;padding:10px 12px calc(12px + env(safe-area-inset-bottom,0px));width:100%;display:grid;gap:4px;max-height:80dvh;overflow:auto}
.sheetbox button:not(.btn):not(.icon-btn):not(.eye):not([role=switch]),.sheetbox a:not(.btn){all:unset;display:flex;align-items:center;gap:12px;padding:12px;border-radius:10px;font-weight:600;cursor:pointer;color:var(--fg);min-height:48px;box-sizing:border-box}
.sheetbox .ic{width:22px;text-align:center;font-size:18px;color:var(--muted);flex:none}
.sheetbox .on,.sheetbox [aria-current="page"]{background:var(--panel2);color:var(--accent)}
.sheetbox .on .ic{color:var(--accent)}
.sheetbox button:focus-visible,.sheetbox a:focus-visible{outline:2px solid var(--accent)}
.sheetbox .sheetclose{color:var(--muted);justify-content:center;border-top:1px solid var(--line);border-radius:0;margin-top:4px}

@media (max-width:760px){
  .shell{grid-template-columns:1fr}
  .sidebar{display:none}
  .shell>main{padding:calc(12px + env(safe-area-inset-top,0px)) max(12px,env(safe-area-inset-right,0px)) calc(var(--tab-h) + 24px + env(safe-area-inset-bottom,0px)) max(12px,env(safe-area-inset-left,0px))}
  .topline{display:flex;align-items:center;gap:10px;margin:0 0 12px}
  .topline .brand{margin:0;font-size:17px}
  .topline .brand .logo{width:28px;height:28px;font-size:15px}
  .topline .sp{flex:1}
  .tabbar.n4{grid-template-columns:repeat(4,1fr)}
  .tabbar{display:grid;grid-template-columns:repeat(5,1fr);position:fixed;left:0;right:0;bottom:0;min-height:var(--tab-h);background:var(--panel);border-top:1px solid var(--line);padding:2px max(2px,env(safe-area-inset-right,0px)) calc(2px + env(safe-area-inset-bottom,0px)) max(2px,env(safe-area-inset-left,0px));z-index:40}
  .tabbar button,.tabbar a{all:unset;display:grid;gap:2px;place-items:center;align-content:center;text-align:center;font-size:12px;font-weight:600;color:var(--muted);cursor:pointer;min-height:48px;border-radius:var(--r-sm);position:relative;box-sizing:border-box;line-height:1.1;padding:4px 0}
  .tabbar i,.tabbar .ic{font-style:normal;font-size:18px;line-height:1}
  .tabbar .on,.tabbar [aria-current="page"]{color:var(--accent);background:var(--panel2)}
  .tabbar button:focus-visible,.tabbar a:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
  .tabbar .cnt{position:absolute;top:3px;right:calc(50% - 22px);margin:0;min-width:16px;padding:0 4px;font-size:12px;font-weight:700;border-radius:var(--r-pill);background:var(--panel2);color:var(--muted);font-style:normal;line-height:16px}
  .tabbar .cnt:empty{display:none}
  #toast{bottom:calc(var(--tab-h) + 16px + env(safe-area-inset-bottom,0px))}
  .btn{min-height:44px}
  .btn.sm{min-height:44px}
  input,select,textarea{font-size:16px;min-height:44px}
  input[type=checkbox],input[type=radio]{min-height:0}
  .dlg .actions{flex-wrap:nowrap}
}
@media print{.sidebar,.tabbar,.topline,.sheet,#toast{display:none!important}.shell{display:block}.shell>main{padding:0;max-width:none}}

/* ---------- motion (a daily tool, not a landing page) ----------
   Tokens: press 90 ms, settle 200 ms, spring 360 ms (slight overshoot), exit 140 ms. Nothing runs longer than 360 ms.
   Reduced motion turns all of it off (bottom of this block). Money never animates. */
:root{--press:90ms;--settle:200ms;--spring:360ms;--exit:140ms;
  --ease-out:cubic-bezier(.2,.7,.2,1);--ease-spring:cubic-bezier(.34,1.32,.64,1);--ease-in:cubic-bezier(.4,0,1,1);
  /* older names, kept for section stylesheets */
  --t-fast:var(--press);--t-enter:var(--settle);--t-sheet:var(--spring);--t-theme:var(--settle)}
/* Enter: EK.animateIn(root) adds .in on a root's first render only; siblings step 30 ms, capped at 6 */
.in{animation:ekin var(--settle) var(--ease-out) both;animation-delay:calc(var(--i,0)*30ms)}
@keyframes ekin{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
/* Press: every tap scales to .97 at once */
.btn,.tile,.fi,.chip,.chips button,.tabbar button,.tabbar a,.sidebar .nav button,.sidebar .nav a,.sheetbox button,.sheetbox a,.icon-btn,.fab,.seg button,.mail,.trow{transition:transform var(--press) var(--ease-out),opacity var(--press),box-shadow var(--settle),background-color var(--settle),border-color var(--settle),color var(--settle)}
.btn:active,.tile:active,.fi:active,.chip:active,.chips button:active,.tabbar button:active,.tabbar a:active,.sidebar .nav button:active,.sidebar .nav a:active,.sheetbox button:active,.sheetbox a:active,.icon-btn:active,.fab:active,.seg button:active,.mail:active,.trow:active{transform:scale(.97)}
@media (hover:hover){
  .btn:hover:not(:disabled){box-shadow:var(--e2)}
  a.tile:hover{border-color:var(--accent)}
}
/* Sheets rise on a spring, close fast; dialogs pop; backdrops fade */
.sheet{animation:ekfade var(--settle) var(--ease-out) both}
.sheetbox{animation:ekup var(--spring) var(--ease-spring) both;transition:transform var(--settle) var(--ease-out);touch-action:pan-y}
.dlg[open]{animation:ekpop var(--settle) var(--ease-spring) both}
.dlg[open]::backdrop{animation:ekfade var(--settle) var(--ease-out) both}
@keyframes ekfade{from{opacity:0}to{opacity:1}}
@keyframes ekup{from{transform:translateY(100%)}to{transform:none}}
@keyframes ekpop{from{transform:scale(.96);opacity:0}to{transform:none;opacity:1}}
@media (max-width:560px){.dlg[open]{animation-name:ekup;animation-duration:var(--spring)}}
/* Toast rises on a spring */
#toast{transform:translate(-50%,16px);transition:opacity var(--exit) var(--ease-in),transform var(--exit) var(--ease-in)}
#toast.show{transform:translate(-50%,0);transition:opacity var(--settle) var(--ease-out),transform var(--spring) var(--ease-spring)}
/* Loading skeleton: a short, soft pulse (no sweeping shimmer) */
.skel{position:relative;overflow:hidden;color:transparent!important;background:var(--panel2);border-radius:var(--r-sm);min-height:1em;pointer-events:none;animation:ekpulse 1.1s ease-in-out infinite alternate}
.skel>*{visibility:hidden}
@keyframes ekpulse{from{opacity:1}to{opacity:.55}}
/* Opened: a brass ring on the lock (EK.privPulse(el)) */
.pulse-priv{animation:ekpriv var(--spring) var(--ease-out) 1}
@keyframes ekpriv{0%{box-shadow:0 0 0 0 var(--brass)}100%{box-shadow:0 0 0 10px transparent}}
/* News headlines used to scroll as a ticker; they are a still list now */
.ticker{overflow:hidden;white-space:normal;border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:8px 0;margin:0 0 16px;font-size:13px;color:var(--muted)}
.ticker-track{display:block;animation:none}
.ticker .tk{color:var(--fg)}
.ticker .dot{margin:0 10px;color:var(--accent)}
/* Theme switch: colours settle on the page and its cards */
body,.card,.tile{transition:background-color var(--settle),color var(--settle),border-color var(--settle)}
/* Mark paid (EK.collapse(row)): a check draws, then the row folds away */
.ekfold{position:relative;overflow:hidden;transition:height var(--settle) var(--ease-in),opacity var(--settle),padding var(--settle)}
.ekfold>:not(.ekcheckwrap){transition:opacity var(--exit);opacity:.35}
.ekfold-go{opacity:0;padding-top:0!important;padding-bottom:0!important}
.ekcheckwrap{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none}
.ekcheck{width:30px;height:30px;fill:none;stroke:var(--good);stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.ekcheck circle{stroke-dasharray:63;stroke-dashoffset:63;animation:ekdraw 240ms var(--ease-out) forwards}
.ekcheck path{stroke-dasharray:16;stroke-dashoffset:16;animation:ekdraw 160ms 120ms var(--ease-out) forwards}
@keyframes ekdraw{to{stroke-dashoffset:0}}
/* Cross-document View Transitions: opening a section morphs its home tile into the section header; back reverses it.
   The header names come from <html data-sec> (js/ek-boot.js); home tiles carry the same name inline. */
@media (prefers-reduced-motion:no-preference){
  @view-transition{navigation:auto}
  ::view-transition-group(*){animation-duration:var(--spring);animation-timing-function:var(--ease-spring)}
  ::view-transition-old(root){animation:ekvt-out var(--exit) var(--ease-in) both}
  ::view-transition-new(root){animation:ekvt-in var(--settle) var(--ease-out) both}
  @keyframes ekvt-out{to{opacity:0}}
  @keyframes ekvt-in{from{opacity:0}}
  /* EK.tabSwitch(fn, dir): tabs slide by direction */
  :root[data-tabdir="next"]::view-transition-old(root){animation:ekvt-l-out var(--exit) var(--ease-in) both}
  :root[data-tabdir="next"]::view-transition-new(root){animation:ekvt-l-in var(--settle) var(--ease-out) both}
  :root[data-tabdir="prev"]::view-transition-old(root){animation:ekvt-r-out var(--exit) var(--ease-in) both}
  :root[data-tabdir="prev"]::view-transition-new(root){animation:ekvt-r-in var(--settle) var(--ease-out) both}
  @keyframes ekvt-l-out{to{opacity:0;transform:translateX(-24px)}}
  @keyframes ekvt-l-in{from{opacity:0;transform:translateX(24px)}}
  @keyframes ekvt-r-out{to{opacity:0;transform:translateX(24px)}}
  @keyframes ekvt-r-in{from{opacity:0;transform:translateX(-24px)}}
}
:root[data-sec="day"]{--vt:sec-day}:root[data-sec="bills"]{--vt:sec-bills}:root[data-sec="projects"]{--vt:sec-projects}:root[data-sec="inbox"]{--vt:sec-inbox}
:root[data-sec="basket"]{--vt:sec-basket}
/* one header per screen size carries the name (two with one name would cancel the transition) */
@media (min-width:761px){:root[data-sec] .sidebar>.brand{view-transition-name:var(--vt)}}
@media (max-width:760px){
  :root[data-sec] .topline .brand{view-transition-name:var(--vt)}
  :root[data-sec="day"] .topbar{view-transition-name:var(--vt)}
}
/* Dark mode: no heavy shadows; a hairline highlight on cards. Light: soft elevation. */
.card,.tile,.sidebar,.sheetbox,.dlg{box-shadow:var(--e1)}
/* Reduced motion: everything above becomes instant */
@media (prefers-reduced-motion:reduce){
  .in,.sheet,.sheetbox,.dlg[open],.dlg[open]::backdrop,.pulse-priv,.skel,.ekcheck circle,.ekcheck path{animation:none!important}
  .ekcheck circle,.ekcheck path{stroke-dashoffset:0}
  .btn,.tile,.fi,.chip,.chips button,.tabbar button,.tabbar a,.sidebar .nav button,.sidebar .nav a,.sheetbox button,.sheetbox a,.icon-btn,.fab,.seg button,.mail,.trow,body,.card,#toast,#toast.show,.sheetbox,.ekfold,.ekfold>*{transition:none!important}
  .btn:active,.tile:active,.fi:active,.chip:active,.chips button:active,.tabbar button:active,.tabbar a:active,.icon-btn:active,.fab:active,.mail:active,.trow:active,.sheetbox button:active,.sheetbox a:active,.seg button:active{transform:none}
}


/* ---------- shared components (home first; sections adopt when they are touched) ---------- */
/* FAB: one primary action per screen, bottom-right above the tab bar */
.fab{position:fixed;right:max(16px,env(safe-area-inset-right,0px));bottom:calc(var(--tab-h) + 16px + env(safe-area-inset-bottom,0px));z-index:35;min-width:56px;min-height:56px;border-radius:var(--r-pill);background:var(--accent);color:var(--accent-fg);border:0;font:inherit;font-weight:700;font-size:15px;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:0 20px;box-shadow:0 8px 24px rgba(0,0,0,.3);cursor:pointer}
.fab .ic{font-size:22px;line-height:1}
.fab.round{padding:0;width:56px}
@media (min-width:761px){.fab{bottom:24px}}
/* Bottom sheet with a form or settings inside (.sheet is the backdrop; .sheetbox the panel) */
.sheetbox.form{gap:12px;padding:8px 16px calc(16px + env(safe-area-inset-bottom,0px));max-height:88dvh}
.sheetbox .grab{width:40px;height:4px;border-radius:2px;background:var(--line);margin:0 auto 4px;flex:none}
.sheetbox h2{margin:0;font-size:18px;display:flex;align-items:center;gap:10px}
.sheetbox h2 .sp{flex:1}
.sheetbox .form-actions{display:flex;gap:8px;margin-top:4px}
.sheetbox .form-actions .btn{flex:1;min-height:44px}
.sheetbox .form-actions .btn.ghost{flex:0 0 auto;background:transparent;border-color:transparent;color:var(--muted)}
.sheetbox p{margin:0;font-size:14px;line-height:1.5}
.sheetbox .hint{font-size:12px;color:var(--muted)}
.sheetbox .form .err{margin:0}
/* Setting rows inside sheets: label left, control right */
.setrow{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:48px;padding:4px 0;border-top:1px solid var(--line)}
.setrow:first-of-type{border-top:0}
.setrow>span{font-weight:600}
.setrow small{display:block;color:var(--muted);font-weight:400;font-size:12px}
/* Segmented control */
.seg{display:inline-flex;background:var(--panel2);border:1px solid var(--line);border-radius:var(--r-pill);padding:2px;gap:2px}
.seg button{font:inherit;font-size:13px;font-weight:600;border:0;background:transparent;color:var(--muted);border-radius:var(--r-pill);padding:0 12px;min-height:34px;cursor:pointer}
.seg button[aria-pressed="true"]{background:var(--panel);color:var(--fg);box-shadow:0 1px 3px rgba(0,0,0,.2)}
/* Switch (a styled checkbox) */
.switch{position:relative;display:inline-flex;align-items:center;flex:none;width:48px;height:28px}
.switch input{position:absolute;inset:0;opacity:0;margin:0;width:100%;height:100%;cursor:pointer}
.switch i{position:absolute;inset:0;border-radius:14px;background:var(--line);transition:background-color var(--t-fast)}
.switch i::after{content:"";position:absolute;top:3px;left:3px;width:22px;height:22px;border-radius:50%;background:#fff;transition:transform var(--t-fast)}
.switch input:checked+i{background:var(--accent)}
.switch input:checked+i::after{transform:translateX(20px)}
.switch input:focus-visible+i{outline:2px solid var(--accent);outline-offset:2px}
/* Skeleton tiles / rows while data loads: <div class="skel tile"> or .skel.line */
.skel.tile{min-height:88px}
.skel.line{height:14px;margin:6px 0}
.skel.line.w60{width:60%}.skel.line.w40{width:40%}
/* Offline banner (shell listens to online/offline) */
.offline{position:fixed;left:0;right:0;top:0;z-index:70;background:var(--warn-bg);color:var(--warn);font-size:13px;font-weight:600;text-align:center;padding:calc(6px + env(safe-area-inset-top,0px)) 12px 6px;border-bottom:1px solid var(--line)}
/* Money: shown plainly (owner's choice, 22 Oct 2026: no blur), never animated. Privacy comes from the lock. */
.money{font-variant-numeric:tabular-nums;white-space:nowrap}
@media (prefers-reduced-motion:reduce){.switch i,.switch i::after{transition:none!important}}

/* ======================= layout: three screens, one stylesheet =======================
   Named breakpoints (CSS has no custom media yet; copy the query where the name is used):
     @custom-media --cover    (max-width:430px) and (max-aspect-ratio:10/21);   Fold cover, ~360–420 wide, ~21:9
     @custom-media --phone    (max-width:760px);                                 iPhone 17 Pro Max ~440×956 and other phones (tab bar)
     @custom-media --two      (min-width:700px) and (min-height:560px);          list + detail side by side
     @custom-media --rail     (min-width:761px) and (max-width:1180px) and (max-aspect-ratio:4/3);  Fold inner, near-square: icon rail sidebar
     @custom-media --book     (horizontal-viewport-segments:2);                  fold runs top to bottom, nothing on the hinge
     @custom-media --tabletop (vertical-viewport-segments:2);                    half folded, controls on the bottom segment
   js/ek-layout.js mirrors these as <html data-device="cover|phone|unfolded|tablet" data-posture="flat|book|tabletop" data-pane>.
   Utilities: .two-pane > .pane-list + .pane-detail; screens pair with data-pane="list|detail" + data-pane-peer (see ek-layout.js). */
.two-pane{display:grid;gap:14px;grid-template-columns:minmax(0,1fr)}
.pane-list,.pane-detail{min-width:0}

/* iOS: 16px inputs on any touch screen so focusing never zooms */
@media (pointer:coarse){input,select,textarea{font-size:max(16px,1em)}input[type=checkbox],input[type=radio]{font-size:inherit}}

/* --two: list + detail */
@media (min-width:700px) and (min-height:560px){
  .two-pane{grid-template-columns:var(--pane-a,minmax(0,5fr)) minmax(0,7fr);gap:20px;align-items:start}
  .two-pane>.pane-list{position:sticky;top:calc(12px + env(safe-area-inset-top,0px));max-height:calc(100dvh - 24px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));overflow:auto;overscroll-behavior:contain}
  .shell>main.has-pane{display:grid;grid-template-columns:var(--pane-a,minmax(0,5fr)) minmax(0,7fr);column-gap:24px;grid-auto-flow:row dense;align-items:start;max-width:1400px}
  .shell>main.has-pane>*{grid-column:1/-1}
  .shell>main.has-pane>.screen[data-pane=list]{grid-column:1}
  .shell>main.has-pane>.screen[data-pane=detail]{grid-column:2}
  .shell>main.has-pane>.screen.pane-peer{display:block;position:sticky;top:calc(12px + env(safe-area-inset-top,0px));max-height:calc(100dvh - 24px - env(safe-area-inset-top,0px));overflow:auto;overscroll-behavior:contain;padding-right:4px}
  .shell>main.has-pane>.screen.pane-peer .back{display:none}
}
@media (min-width:700px) and (max-width:760px) and (min-height:560px){
  .shell>main.has-pane>.screen.pane-peer{max-height:calc(100dvh - var(--tab-h) - 36px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))}
}

/* --rail: Fold inner screen (and other near-square windows): the sidebar shrinks to an icon rail so two panes fit */
@media (min-width:761px) and (max-width:1180px) and (max-aspect-ratio:4/3){
  :root{--side-w:84px}
  .sidebar{padding:calc(12px + env(safe-area-inset-top,0px)) 6px calc(12px + env(safe-area-inset-bottom,0px)) max(6px,env(safe-area-inset-left,0px));align-items:stretch}
  .sidebar>.brand{font-size:0;justify-content:center;margin-bottom:8px;position:relative}
  .sidebar>.brand .dot{position:absolute;right:8px;top:0;margin:0}
  .sidebar .nav button,.sidebar .nav a{flex-direction:column;justify-content:center;gap:3px;padding:8px 2px;min-height:56px;font-size:12px;line-height:1.15;text-align:center;position:relative}
  .sidebar .nav .ic{width:auto;font-size:18px}
  .sidebar .nav .home{padding-bottom:10px}
  .sidebar .cnt{position:absolute;top:4px;right:6px;margin:0;font-size:12px;padding:0 5px;min-width:16px}
  .sidebar .sync,.sidebar .who{display:none}
  .shell>main{max-width:none}
}

/* --cover: Fold cover screen. One column, bigger targets, compact header, the primary action down by the thumb. */
@media (max-width:430px) and (max-aspect-ratio:10/21){
  :root{--tab-h:60px}
  .shell>main{padding-left:max(10px,env(safe-area-inset-left,0px));padding-right:max(10px,env(safe-area-inset-right,0px))}
  .topline{margin-bottom:8px}
  .shell h1{font-size:20px}
  .tabbar button,.tabbar a{min-height:56px}
  .btn{min-height:48px}
  .btn.sm{min-height:44px}
  .icon-btn{min-width:44px;min-height:44px}
  .chips button,.filters button{min-height:44px}
  /* a section's "+ Add" in its header moves to a floating button above the tab bar */
  .screen.on .primary-act{position:fixed;right:max(12px,env(safe-area-inset-right,0px));bottom:calc(var(--tab-h) + 14px + env(safe-area-inset-bottom,0px));z-index:35;min-height:52px;border-radius:var(--r-pill);padding:0 20px;box-shadow:0 8px 24px rgba(0,0,0,.3)}
  #toast{bottom:calc(var(--tab-h) + 80px + env(safe-area-inset-bottom,0px))}
}

/* --book: two segments side by side. Panes split at the hinge (ek-layout.js sets --pane-a); overlays use the right segment. */
@media (horizontal-viewport-segments:2){
  .two-pane,.shell>main.has-pane{column-gap:calc(var(--hinge-w,0px) + 24px)}
  .dlg{margin-left:calc(env(viewport-segment-left 1 0,50vw) + 12px);margin-right:12px;max-width:calc(env(viewport-segment-width 1 0,50vw) - 24px)}
  .sheet{padding-left:env(viewport-segment-left 1 0,0px)}
  .sheetbox{max-width:env(viewport-segment-width 1 0,100%)}
  #toast{left:calc(env(viewport-segment-left 1 0,50vw) + env(viewport-segment-width 1 0,50vw) / 2);max-width:calc(env(viewport-segment-width 1 0,92vw) - 24px)}
}
/* --tabletop: half folded. Reading on the top segment; sheets, dialogs and toasts on the bottom one, tab bar stays at the bottom. */
@media (vertical-viewport-segments:2){
  .sheet{padding-top:env(viewport-segment-top 0 1,0px)}
  .sheetbox{max-height:env(viewport-segment-height 0 1,80dvh)}
  .dlg[open]{position:fixed;inset:auto 0 0 0;margin:0 auto;max-height:calc(env(viewport-segment-height 0 1,92dvh) - 8px);border-radius:14px 14px 0 0}
  .fab{bottom:calc(var(--tab-h) + 16px + env(safe-area-inset-bottom,0px))}
}

/* Fold / unfold: a short cross-fade when the layout switches (View Transitions do this where supported) */
@media (prefers-reduced-motion:no-preference){html.ek-relayout body{animation:ekrelayout .2s ease-out}@keyframes ekrelayout{from{opacity:.55}to{opacity:1}}}
/* Flex Mode (half folded, Device Posture "folded" or two vertical segments): reading on the top half,
   tab bar, FAB, sheets and dialogs on the bottom half. --hinge-y / --hinge-h come from js/ek-layout.js. */
:root[data-posture="tabletop"] .shell>main{max-height:var(--hinge-y,50vh);overflow:auto;overscroll-behavior:contain;padding-bottom:16px}
:root[data-posture="tabletop"] .shell>main.has-pane>.screen.pane-peer,:root[data-posture="tabletop"] .two-pane>.pane-list{max-height:calc(var(--hinge-y,50vh) - 24px)}
:root[data-posture="tabletop"] .sheet{padding-top:calc(var(--hinge-y,50vh) + var(--hinge-h,0px))}
:root[data-posture="tabletop"] .sheetbox{max-height:calc(100dvh - var(--hinge-y,50vh) - var(--hinge-h,0px))}
:root[data-posture="tabletop"] .dlg[open]{position:fixed;inset:auto 0 0 0;margin:0 auto;max-height:calc(100dvh - var(--hinge-y,50vh) - var(--hinge-h,0px) - 8px);border-radius:14px 14px 0 0}
/* keyboard shortcuts sheet (js/ek-keys.js) */
.keysheet .sheetbox{max-width:420px;margin:0 auto}
.keyshead{font-family:var(--display);font-size:16px;padding:8px 12px 4px}
.keyrow{display:flex;align-items:center;gap:14px;padding:8px 12px;min-height:40px}
.keyrow kbd{font-family:var(--mono);font-size:13px;font-weight:600;min-width:52px;text-align:center;padding:3px 8px;border:1px solid var(--line);border-bottom-width:2px;border-radius:6px;background:var(--panel2);color:var(--fg)}

/* ======================= Ink & Brass components ======================= */
/* Icons: vendored Lucide SVGs (/icons, ISC) painted in currentColor through a mask. <i class="li li-sun" aria-hidden="true"></i> */
.li{display:inline-block;width:1.2em;height:1.2em;flex:none;vertical-align:-.22em;background:currentColor;-webkit-mask:var(--li) center/contain no-repeat;mask:var(--li) center/contain no-repeat;font-style:normal}
.li-sun{--li:url(/icons/sun.svg)}.li-receipt{--li:url(/icons/receipt.svg)}.li-kanban{--li:url(/icons/kanban.svg)}.li-inbox{--li:url(/icons/inbox.svg)}
.li-hand-coins{--li:url(/icons/hand-coins.svg)}.li-basket{--li:url(/icons/shopping-basket.svg)}.li-safe{--li:url(/icons/safe.svg)}.li-lock-open{--li:url(/icons/lock-open.svg)}
.li-lock{--li:url(/icons/lock.svg)}.li-news{--li:url(/icons/newspaper.svg)}.li-fingerprint{--li:url(/icons/fingerprint.svg)}.li-house{--li:url(/icons/house.svg)}
.li-settings{--li:url(/icons/settings.svg)}.li-phone{--li:url(/icons/phone.svg)}.li-list-checks{--li:url(/icons/list-checks.svg)}.li-car{--li:url(/icons/car.svg)}
.li-circle-check{--li:url(/icons/circle-check.svg)}.li-more{--li:url(/icons/ellipsis.svg)}.li-list{--li:url(/icons/list.svg)}.li-plus{--li:url(/icons/plus.svg)}
.li-repeat{--li:url(/icons/repeat.svg)}.li-dashboard{--li:url(/icons/layout-dashboard.svg)}.li-rupee{--li:url(/icons/indian-rupee.svg)}.li-calendar{--li:url(/icons/calendar.svg)}
.li-coins{--li:url(/icons/coins.svg)}.li-handshake{--li:url(/icons/handshake.svg)}.li-lifebuoy{--li:url(/icons/life-buoy.svg)}.li-chart{--li:url(/icons/chart-column.svg)}
.li-shield{--li:url(/icons/shield-question.svg)}.li-radio{--li:url(/icons/radio.svg)}.li-card{--li:url(/icons/id-card.svg)}.li-percent{--li:url(/icons/percent.svg)}
.li-mail{--li:url(/icons/mail.svg)}.li-external{--li:url(/icons/external-link.svg)}.li-user{--li:url(/icons/user.svg)}.li-hourglass{--li:url(/icons/hourglass.svg)}
.li-users{--li:url(/icons/users.svg)}.li-clock{--li:url(/icons/clock.svg)}.li-check{--li:url(/icons/check.svg)}.li-chevron{--li:url(/icons/chevron-down.svg)}
.li-x{--li:url(/icons/x.svg)}.li-eye{--li:url(/icons/eye.svg)}.li-logout{--li:url(/icons/log-out.svg)}.li-bell{--li:url(/icons/bell.svg)}.li-layers{--li:url(/icons/layers.svg)}
.tabbar .li{width:22px;height:22px}
.sidebar .nav .ic .li,.sheetbox .ic .li{width:18px;height:18px}

/* Brand mark: an ink squircle with a brass "ek" monogram (pages render <span class="logo">E</span>) */
.brand .logo{background:var(--ink);color:var(--brass);font-size:0!important;border:1px solid color-mix(in srgb,var(--brass) 35%,transparent);border-radius:30%}
.brand .logo::before{content:"ek";font-family:"Sora",system-ui,sans-serif;font-weight:800;font-size:14px;letter-spacing:-.04em;line-height:1;color:#D9B25F;transform:translateY(-1px)}

/* Money: tabular figures, a smaller muted ₹ where the markup wraps it (<span class="cur">₹</span>), arrows beside colour */
.money,.num,.tile .v,.kpi .value,.hero .value{font-variant-numeric:tabular-nums}
.cur{font-size:.78em;color:var(--muted);font-weight:500;margin-right:.08em}
:is(span,td,b,strong,.v).pos::before,:is(span,td,b,strong,.v).neg::before{font-size:.7em;margin-right:.25em;vertical-align:.1em;font-weight:700}
:is(span,td,b,strong,.v).pos::before{content:"▲"}:is(span,td,b,strong,.v).neg::before{content:"▼"}
.pos.noarrow::before,.neg.noarrow::before{content:none}

/* Empty state: a small line illustration, one sentence, one button. <div class="empty"><i class="li li-inbox"></i><b>…</b>…</div> */
.empty{display:grid;justify-items:center;gap:6px;color:var(--muted);text-align:center;padding:28px 16px;border:1px dashed var(--line);border-radius:var(--r);font-size:14px;margin:0 0 14px;background:transparent}
.empty::before{content:"";width:64px;height:40px;margin-bottom:4px;background:var(--line);-webkit-mask:url(/icons/empty-line.svg) center/contain no-repeat;mask:url(/icons/empty-line.svg) center/contain no-repeat}
.empty>.li{width:28px;height:28px;color:var(--accent);margin-bottom:2px}
.empty:has(>.li)::before{display:none}
.empty .btn{margin-top:6px}
td>.empty{margin:0;padding:18px 10px}
td>.empty::before{display:none}

/* Lock component (EK.lockPanel): the unlock sheet and the in-section overlay share it */
.lockveil{position:fixed;inset:0;z-index:70;display:grid;place-items:center;padding:16px;background:color-mix(in srgb,var(--bg) 62%,transparent);-webkit-backdrop-filter:blur(14px) saturate(1.1);backdrop-filter:blur(14px) saturate(1.1);animation:ekfade var(--settle) var(--ease-out) both}
.lockveil.clearing{opacity:0;transition:opacity var(--settle) var(--ease-out),backdrop-filter var(--settle)}
.lockcard{background:var(--panel);border:1px solid var(--line);border-radius:var(--r-lg);padding:22px 18px 18px;width:min(100%,400px);box-shadow:var(--shadow);animation:ekpop var(--spring) var(--ease-spring) both}
.lockpanel{display:grid;gap:10px}
.lockpanel h2{font-family:var(--display);font-size:var(--t3);margin:0;text-align:center;text-transform:none;letter-spacing:0;color:var(--fg);justify-content:center}
.lockmark{display:grid;place-items:center;width:56px;height:56px;margin:0 auto 2px;border-radius:30%;background:var(--ink);color:#D9B25F;border:1px solid color-mix(in srgb,var(--brass) 35%,transparent)}
.padlock{width:30px;height:30px;display:block;overflow:visible}
.padlock .lhole{fill:var(--ink)}
.padlock .shackle{transform-origin:21px 14px;transition:transform var(--spring) var(--ease-spring)}
.lockpanel.opening .padlock .shackle{transform:translateY(-3px) rotate(-22deg)}
.locksub{margin:0;text-align:center;color:var(--muted);font-size:14px;line-height:1.45}
.locksub b{color:var(--fg);font-weight:600}
.lockfp{min-height:52px;font-size:16px;width:100%}
.lockfp .li{width:22px;height:22px}
.lockor{margin:0;text-align:center;font-size:12px;color:var(--muted)}
.lockpw input{margin-top:4px}
.lockerr{margin:0;min-height:0;color:var(--bad);font-size:13px;font-weight:600;text-align:center}
.lockerr:empty{display:none}
.lockacts{display:flex;gap:8px}
.lockacts .btn{flex:1;min-height:44px}
.lockrec{margin:0;text-align:center;font-size:13px;color:var(--muted)}
.shake{animation:ekshake 320ms cubic-bezier(.36,.07,.19,.97) both}
@keyframes ekshake{10%,90%{transform:translateX(-2px)}20%,80%{transform:translateX(4px)}30%,50%,70%{transform:translateX(-7px)}40%,60%{transform:translateX(7px)}}
:root.locked body{overflow:hidden}

/* Cold-start brand moment (index.html): 450 ms, CSS only, tap to skip, once per session (js/ek-boot.js sets .nosplash) */
.splash{position:fixed;inset:0;z-index:90;display:grid;place-items:center;background:var(--ink);animation:eksplash 450ms var(--ease-in) forwards;cursor:pointer}
.splash .mark{display:grid;place-items:center;width:96px;height:96px;border-radius:30%;border:1px solid rgba(217,178,95,.35);color:#D9B25F;font-family:"Sora",system-ui,sans-serif;font-weight:800;font-size:40px;letter-spacing:-.05em;animation:eksplashmark 450ms var(--ease-spring) both}
@keyframes eksplash{0%,70%{opacity:1}100%{opacity:0;visibility:hidden;pointer-events:none}}
@keyframes eksplashmark{from{transform:scale(.9);opacity:.4}to{transform:none;opacity:1}}
:root.nosplash .splash,.splash.gone{display:none}
@media (prefers-reduced-motion:reduce){.splash{display:none}.lockveil,.lockcard,.shake{animation:none!important}.padlock .shackle,.lockveil.clearing{transition:none}}
/* the lock component inside a bottom sheet (js/ek-unlock.js) */
.sheetbox.lockcard{position:relative;width:100%;max-width:520px;margin:0 auto;border-radius:var(--r-lg) var(--r-lg) 0 0;padding:8px 18px calc(18px + env(safe-area-inset-bottom,0px));animation:ekup var(--spring) var(--ease-spring) both;box-shadow:var(--shadow)}
.sheet:has(>.lockcard){justify-content:center}
.lockx{position:absolute;right:6px;top:6px}
.lockx .li{width:20px;height:20px}
/* Section pages: a faint wash of the section colour behind the header */
:root[data-sec]:not([data-sec="home"]) body{background:linear-gradient(180deg,color-mix(in srgb,var(--sec) 8%,var(--bg)) 0,var(--bg) 240px) no-repeat,var(--bg)}

/* ======================= Shared navigation (js/ek-nav.js, ek-search.js, ek-quickadd.js) ======================= */
.li-search{--li:url(/icons/search.svg)}.li-mic{--li:url(/icons/mic.svg)}.li-pin{--li:url(/icons/pin.svg)}.li-sticky{--li:url(/icons/sticky-note.svg)}.li-chevron-up{--li:url(/icons/chevron-up.svg)}
/* One bottom bar on every page: Today · Inbox · (+) · Planner · Search. Phones always; wide screens only where the page has no sidebar. */
.eknav{display:grid;grid-template-columns:repeat(5,1fr);align-items:end;position:fixed;left:0;right:0;bottom:0;z-index:45;min-height:var(--tab-h);background:color-mix(in srgb,var(--panel) 94%,transparent);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border-top:1px solid var(--line);padding:2px max(4px,env(safe-area-inset-right,0px)) calc(2px + env(safe-area-inset-bottom,0px)) max(4px,env(safe-area-inset-left,0px));box-sizing:border-box}
.eknav.n4{grid-template-columns:repeat(4,1fr)}
.eknav>a,.eknav>button{all:unset;box-sizing:border-box;display:grid;gap:2px;place-items:center;align-content:center;min-height:52px;font-size:12px;font-weight:600;color:var(--muted);cursor:pointer;border-radius:var(--r-sm);line-height:1.1;text-align:center;-webkit-tap-highlight-color:transparent;transition:transform var(--press) var(--ease-out),color var(--settle)}
.eknav>a:active,.eknav>button:active{transform:scale(.94)}
.eknav>a.on,.eknav>a[aria-current="page"]{color:var(--brass)}
.eknav>a:focus-visible,.eknav>button:focus-visible{outline:2px solid var(--brass);outline-offset:-2px}
.eknav-ic{position:relative;display:grid;place-items:center}
.eknav .li{width:22px;height:22px}
.eknav-badge{position:absolute;top:-5px;left:calc(100% - 8px);min-width:16px;height:16px;padding:0 4px;box-sizing:border-box;border-radius:var(--r-pill);background:var(--brass);color:var(--ink);font:700 11px/16px var(--body);font-style:normal;text-align:center}
.eknav-badge[hidden],.eknav-side .eknav-badge[hidden]{display:none}
.eknav-add{align-self:center}
.eknav-add>span{display:grid;place-items:center;width:52px;height:52px;margin-top:-14px;border-radius:50%;background:var(--brass);color:var(--ink);box-shadow:0 6px 18px rgba(0,0,0,.28),0 0 0 4px var(--bg)}
.eknav-add .li{width:26px;height:26px}
:root.ek-hasnav body{padding-bottom:0}
:root.ek-hasnav #toast{bottom:calc(var(--tab-h) + 18px + env(safe-area-inset-bottom,0px))}
:root.ek-hasnav .fab{bottom:calc(var(--tab-h) + 16px + env(safe-area-inset-bottom,0px))}
@media (min-width:761px){
  :root.ek-hasside .eknav{display:none}
  :root.ek-hasnav:not(.ek-hasside) .eknav{left:50%;right:auto;transform:translateX(-50%);width:min(520px,calc(100vw - 32px));bottom:calc(12px + env(safe-area-inset-bottom,0px));border:1px solid var(--line);border-radius:var(--r-lg);box-shadow:var(--shadow);padding-bottom:2px}
}
/* the same five at the top of a section's sidebar */
.eknav-side{border-bottom:1px solid var(--line);padding-bottom:8px;margin-bottom:6px}
.sidebar .eknav-side a,.sidebar .eknav-side button{position:relative}
.eknav-side .eknav-badge{position:static;margin-left:auto}
.sidebar .eknav-side .on,.sidebar .eknav-side [aria-current="page"]{color:var(--brass)}
/* a section's own tabs: a compact segmented row at the top (phones). Wide screens keep the sidebar. */
.tabbar.ek-seg{display:none}
@media (max-width:760px){
  .tabbar.ek-seg{display:flex;position:static;inset:auto;z-index:auto;min-height:0;gap:2px;padding:3px;margin:0 0 12px;background:var(--panel);border:1px solid var(--line);border-radius:var(--r-pill);overflow-x:auto;scrollbar-width:none;grid-template-columns:none}
  .tabbar.ek-seg::-webkit-scrollbar{display:none}
  .tabbar.ek-seg button,.tabbar.ek-seg a{display:inline-flex;flex:1 0 auto;gap:6px;min-height:44px;padding:0 12px;font-size:13px;border-radius:var(--r-pill);white-space:nowrap;justify-content:center}
  .tabbar.ek-seg .li{width:16px;height:16px}
  .tabbar.ek-seg .on,.tabbar.ek-seg [aria-current="page"]{background:var(--panel2);color:var(--fg)}
  .tabbar.ek-seg .cnt{position:static;margin-left:2px}
  :root.ek-hasnav .shell>main{padding-bottom:calc(var(--tab-h) + 28px + env(safe-area-inset-bottom,0px))}
}
@media (max-width:430px) and (max-aspect-ratio:10/21){.tabbar.ek-seg button,.tabbar.ek-seg a{min-height:44px}}
/* Flex Mode: the bar sits on the bottom segment; the top half reads. */
:root[data-posture="tabletop"] .eknav{min-height:64px}
.eknav-note{display:flex;align-items:center;gap:8px;margin:0 0 12px;padding:6px 6px 6px 12px}
.eknav-note span{flex:1}
@media print{.eknav,.eknav-side{display:none!important}}

/* Search sheet and quick add (bottom sheets) */
.eksheet .sheetbox{max-width:620px;margin:0 auto;max-height:86dvh;padding-top:8px;gap:2px;animation:ekup var(--spring) var(--ease-spring) both}
.eksheet{justify-content:center}
.eksheet .grab{width:40px;height:4px;border-radius:2px;background:var(--line);margin:2px auto 8px}
.eksearch-in{display:flex;align-items:center;gap:8px;padding:0 4px 8px;position:sticky;top:-8px;background:var(--panel);z-index:1}
.eksearch-in .li{width:18px;height:18px;color:var(--muted);flex:none}
.eksearch-in input{flex:1;border-radius:var(--r-pill);padding-left:14px}
.ekgroup{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:600;padding:10px 12px 2px}
.sheetbox .ekrow small{display:block;font-weight:400;font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sheetbox .ekrow>span:not(.ic){min-width:0;flex:1}
.sheetbox .ekrow b{font-weight:600;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sheetbox .ekrow.sel{background:var(--panel2)}
.ekempty{padding:14px 12px;color:var(--muted);font-size:14px}
.ekqa-line{display:flex;gap:8px;align-items:flex-end}
.ekqa-line textarea{flex:1;resize:none;min-height:48px;max-height:30dvh;font-size:16px;border-radius:var(--r)}
.ekqa-line .icon-btn{flex:none;min-height:48px}
.ekqa-got{display:flex;flex-wrap:wrap;gap:6px;align-items:center;min-height:30px;padding:8px 2px 2px;font-size:12px;color:var(--muted)}
.ekqa-got .pill{background:var(--brass-bg);color:var(--brass)}
.ekqa-types{display:flex;gap:6px;flex-wrap:wrap;padding:6px 0 4px}
.ekqa-types button[aria-pressed="true"]{background:var(--brass-bg);color:var(--brass);border-color:color-mix(in srgb,var(--brass) 45%,transparent)}
.ekqa-acts{display:flex;gap:8px;justify-content:flex-end;padding-top:8px}
.ekqa-acts .btn{min-width:96px}
.ekqa-acts .btn.go{background:var(--brass);color:var(--ink)}
.ekqa-mic.on{color:var(--bad)}
.ekpick{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:6px;padding:4px 0}
.ekpick button{border:1px solid var(--line)!important}
.ekpins .ekrow{gap:8px}
.ekpins .ekrow .acts{display:flex;gap:2px;margin-left:auto}
.ekpins .ekrow .acts .icon-btn{min-width:44px;min-height:44px}
.ekpins .ekrow [aria-pressed="true"]{color:var(--brass)}
.ekpins .ekrow.off b{color:var(--muted)}
:root.ek-hasnav main.share{padding-bottom:calc(var(--tab-h) + 32px + env(safe-area-inset-bottom,0px))}
.sheetbox .ekqa-types button{all:unset;box-sizing:border-box;cursor:pointer;display:inline-flex;align-items:center;min-height:44px;padding:0 14px;border-radius:var(--r-pill);font-size:13px;font-weight:600;background:var(--panel);border:1px solid var(--line);color:var(--muted)}
.sheetbox .ekqa-types button[aria-pressed="true"]{background:var(--brass-bg);color:var(--brass);border-color:color-mix(in srgb,var(--brass) 45%,transparent)}
.sheetbox .ekqa-types button:focus-visible{outline:2px solid var(--brass)}
.sheetbox .ekpick button{border:1px solid var(--line);min-height:52px}
@media (max-width:760px){.shell>.tabbar.ek-seg{margin:calc(12px + env(safe-area-inset-top,0px)) max(12px,env(safe-area-inset-right,0px)) 0 max(12px,env(safe-area-inset-left,0px))}}

.li-headphones{--li:url(/icons/headphones.svg)}.li-folder-open{--li:url(/icons/folder-open.svg)}.li-users{--li:url(/icons/users.svg)}
body.signed-out #eknav,body.signed-out .eknav-side{display:none!important}

/* ======================= core review 22 Oct: shared header, sheet, targets, motion ======================= */
/* One page header for every section (.ek-head): brand dot + the section title, once. No "Notes Notes Notes".
   <header class="ek-head"><a class="ek-dot" href="/" aria-label="Home"></a><h1>Notes</h1><span class="ek-head-acts">…buttons…</span></header> */
.ek-head{display:flex;align-items:center;gap:10px;min-height:56px;padding:calc(6px + env(safe-area-inset-top,0px)) max(16px,env(safe-area-inset-right,0px)) 6px max(16px,env(safe-area-inset-left,0px))}
.ek-head h1{margin:0;font-family:var(--display);font-size:var(--t3,22px);font-weight:700;letter-spacing:-.01em;line-height:1.15;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ek-head .ek-dot{width:44px;height:44px;flex:none;display:grid;place-items:center;margin-left:-12px;border-radius:50%;text-decoration:none}
.ek-head .ek-dot::before{content:"";width:12px;height:12px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 18%,transparent)}
.ek-head .ek-head-acts{display:flex;align-items:center;gap:4px;flex:none}
/* Shared sheet (js/ek-sheet.js): the page behind does not scroll; the panel keeps clear of the home bar */
html.ek-sheet-open body{overflow:hidden}
.sheetbox[role=dialog]:focus{outline:none}
/* 44 px minimum tap targets everywhere */
.btn.sm,.chips button,.chip,.seg button,#toast button,.sheetbox .ekqa-types button,.pay-row .btn.sm{min-height:44px}
.seg button{padding:0 14px}
.chips button,.chip{padding:0 14px}
/* Quick add: type chips first, with their icons */
.sheetbox .ekqa-types button{gap:6px}
.ekqa-types .li{width:16px;height:16px}
/* Search: offline note */
.ekoff{margin:6px 12px 2px;padding:8px 12px;border-radius:var(--r-sm);background:var(--panel2);color:var(--muted);font-size:13px}
/* Reduced motion, everywhere: no animation or transition longer than a blink, no smooth scroll */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
  ::view-transition-group(*),::view-transition-old(*),::view-transition-new(*){animation:none!important}
}

/* ======================= review 3 Nov 2026: back arrow, form order, skeleton, empty state, Fold ======================= */
.li-chevron-left{--li:url(/icons/chevron-left.svg)}
/* Sub-screen header: <header class="ek-head sub"><button class="ek-back" aria-label="Back">…</button><h1>Title</h1></header> */
.ek-head.sub{padding:0 0 8px;min-height:52px;margin:0}
.ek-back{font:inherit;flex:none;width:44px;height:44px;margin-left:-10px;display:grid;place-items:center;border:0;background:transparent;color:var(--fg);border-radius:50%;cursor:pointer;font-size:20px;text-decoration:none}
.ek-back:hover{background:var(--panel2)}
.ek-back .li{width:22px;height:22px}
/* Form buttons: Delete (or the secondary action) left, Save right; close with the X in the header */
.form-row-end,.ek-form-acts{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:10px}
.form-row-end>:last-child,.ek-form-acts>:last-child{margin-left:auto}
.ek-form-acts .danger,.ek-form-acts [data-del]{margin-right:auto}
.ek-x{font:inherit;flex:none;width:44px;height:44px;display:grid;place-items:center;border:0;background:transparent;color:var(--muted);border-radius:50%;cursor:pointer;font-size:20px;margin-left:auto}
.ek-x:hover{background:var(--panel2);color:var(--fg)}
/* Shared loading skeleton: <div class="ek-skel" aria-busy="true" aria-label="Loading"><div class="ek-skel-row"></div>…</div> */
.ek-skel{display:grid;gap:10px;padding:4px 0;pointer-events:none}
.ek-skel-row{height:56px;border-radius:var(--r);background:var(--panel2);animation:ekpulse 1.1s ease-in-out infinite alternate}
.ek-skel-row:nth-child(2){opacity:.8}.ek-skel-row:nth-child(3){opacity:.6}.ek-skel-row:nth-child(n+4){opacity:.4}
@media (prefers-reduced-motion:reduce){.ek-skel-row{animation:none}}
/* Shared empty state: icon, one line, one primary action
   <div class="ek-empty"><i class="li li-…" aria-hidden="true"></i><p>Nothing here yet.</p><button class="btn">Add</button></div> */
.ek-empty{display:grid;justify-items:center;gap:10px;text-align:center;padding:36px 16px;color:var(--muted);font-size:15px}
.ek-empty>.li,.ek-empty>.ic{width:36px;height:36px;font-size:32px;color:var(--muted);opacity:.8}
.ek-empty p{margin:0;max-width:32ch}
.ek-empty .btn{margin-top:4px}
/* Fold inner screen (>=700px): readable line length; two panes where a page marks them */
@media (min-width:700px){
  .ek-cols{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:20px;align-items:start}
  .ek-read{max-width:72ch}
}
.form-actions .ek-del{flex:0 0 auto!important;margin-right:auto;color:var(--bad)!important}
.sheetbox h2.ek-sheet-h{display:flex;align-items:center;gap:8px}
.sheetbox h2.ek-sheet-h>span{flex:1;min-width:0}

/* Android app: new version banner (js/ek-app.js) */
.ek-app-update{position:fixed;left:12px;right:12px;bottom:calc(84px + env(safe-area-inset-bottom));z-index:60;display:flex;gap:10px;align-items:center;justify-content:space-between;background:var(--panel2,#1f2229);border:1px solid var(--accent,#c9a45c);border-radius:14px;padding:10px 12px;font-size:.9rem;max-width:560px;margin:0 auto}
