@font-face { font-family: "Bricolage"; src: url("/static/fonts/bricolage.woff2") format("woff2");
  font-weight: 300 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "Instrument"; src: url("/static/fonts/instrument-italic.woff2") format("woff2");
  font-style: italic; font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/static/fonts/poppins-500.woff2") format("woff2");
  font-weight: 500; font-display: swap; }

:root {
  color-scheme: dark;
  --ink: #060a1c;
  --ink-2: #0e1433;
  --glass: rgba(150, 170, 255, 0.075);
  --glass-hi: rgba(170, 190, 255, 0.12);
  --edge: rgba(205, 215, 255, 0.16);
  --edge-hi: rgba(255, 255, 255, 0.28);
  --text: #eef1ff;
  --muted: #a3abd0;
  --faint: #6b74a0;
  --grid: rgba(200, 210, 255, 0.09);
  --cobalt: #3d63ff;
  --line: #5f82ff;
  --in: #16b08c;
  --hold: #c9860f;
  --short: #ee5368;
  --low-bg: rgba(201, 134, 15, 0.16);
  --short-bg: rgba(238, 83, 104, 0.17);
  --r-lg: 28px;
  --r-md: 18px;
  --pill: 999px;
  --pad: clamp(16px, 4vw, 28px);
  font-family: "Bricolage", system-ui, sans-serif;
  font-variation-settings: "opsz" 14;
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; overflow-x: hidden; }
button, input { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }

/* The light field the glass sits on: cobalt and deep teal, fixed. */
.field { position: fixed; inset: -20vmax; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38vmax 30vmax at 18% 12%, rgba(61, 99, 255, 0.55), transparent 70%),
    radial-gradient(34vmax 28vmax at 88% 30%, rgba(22, 150, 160, 0.32), transparent 70%),
    radial-gradient(40vmax 34vmax at 60% 95%, rgba(84, 52, 220, 0.30), transparent 70%),
    var(--ink);
  filter: saturate(115%); }
.field::after { content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 3px 3px; mix-blend-mode: overlay; }

.glass { background: linear-gradient(180deg, var(--glass-hi), var(--glass) 40%);
  -webkit-backdrop-filter: blur(26px) saturate(160%); backdrop-filter: blur(26px) saturate(160%);
  border: 1px solid var(--edge); border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 var(--edge-hi), 0 30px 60px -30px rgba(0, 0, 20, 0.7); }

/* ---------- top bar ---------- */
.bar { position: sticky; top: 0; z-index: 20; padding: calc(env(safe-area-inset-top) + 10px) var(--pad) 10px;
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(180deg, rgba(6,10,28,0.85), rgba(6,10,28,0.45));
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--grid); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.wordmark { font-family: "Poppins", sans-serif; font-weight: 500; font-size: 19px; letter-spacing: -0.01em; }
.nav { display: flex; gap: 4px; padding: 4px; margin-left: auto; border-radius: var(--pill);
  background: rgba(150,170,255,0.08); border: 1px solid var(--edge); }
.pill { appearance: none; border: 0; cursor: pointer; border-radius: var(--pill);
  padding: 7px 14px; background: transparent; color: var(--muted); font-weight: 500; font-size: 14px;
  transition: background .2s, color .2s; white-space: nowrap; }
.pill:hover { color: var(--text); }
.pill[aria-pressed="true"], .pill.on { background: var(--cobalt); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 18px -6px rgba(61,99,255,.8); }
.pill.ghost { border: 1px solid var(--edge); background: rgba(150,170,255,0.06); color: var(--text); }
.pill.ghost:hover { background: rgba(150,170,255,0.14); }
.pill:focus-visible, .chip:focus-visible, .check:focus-visible, .day:focus-visible, button:focus-visible {
  outline: 2px solid #9fb4ff; outline-offset: 2px; }
.icon-btn { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; }

main { padding: 18px var(--pad) calc(env(safe-area-inset-bottom) + 60px);
  max-width: 1280px; margin: 0 auto; display: grid; gap: 22px; }
section { scroll-margin-top: 80px; }
.panel { padding: clamp(18px, 3.4vw, 30px); }
h2 { font-size: clamp(22px, 3.2vw, 30px); font-variation-settings: "opsz" 48; font-weight: 650;
  letter-spacing: -0.02em; margin: 0; line-height: 1.1; }
.note { font-family: "Instrument", serif; font-style: italic; color: var(--muted); font-size: 17px; }
.sub { color: var(--muted); font-size: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { justify-content: space-between; }

/* ---------- cash hero ---------- */
.hero { display: grid; gap: 18px; grid-template-columns: 1fr; }
.hero-figure { font-variation-settings: "opsz" 96; font-weight: 720; letter-spacing: -0.045em;
  font-size: clamp(54px, 12vw, 104px); line-height: .92; margin: 6px 0 2px; }
.hero-figure.short { color: #ff8a98; }
.hero-figure.low { color: #ffc970; }
.hero-line { font-size: 17px; color: var(--text); max-width: 60ch; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.fact { padding: 12px 14px; border-radius: var(--r-md); background: rgba(150,170,255,0.06);
  border: 1px solid var(--grid); }
.fact b { display: block; font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.fact span { font-size: 13px; color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--pill);
  padding: 4px 11px 4px 8px; font-size: 13px; font-weight: 600; border: 1px solid transparent; }
.status svg { width: 14px; height: 14px; }
.status.ok { background: rgba(22,176,140,.15); color: #6fe3c4; border-color: rgba(22,176,140,.35); }
.status.low { background: var(--low-bg); color: #ffc970; border-color: rgba(201,134,15,.45); }
.status.short { background: var(--short-bg); color: #ff9aa6; border-color: rgba(238,83,104,.45); }
.stale { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--low-bg); border: 1px solid rgba(201,134,15,.4); }
.stale p { margin: 0; font-size: 14px; }

/* ---------- the cash timeline ---------- */
.tl-tools { margin: 18px 0 10px; }
.timeline { position: relative; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch; border-radius: var(--r-md);
  background: rgba(6,10,28,0.45); border: 1px solid var(--grid); scrollbar-width: thin; }
.tl-inner { position: relative; }
.tl-chart { display: block; }
.days { display: flex; }
.day { flex: 0 0 var(--col); width: var(--col); scroll-snap-align: start; padding: 8px 6px 10px;
  border-left: 1px solid var(--grid); cursor: pointer; min-height: 230px; background: transparent;
  text-align: left; border-top: 0; border-right: 0; border-bottom: 0; color: inherit;
  display: flex; flex-direction: column; gap: 4px; transition: background .15s; }
.day:hover, .day.drop { background: rgba(120,145,255,0.10); }
.day.wk { border-left-color: rgba(205,215,255,.32); }
.day.weekend .dname { color: var(--faint); }
.day.today { background: rgba(61,99,255,0.14); }
.day.low .close { color: #ffc970; }
.day.short .close { color: #ff9aa6; }
.dname { font-size: 12px; color: var(--muted); }
.ddate { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.close { font-size: 14px; font-weight: 650; margin-top: 2px; }
.flow { font-size: 12px; color: var(--muted); line-height: 1.3; }
.flow .i { color: #5fd8b8; } .flow .o { color: #c9cff0; }
.chip { display: block; width: 100%; font-size: 11.5px; line-height: 1.25; padding: 4px 7px; margin: 0;
  border-radius: 9px; border: 1px solid var(--grid); background: rgba(150,170,255,0.07); color: var(--text);
  text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.in { border-color: rgba(22,176,140,.35); background: rgba(22,176,140,.10); }
.chip.mv { border-style: solid; }
.chip.est { border-style: dashed; }
.chip.tent { opacity: .62; border-style: dashed; }
.chip.moved { box-shadow: inset 3px 0 0 var(--cobalt); }
.chip[draggable="true"] { cursor: grab; }
.more { font-size: 11.5px; color: var(--faint); padding-left: 2px; }
.weeks { display: flex; }
.wkcell { flex: 0 0 calc(var(--col) * 7); padding: 8px 10px; border-left: 1px solid rgba(205,215,255,.32);
  border-top: 1px solid var(--grid); font-size: 12px; color: var(--muted); }
.wkcell b { color: var(--text); font-weight: 600; }

.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); margin-top: 10px; }
.key { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 18px; height: 0; border-top: 2px solid var(--line); }
.sw.floor { border-top: 2px dashed var(--hold); }
.sw.zero { border-top: 2px dashed var(--short); }
.sw.est { width: 14px; height: 10px; border: 1px dashed var(--muted); border-radius: 3px; }

/* ---------- sheet (day detail / move) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(2,4,14,.55); z-index: 40; opacity: 0;
  pointer-events: none; transition: opacity .2s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; z-index: 41; left: 50%; bottom: 0; width: min(560px, 100%);
  transform: translate(-50%, 104%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
  max-height: 86vh; overflow: auto; border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 20px var(--pad) calc(env(safe-area-inset-bottom) + 22px); }
.sheet.open { transform: translate(-50%, 0); }
@media (min-width: 900px) { .sheet { bottom: auto; top: 50%; border-radius: var(--r-lg);
  transform: translate(-50%, -40%) scale(.98); opacity: 0; pointer-events: none;
  transition: transform .22s, opacity .22s; }
  .sheet.open { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; } }
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--edge); margin: -6px auto 14px; }
.ev { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0;
  border-top: 1px solid var(--grid); }
.ev:first-of-type { border-top: 0; }
.ev .amt { font-weight: 650; text-align: right; }
.ev .amt.in { color: #5fd8b8; }
.ev .meta { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.ev .acts { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.ev input[type="date"] { border-radius: var(--pill); border: 1px solid var(--edge); background: rgba(150,170,255,.08);
  padding: 6px 12px; font-size: 14px; color-scheme: dark; }
.pill.small { padding: 5px 11px; font-size: 13px; }
.tag { font-size: 11.5px; border-radius: var(--pill); padding: 2px 8px; border: 1px solid var(--edge); color: var(--muted); }

/* ---------- trends ---------- */
.charts { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 16px; }
@media (min-width: 860px) { .charts { grid-template-columns: 1fr 1fr; } }
.chart { position: relative; padding: 16px 16px 10px; border-radius: var(--r-md);
  background: rgba(6,10,28,0.42); border: 1px solid var(--grid); }
.chart h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.chart .now { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; font-variation-settings: "opsz" 72; }
.chart .read { font-size: 13px; color: var(--muted); }
.chart svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.chart .legend { margin-top: 6px; font-size: 12px; }
.tip { position: absolute; pointer-events: none; z-index: 5; padding: 8px 10px; border-radius: 12px;
  background: rgba(14,20,51,.92); border: 1px solid var(--edge); font-size: 12.5px; min-width: 150px;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.6); display: none; }
.tip b { display: block; margin-bottom: 4px; font-size: 13px; }
.tip div { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.tip div span:last-child { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- to-do ---------- */
.todo { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.todo li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 12px 14px;
  border-radius: var(--r-md); background: rgba(150,170,255,0.05); border: 1px solid var(--grid); }
.todo li.done { opacity: .5; }
.todo li.done .ttl { text-decoration: line-through; text-decoration-color: var(--faint); }
.check { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--edge-hi);
  background: transparent; cursor: pointer; display: grid; place-items: center; margin-top: 1px; padding: 0; }
.check svg { width: 14px; height: 14px; opacity: 0; }
.done .check { background: var(--in); border-color: var(--in); }
.done .check svg { opacity: 1; }
.ttl { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.todo details summary { cursor: pointer; list-style: none; }
.todo details summary::-webkit-details-marker { display: none; }
.todo .det { margin: 6px 0 0; font-size: 14px; color: var(--muted); max-width: 75ch; }
.todo .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* ---------- auth pages ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: var(--pad); }
.auth .panel { width: min(420px, 100%); display: grid; gap: 16px; }
.auth h1 { font-size: 34px; font-variation-settings: "opsz" 72; font-weight: 700; letter-spacing: -0.03em; margin: 0; }
.field-in { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.field-in input { border-radius: 14px; border: 1px solid var(--edge); background: rgba(6,10,28,.5);
  padding: 13px 14px; font-size: 17px; color: var(--text); }
.field-in input:focus { outline: 2px solid #9fb4ff; outline-offset: 1px; }
.cta { width: 100%; padding: 14px; font-size: 16px; font-weight: 600; }
.err { color: #ff9aa6; font-size: 14px; min-height: 1.2em; margin: 0; }
.qr { background: #fff; border-radius: 16px; padding: 10px; justify-self: center; width: 220px; }
.secret { font-size: 13px; color: var(--muted); word-break: break-all; text-align: center; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--grid); }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 18px); transform: translateX(-50%);
  z-index: 60; padding: 10px 16px; border-radius: var(--pill); font-size: 14px; display: none; }
.skeleton { color: var(--faint); padding: 40px 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (max-width: 520px) { .nav .pill { padding: 7px 11px; } .wordmark { display: none; } }
.m0{margin:0}.mb10{margin:0 0 10px}.mt14{margin:14px 0 0}.mt4{margin:4px 0 0}.pad4{padding:0 4px}

main > * { min-width: 0; }
.timeline { max-width: 100%; }
svg text { font-variation-settings: "opsz" 24; font-variant-numeric: normal; letter-spacing: 0; }
.sheet.glass { background: linear-gradient(180deg, rgba(24,32,74,.97), rgba(12,18,46,.97)); }
