/* Richard — lime & black */

:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0e0b;
  --card: #1b1d18;
  --card-2: #23261f;
  --line: #2a2d25;
  --ink: #f2f4ec;
  --ink-2: #bcc1b4;
  --ink-3: #8c9285;
  --lime: #b6f23f;
  --lime-2: #a3e02c;
  --on-lime: #0d0e0b;
  --on-lime-2: rgba(13, 14, 11, .68);
  --warn: #ffb020;
  --crit: #ff6a5c;
  --pos: #b6f23f;
  --accent: #b6f23f;  /* accent for text & icons */
  --fill: #b6f23f;    /* data fills */
  --past: #5d6a43;
  --bar: #4d5a33;
  --bar-2: #3c4628;
  --tabs-bg: rgba(27,29,24,.92);
  --shadow: none;
  --p0: #66a015;   /* person 1 (validated pair, dark surface) */
  --p1: #9478f0;   /* person 2 */
  --focus: #b6f23f;

  --font: 'Heebo', 'Assistant', system-ui, sans-serif;
  --r: 22px;
  --tabs-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--font); font-feature-settings: 'tnum' 1;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
main { min-height: 100vh; padding-bottom: calc(var(--tabs-h) + var(--safe-b) + 110px); outline: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.money { white-space: nowrap; }
.i { width: 20px; height: 20px; flex: none; }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px; }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 900; letter-spacing: -.02em; line-height: 1; }
.logo .word { font-size: 22px; color: var(--on-lime); }
.logo .tag { display: grid; place-items: center; height: 28px; padding: 0 7px; border-radius: 8px; background: var(--on-lime); }
.logo .tag svg { width: 26px; height: 15px; }
.logo.on-dark .word { color: var(--ink); }
.logo.on-dark .tag { background: var(--lime); }
.logo.xl .word { font-size: 46px; }
.logo.xl .tag { height: 54px; padding: 0 13px; border-radius: 14px; }
.logo.xl .tag svg { width: 50px; height: 29px; }

/* ---------- lime hero ---------- */
.hero {
  position: relative; background: var(--lime); color: var(--on-lime);
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 0 44px; overflow: hidden;
}
.hero .doodles { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.55) 55%, rgba(0,0,0,.25) 100%);
          mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.55) 55%, rgba(0,0,0,.25) 100%); }
.hero .wrap { position: relative; }
.hero .curve path { fill: var(--bg); }
.hero .curve { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 34px; display: block; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.round-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(13,14,11,.08); color: var(--on-lime); border: 0; }
.round-btn:hover { background: rgba(13,14,11,.14); }
.hero-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.page-title { font-weight: 900; font-size: 34px; letter-spacing: -.02em; line-height: 1.05; margin: 14px 0 0; }

.scope { display: inline-flex; background: var(--on-lime); border-radius: 99px; padding: 4px; }
.scope button { border: 0; background: none; color: #f2f4ec; display: flex; gap: 6px; align-items: center; padding: 7px 14px; border-radius: 99px; font-size: 14px; font-weight: 600; }
.scope button .i { width: 16px; height: 16px; }
.scope button[aria-pressed="true"] { background: var(--lime); color: var(--on-lime); }

.month-nav { display: flex; align-items: center; gap: 2px; font-weight: 700; font-size: 15px; }
.month-nav button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; color: var(--on-lime); display: grid; place-items: center; }
.month-nav button:hover:not(:disabled) { background: rgba(13,14,11,.08); }
.month-nav button:disabled { opacity: .25; cursor: default; }
.month-nav button .i { width: 18px; height: 18px; }

.kicker { font-size: 16px; font-weight: 600; margin: 16px 0 0; }
.big { font-weight: 900; font-size: clamp(60px, 19vw, 84px); line-height: .95; letter-spacing: -.035em; display: flex; align-items: baseline; gap: 6px; margin: 2px 0 0; }
.big .cur { font-size: .44em; font-weight: 800; }
.big.neg { color: #8a1c10; }
.hero-sub { font-size: 15px; font-weight: 500; margin: 8px 0 0; color: var(--on-lime-2); display: flex; align-items: center; gap: 6px; }
.hero-sub .i { width: 16px; height: 16px; }

.pace { margin-top: 18px; }
.pace-track { position: relative; height: 10px; border-radius: 99px; background: rgba(13,14,11,.14); }
.pace-fill { position: absolute; inset-block: 0; right: 0; border-radius: 99px; background: var(--on-lime); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.pace-fill.over { background: #8a1c10; }
.pace-today { position: absolute; top: -6px; bottom: -6px; width: 4px; border-radius: 3px; background: #fff; box-shadow: 0 0 0 1.5px var(--on-lime); }
.pace-legend { display: flex; justify-content: space-between; gap: 12px; margin-top: 9px; font-size: 13px; font-weight: 600; }
.verdict { display: flex; gap: 6px; align-items: center; font-size: 14px; font-weight: 600; margin-top: 10px; }
.verdict .i { width: 18px; height: 18px; }

.stat-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.stat-tiles > div { background: var(--on-lime); color: #f2f4ec; border-radius: 18px; padding: 12px 14px; }
.stat-tiles .k { font-size: 13px; color: #9ca294; }
.stat-tiles .v { font-size: 26px; font-weight: 900; letter-spacing: -.02em; }
.stat-tiles .s { font-size: 12px; color: #9ca294; }

/* ---------- body ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.section { margin-top: 26px; }
.section:first-child { margin-top: 10px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 6px 10px; }
.section-head h2 { font-weight: 800; font-size: 19px; margin: 0; letter-spacing: -.01em; }
.link { font-size: 14px; font-weight: 600; color: var(--accent); background: none; border: 0; padding: 4px 0; }
.list > * + * { border-top: 1px solid var(--line); }

.tile { width: 42px; height: 42px; border-radius: 14px; background: var(--card-2); color: var(--accent); display: grid; place-items: center; flex: none; }
.tile .i { width: 21px; height: 21px; }
.row { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; padding: 12px 16px; width: 100%; text-align: inherit; background: none; border: 0; }
button.row:hover, a.row:hover { background: var(--card-2); }
.row .main { min-width: 0; }
.row .title { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-3); overflow: hidden; white-space: nowrap; }
.row .meta .i { width: 14px; height: 14px; }
.row .end { text-align: left; font-weight: 800; white-space: nowrap; }
.row .end small { display: block; font-weight: 500; font-size: 12px; color: var(--ink-3); }
.note-line { display: flex; gap: 5px; align-items: flex-start; font-size: 13px; color: var(--ink-2); margin-top: 3px; white-space: normal; }
.note-line .i { width: 14px; height: 14px; margin-top: 3px; color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.p0 { background: var(--p0); } .dot.p1 { background: var(--p1); }

.cat-row { display: flex; gap: 12px; align-items: center; padding: 13px 16px; }
a.cat-row:hover { background: var(--card-2); }
.cat-row .cm { flex: 1; min-width: 0; }
.cat-top { display: flex; align-items: center; gap: 8px; }
.cat-top .name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-top .figs { margin-inline-start: auto; font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.cat-top .figs b { color: var(--ink); font-weight: 800; }
.bar { position: relative; height: 6px; border-radius: 99px; background: var(--card-2); margin-top: 9px; }
.bar i { position: absolute; inset-block: 0; right: 0; border-radius: 99px; background: var(--fill); }
.bar i.warn { background: var(--warn); }
.bar i.over { background: var(--crit); }
.bar .tick { position: absolute; top: -4px; bottom: -4px; width: 2px; border-radius: 2px; background: var(--ink); opacity: .65; }
.flag { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; color: var(--on-lime); }
.flag .i { width: 12px; height: 12px; }
.flag.warn { background: var(--warn); }
.flag.over { background: var(--crit); }
.pill { display: inline-flex; gap: 4px; align-items: center; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--card-2); color: var(--ink-2); vertical-align: 2px; }
.pill .i { width: 12px; height: 12px; }
.muted-note { color: var(--ink-3); font-size: 14px; padding: 16px; }
.hint { font-size: 12px; color: var(--ink-3); margin: 8px 6px 0; }

/* week ring card */
.week { display: flex; align-items: center; gap: 14px; padding: 16px; margin-top: 14px; }
.ring { width: 64px; height: 64px; flex: none; }
.ring .track { stroke: var(--card-2); }
.ring .val { stroke: var(--fill); }
.ring .val.over { stroke: var(--crit); }
.week .t { font-size: 13px; color: var(--ink-3); }
.week .n { font-size: 30px; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; }
.week .n.neg { color: var(--crit); }
.week .n small { font-size: 15px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 10px; font-size: 11px; text-align: center; color: var(--ink-3); }
.days i { display: block; height: 5px; border-radius: 99px; background: var(--card-2); margin-bottom: 3px; }
.days .past i { background: var(--past); }
.days .today i { background: var(--fill); }
.days .today { color: var(--accent); font-weight: 700; }
.days .out { opacity: .3; }

/* calendar tile */
.cal { width: 44px; height: 44px; border-radius: 14px; background: var(--lime); color: var(--on-lime); display: grid; place-items: center; text-align: center; line-height: 1; flex: none; }
.cal b { font-size: 19px; font-weight: 900; }
.cal small { display: block; font-size: 10px; font-weight: 700; }
.cal.soft { background: var(--card-2); color: var(--ink); }
.cal.soft small { color: var(--ink-3); }
.due { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; }
.due .title { display: block; font-weight: 700; }
.due .meta { display: block; font-size: 12px; color: var(--ink-3); }
.due .end { font-weight: 800; }
.pos { color: var(--pos); }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border-radius: 99px; border: 0; background: var(--lime); color: var(--on-lime); font-weight: 800; font-size: 16px; }
.btn:hover { background: var(--lime-2); }
.btn .i { width: 20px; height: 20px; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { background: var(--card-2); }
.btn.danger { background: transparent; color: var(--crit); box-shadow: inset 0 0 0 1.5px rgba(255,106,92,.4); }
.btn.dark { background: var(--on-lime); color: var(--lime); }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.fab {
  position: fixed; left: max(16px, calc(50% - 320px + 16px)); bottom: calc(var(--tabs-h) + var(--safe-b) + 30px); z-index: 20;
  width: 60px; height: 60px; padding: 0; border-radius: 50%; border: 0; background: var(--lime); color: var(--on-lime);
  display: grid; place-items: center; box-shadow: 0 12px 30px -10px rgba(182,242,63,.7);
}
.fab .i { width: 28px; height: 28px; stroke-width: 2.4; }

.tabs {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--safe-b)); z-index: 30;
  width: min(calc(100% - 24px), 520px); height: var(--tabs-h); border-radius: 99px;
  background: var(--tabs-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.6), inset 0 0 0 1px var(--line);
  display: flex; justify-content: space-around; align-items: center; padding: 0 6px;
}
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--ink-3); padding: 6px 12px; border-radius: 99px; }
.tabs a .i { width: 22px; height: 22px; }
.tabs a[aria-current="page"] { background: var(--card-2); color: var(--accent); }

.filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -2px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; gap: 6px; align-items: center; border: 0; border-radius: 99px; padding: 8px 14px; font-size: 14px; font-weight: 600; background: var(--card); color: var(--ink-2); }
.chip .i { width: 16px; height: 16px; }
.chip[aria-pressed="true"] { background: var(--lime); color: var(--on-lime); }
.search { position: relative; margin-bottom: 10px; }
.search .i { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 18px; height: 18px; }
.search input { width: 100%; height: 50px; border-radius: 99px; border: 0; background: var(--card); padding: 0 46px 0 18px; }
.totals-line { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-3); margin: 14px 6px 8px; }
.totals-line b { color: var(--ink); font-weight: 800; }
.day-head { font-size: 13px; color: var(--ink-3); font-weight: 600; margin: 18px 6px 8px; display: flex; justify-content: space-between; }

.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50; animation: fade .2s ease; }
.sheet {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 51; margin: 0 auto; max-width: 640px;
  background: var(--card); border-radius: 28px 28px 0 0; padding: 10px 20px calc(22px + var(--safe-b));
  max-height: 92vh; overflow-y: auto; animation: rise .28s cubic-bezier(.2,.8,.2,1);
}
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 12px; }
.sheet h3 { font-weight: 900; font-size: 26px; letter-spacing: -.02em; margin: 6px 0 18px; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.input, .textarea { width: 100%; border: 1.5px solid transparent; border-radius: 16px; background: var(--card-2); padding: 0 16px; font-size: 16px; }
.input { height: 54px; }
.textarea { min-height: 80px; padding: 14px 16px; resize: vertical; }
.input:focus, .textarea:focus { outline: none; border-color: var(--accent); }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.amount-input { position: relative; }
.amount-input .input { height: 76px; font-size: 44px; font-weight: 900; text-align: center; padding-inline: 48px; letter-spacing: -.02em; }
.amount-input .cur { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); font-size: 24px; font-weight: 800; color: var(--ink-3); }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.icon-grid button { border: 0; border-radius: 16px; padding: 12px 6px 10px; background: var(--card-2); font-size: 13px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ink-2); }
.icon-grid button .i { width: 22px; height: 22px; color: var(--accent); }
.icon-grid button[aria-pressed="true"] { background: var(--lime); color: var(--on-lime); }
.icon-grid button[aria-pressed="true"] .i { color: var(--on-lime); }
.icon-grid.only button { padding: 12px 0; }
.seg { display: flex; background: var(--card-2); border-radius: 99px; padding: 4px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 99px; height: 44px; font-weight: 600; color: var(--ink-2); display: flex; gap: 6px; justify-content: center; align-items: center; }
.seg button .i { width: 16px; height: 16px; }
.seg button[aria-pressed="true"] { background: var(--lime); color: var(--on-lime); }
.sheet-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.form-error { color: var(--crit); font-size: 14px; min-height: 20px; margin: 0; }
.ask-box { background: var(--card-2); border-radius: 18px; padding: 14px; display: grid; gap: 10px; }
.ask-box .input { background: var(--card); height: 48px; }
.ask-box small { color: var(--ink-3); }

.toggle-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.toggle-row .main { flex: 1; font-weight: 600; }
.toggle-row .main small { display: block; color: var(--ink-3); font-size: 13px; font-weight: 400; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line); transition: background .2s; pointer-events: none; }
.switch i::after { content: ''; position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink-3); transition: transform .2s, background .2s; }
.switch input:checked + i { background: var(--lime); box-shadow: none; }
.switch input:checked + i::after { transform: translateX(-20px); background: var(--on-lime); }
.switch input:focus-visible + i { outline: 2px solid var(--focus); outline-offset: 2px; }
.budget-input { width: 108px; height: 42px; text-align: center; border: 1.5px solid transparent; border-radius: 12px; background: var(--card-2); font-weight: 700; }
.budget-input:focus { outline: none; border-color: var(--accent); }
.range { width: 100%; accent-color: var(--fill); }

/* ---------- charts / reports ---------- */
.panel { background: var(--card); border-radius: var(--r); padding: 18px 16px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 12px; }
.panel h3 { font-weight: 800; font-size: 16px; margin: 0 0 2px; }
.panel .sub { font-size: 13px; color: var(--ink-3); margin: 0 0 14px; }
.chart { position: relative; }
.chart svg { direction: ltr; display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--ink-3); font-size: 12px; font-family: var(--font); }
.chart .bar-mark { fill: var(--bar); }
.chart .bar-mark.partial { fill: var(--bar-2); }
.chart .bar-mark.selected { fill: var(--fill); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .ref { stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .ref-label { paint-order: stroke; stroke: var(--card); stroke-width: 4px; stroke-linejoin: round; fill: var(--ink-2); font-size: 12px; font-weight: 700; font-family: var(--font); }
.tip { position: absolute; pointer-events: none; z-index: 5; background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 10px; white-space: nowrap; opacity: 0; transition: opacity .12s; }
.tip.on { opacity: 1; }
.stat-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat-pair .k { font-size: 13px; color: var(--ink-3); }
.stat-pair .v { font-size: 28px; font-weight: 900; letter-spacing: -.02em; }
.delta-up { color: var(--crit); }
.delta-down { color: var(--pos); }
.rank { display: grid; gap: 14px; }
.rank-item { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 10px; align-items: center; }
.rank-item .i { width: 18px; height: 18px; color: var(--accent); }
.rank-item .lbl { font-size: 14px; font-weight: 600; }
.rank-item .val { font-size: 14px; font-weight: 800; }
.rank-item .val small { font-weight: 500; color: var(--ink-3); margin-inline-start: 6px; }
.rank-item .track { grid-column: 1 / -1; height: 6px; background: var(--card-2); border-radius: 99px; overflow: hidden; }
.rank-item .track i { display: block; height: 100%; background: var(--fill); border-radius: 99px; }
.split { display: flex; height: 14px; gap: 2px; border-radius: 99px; overflow: hidden; margin: 6px 0 12px; }
.split i:first-child { background: var(--p0); }
.split i:last-child { background: var(--p1); }
.legend { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- savings ---------- */
.goal { padding: 16px; }
.goal-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-weight: 800; }
.goal .figs { font-size: 14px; color: var(--ink-3); margin-top: 2px; }
.goal .bar { height: 10px; }
.goal-actions { display: flex; gap: 8px; margin-top: 14px; }

/* ---------- login ---------- */
.login .hero { min-height: 52vh; display: flex; align-items: center; justify-content: center; padding-bottom: 60px; }
.login-body { text-align: center; padding-top: 26px; }
.login h1 { font-weight: 900; font-size: 30px; letter-spacing: -.02em; margin: 0; color: var(--accent); }
.login h1 span { color: var(--ink); }
.login p { color: var(--ink-2); margin: 8px 0 0; }
.codebox { margin: 22px auto 0; background: var(--card); border-radius: 22px; padding: 16px; max-width: 420px; }
.codebox small { color: var(--ink-3); font-size: 13px; }
.code { font-weight: 900; font-size: 54px; letter-spacing: .2em; direction: ltr; line-height: 1.15; }
.login .btn { margin-top: 16px; width: 100%; max-width: 420px; min-height: 58px; font-size: 17px; }
.login .alt { font-size: 14px; color: var(--ink-3); margin-top: 14px; }
.login .alt b { color: var(--ink); }
.wait { display: flex; justify-content: center; align-items: center; gap: 8px; color: var(--ink-3); font-size: 14px; margin-top: 14px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + var(--safe-b) + 100px); transform: translate(-50%, 20px);
  background: var(--lime); color: var(--on-lime); font-weight: 700; padding: 10px 18px; border-radius: 99px; font-size: 14px; z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; white-space: nowrap;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }
.skeleton { height: 240px; display: grid; place-items: center; color: var(--ink-3); }
.empty { text-align: center; padding: 30px 22px; color: var(--ink-2); }
.empty .t { font-weight: 900; font-size: 22px; color: var(--ink); margin: 0 0 6px; }
.empty .btn { margin-top: 14px; }


/* ---------- light theme (default) ---------- */
[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --card: #f4f5f0;
  --card-2: #e8eae2;
  --line: #e2e4dc;
  --ink: #0d0e0b;
  --ink-2: #474c41;
  --ink-3: #6f7569;
  --accent: #3f6d00;
  --fill: #5e9a00;
  --pos: #3f6d00;
  --past: #b9cf8f;
  --bar: #c9dca6;
  --bar-2: #dbe8c3;
  --warn: #e39500;
  --crit: #d93a2b;
  --tabs-bg: rgba(255,255,255,.94);
  --shadow: none;
  --focus: #3f6d00;
}
[data-theme="light"] .tabs { box-shadow: 0 10px 30px -12px rgba(13,14,11,.35), inset 0 0 0 1px var(--line); }
[data-theme="light"] .fab { box-shadow: 0 12px 26px -10px rgba(94,154,0,.55); }
[data-theme="light"] .sheet-backdrop { background: rgba(13,14,11,.35); }
[data-theme="light"] .switch input:checked + i::after { background: #fff; }
[data-theme="light"] .switch input:checked + i { background: var(--fill); }
[data-theme="light"] .switch i::after { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
[data-theme="light"] .seg button[aria-pressed="true"], [data-theme="light"] .chip[aria-pressed="true"], [data-theme="light"] .icon-grid button[aria-pressed="true"] { background: var(--ink); color: #fff; }
[data-theme="light"] .icon-grid button[aria-pressed="true"] .i { color: var(--lime); }
[data-theme="light"] .tile { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
[data-theme="light"] .cal.soft { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
[data-theme="light"] .tip { background: var(--ink); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- airy pass ---------- */
.section { margin-top: 34px; }
.section-head { margin: 0 4px 12px; }
.section-head h2 { font-size: 18px; }
.list > * + * { border-top: 0; }
.list { padding: 6px 0; }
.row, .cat-row, .due { padding-block: 13px; }
.row .meta { margin-top: 2px; }
.cat-row .bar { margin-top: 10px; height: 5px; }
.week { margin-top: 18px; padding: 18px; }
.week .t { margin-bottom: 2px; }
.kicker { margin-top: 22px; color: var(--on-lime-2); font-weight: 600; }
.pace { margin-top: 22px; }
.pace-legend { color: var(--on-lime-2); }
.hero { padding-bottom: 52px; }
.hero .doodles g { stroke: rgba(13,14,11,.10); }
.more-btn { display: block; width: 100%; background: none; border: 0; color: var(--accent); font-weight: 600; font-size: 14px; padding: 10px 16px 12px; text-align: center; }
.filters { gap: 6px; }
.chip { padding: 8px 14px; font-weight: 500; }
.search input { height: 46px; }
.day-head { margin-top: 24px; }
.panel + .panel { margin-top: 16px; }
.panel { padding: 20px 18px; }
.totals-line { margin-top: 18px; }

/* ---------- setup guides ---------- */
.guide { padding: 16px 16px 6px; }
.guide .lead { margin: 0 0 12px; color: var(--ink-2); display: flex; gap: 6px; align-items: flex-start; }
.guide .lead .i { color: var(--accent); margin-top: 3px; width: 18px; height: 18px; }
.guide ol { list-style: none; margin: 0; padding: 0; }
.step { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; padding: 8px 0 12px; font-size: 15px; line-height: 1.55; }
.step-n { width: 28px; height: 28px; border-radius: 50%; background: var(--lime); color: var(--on-lime); font-weight: 800; font-size: 14px; display: grid; place-items: center; }
.linkbox { background: var(--card-2); border-radius: 12px; padding: 12px 14px; font-size: 13px; color: var(--ink-2); word-break: break-all; text-align: left; }
.hint .i { width: 14px; height: 14px; vertical-align: -2px; }

.import-cta { display: grid; grid-template-columns: 42px 1fr; gap: 12px; align-items: center; width: 100%; text-align: inherit; border: 0; padding: 14px 16px; margin-top: 10px; }
.import-cta:hover { background: var(--card-2); }
.import-cta .title { display: block; font-weight: 700; }
.import-cta .meta { display: block; font-size: 13px; color: var(--ink-3); line-height: 1.45; margin-top: 2px; }

.ask-buy { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: inherit; border: 0; padding: 14px 16px; margin-top: 12px; color: inherit; font: inherit; cursor: pointer; }
.ask-buy:hover { background: var(--card-2); }
.ask-buy .title { display: block; font-weight: 700; }
.ask-buy .meta { display: block; font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.ask-buy .end { color: var(--ink-3); }
.buy-result { border-radius: 18px; background: var(--card); padding: 16px 18px; margin: 4px 0 14px; border-inline-start: 4px solid var(--fill); }
.buy-result.warn { border-inline-start-color: var(--warn); }
.buy-result.over { border-inline-start-color: var(--crit); }
.buy-result .t { font-size: 20px; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 8px; }
.buy-result .dotv { width: 10px; height: 10px; border-radius: 50%; background: var(--fill); flex: none; }
.buy-result.warn .dotv { background: var(--warn); }
.buy-result.over .dotv { background: var(--crit); }
.buy-result .sub { margin: 4px 0 10px; color: var(--ink-3); font-size: 14px; }
.buy-result ul { margin: 0 0 14px; padding-inline-start: 18px; line-height: 1.6; }
.buy-result li { margin-bottom: 4px; }

.inline-copy { display: inline-flex; margin: 8px 0 2px; }

.icon-grid .cat-new { border: 1.5px dashed var(--ink-3); background: transparent; color: var(--ink-3); }
.cat-new-row { display: flex; gap: 8px; margin-top: 10px; }
.cat-new-row .input { flex: 1; }

.icon-grid .cat-new .i { width: 24px; height: 24px; color: var(--ink-3); }
.icon-grid .cat-new { justify-content: center; }
.field-note { display: block; margin-top: 8px; color: var(--ink-3); font-size: 13px; line-height: 1.5; }

/* account */
.danger-zone { text-align: center; margin-top: 8px; }
.danger-zone .link.danger { color: var(--crit); background: none; border: 0; font: inherit; font-size: 14px; cursor: pointer; }
.danger-zone p { margin: 10px 0 0; font-size: 13px; }
.danger-zone a { color: var(--ink-3); }
.plan-offer { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 18px; margin-bottom: 10px; color: inherit; text-decoration: none; }
.plan-offer.best { outline: 2px solid var(--fill); }
.plan-offer .title { display: block; font-weight: 800; font-size: 18px; }
.plan-offer .meta { display: block; color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.plan-offer .price { text-align: left; font-size: 15px; }
.plan-offer .price b { font-size: 26px; font-weight: 900; }
.plan-offer .price small { display: block; color: var(--ink-3); font-size: 12px; }
.approve-row { display: flex; gap: 8px; padding: 12px; margin-top: 10px; }
.approve-row .input { flex: 1; }
.admin-row { display: block !important; }
.admin-row .main { display: block; }
.admin-row .meta { display: block; }
.admin-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.legal h2 { font-size: 18px; margin: 0 0 6px; }
.legal p { margin: 0; color: var(--ink-2); line-height: 1.7; }
.signup-cta { margin-top: 18px; font-size: 15px; }
.signup-cta a { font-weight: 700; color: var(--accent); }

/* =====================================================================
   Computers and tablets in landscape: side menu, wider pages, dialogs
   ===================================================================== */
.side-only { display: none !important; }

@media (min-width: 1024px) {
  :root { --side-w: 248px; }

  /* side menu (same links as the phone tab bar) */
  .tabs {
    left: auto; right: 0; top: 0; bottom: 0; transform: none;
    width: var(--side-w); height: auto; border-radius: 0;
    flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 4px;
    padding: 26px 18px 22px; background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none;
    box-shadow: inset 1px 0 0 var(--line);
  }
  .side-only { display: flex !important; }
  .side-logo { margin: 0 8px 26px; }
  .side-logo .logo .word { color: var(--ink); font-size: 24px; }
  .side-logo .logo .tag { background: var(--ink); }
  .side-logo .logo .tag path, .side-logo .logo .tag rect { fill: var(--lime); }
  .side-add {
    align-items: center; justify-content: center; gap: 8px; height: 50px; margin: 0 0 18px;
    border: 0; border-radius: 99px; background: var(--lime); color: var(--on-lime); font-weight: 800; font-size: 15px;
  }
  .side-add:hover { background: var(--lime-2); }
  .side-add .i { width: 20px; height: 20px; stroke-width: 2.4; }
  .tabs a:not(.side-logo) {
    flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 14px; border-radius: 14px;
    font-size: 15px; font-weight: 600;
  }
  .tabs a:not(.side-logo):hover { background: var(--card); color: var(--ink); }
  .tabs a .i { width: 20px; height: 20px; }
  .side-settings { margin-top: auto; }

  /* content sits next to the menu */
  body:has(#tabs:not([hidden])) main { margin-inline-start: var(--side-w); }
  main { padding-bottom: 64px; }
  .fab { display: none; }
  .wrap { max-width: 880px; padding: 0 32px; }
  .wrap.wide { max-width: 1160px; }

  /* the lime header becomes a rounded panel; the side menu already has the logo and settings */
  body:has(#tabs:not([hidden])) .hero { margin: 20px 24px 8px; border-radius: 32px; padding: 26px 0 34px; }
  body:has(#tabs:not([hidden])) .hero .curve { display: none; }
  body:has(#tabs:not([hidden])) .hero .topbar { display: none; }
  .hero .wrap { max-width: 1160px; }
  .hero-row { margin-top: 0; }
  .big { font-size: 96px; }
  .page-title { font-size: 42px; }

  /* home: categories on one side, the week, "can I buy" and upcoming on the other */
  .home-grid {
    display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); column-gap: 28px; align-items: start;
    grid-template-areas: "main side" "main side2" "main .";
  }
  .home-grid .col-main { grid-area: main; }
  .home-grid .col-side { grid-area: side; }
  .home-grid .col-side-2 { grid-area: side2; }
  .home-grid .col-main > .section:first-child { margin-top: 18px; }
  .home-grid .col-side > .card:first-child { margin-top: 18px; }

  /* sections side by side */
  .wrap.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; align-items: start; }
  .wrap.cols-flow { columns: 2; column-gap: 28px; }
  .wrap.cols-flow > .section { break-inside: avoid; display: inline-block; width: 100%; }
  .panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
  .panel-grid .panel { margin: 0; }
  .panel-grid .panel-wide { grid-column: 1 / -1; }
  .panel-grid .panel-wide svg { display: block; width: 100%; max-height: 300px; margin: 0 auto; }

  /* sheets open as centered dialogs */
  .sheet {
    inset: 0; margin: auto; height: fit-content; max-width: 560px; max-height: 86vh;
    border-radius: 28px; padding: 22px 28px 26px; animation: pop .22s cubic-bezier(.2,.8,.2,1);
  }
  .sheet .grab { display: none; }
  @keyframes pop { from { transform: scale(.97); opacity: 0; } }

  #toast { bottom: 40px; left: calc(50% - var(--side-w) / 2); }

  /* hover feedback where a mouse is used */
  .row:is(a, button):hover, a.card:hover, .cat-row:hover { background: var(--card-2); }
}

@media (min-width: 1024px) and (prefers-reduced-motion: reduce) {
  .sheet { animation: none; }
}

/* ---------- home / business switch ---------- */
.topbar { gap: 10px; }
.space-switch { display: inline-flex; background: rgba(13,14,11,.1); border-radius: 99px; padding: 3px; margin-inline-start: auto; }
.space-switch a { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 99px; font-size: 14px; font-weight: 700; color: var(--on-lime); }
.space-switch a .i { width: 15px; height: 15px; }
.space-switch a[aria-current="true"] { background: var(--on-lime); color: var(--lime); }
.side-space { margin: -10px 4px 18px; }
.side-space .space-switch { background: var(--card); margin: 0; width: 100%; }
.side-space .space-switch a { flex: 1; justify-content: center; color: var(--ink-2); }
.side-space .space-switch a[aria-current="true"] { background: var(--ink); color: var(--lime); }

/* ---------- business ---------- */
.biz-form { padding: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.biz-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.biz-action { display: flex; align-items: center; gap: 10px; padding: 14px; border: 0; text-align: inherit; color: inherit; font: inherit; cursor: pointer; }
.biz-action b { display: block; font-size: 15px; }
.biz-action small { display: block; color: var(--ink-3); font-size: 12px; line-height: 1.35; }
.biz-card { display: block; padding: 18px; margin-top: 12px; color: inherit; }
.biz-card-head { display: flex; gap: 12px; align-items: center; }
.biz-card-head b { display: block; font-size: 16px; }
.biz-card-head small { display: block; color: var(--ink-3); font-size: 13px; line-height: 1.4; }
.biz-big { font-size: 34px; font-weight: 900; letter-spacing: -.02em; margin: 12px 0 6px; }
.biz-sub { margin: 10px 0 0; color: var(--ink-2); font-size: 14px; display: flex; gap: 6px; align-items: flex-start; }
.biz-sub .i { width: 16px; height: 16px; margin-top: 3px; color: var(--warn); }
.biz-split { display: flex; gap: 18px; color: var(--ink-3); font-size: 14px; }
.biz-split b { color: var(--ink); }
.biz-warn .tile { color: var(--warn); }
.biz-months { padding: 14px 16px 12px; }
.biz-month { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px; padding: 7px 0; }
.biz-month .m { font-weight: 700; font-size: 14px; }
.biz-month .bars { display: grid; gap: 4px; }
.biz-month .bars i { display: block; height: 8px; border-radius: 8px; min-width: 2px; }
.biz-month .bars .in, .biz-legend .in { background: var(--fill); }
.biz-month .bars .out, .biz-legend .out { background: var(--ink-3); opacity: .55; }
.biz-month .p { font-weight: 800; font-size: 14px; min-width: 86px; text-align: left; }
.biz-month .p.neg { color: var(--crit); }
.biz-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.biz-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
.biz-row .end { text-align: left; }
.biz-row .end small { display: block; color: var(--ink-3); font-size: 12px; font-weight: 500; }
.biz-row .end.pos { color: var(--accent); }
.biz-row .meta .i { width: 13px; height: 13px; vertical-align: -2px; }
.tile.in { color: var(--accent); }
.tile.late { color: var(--crit); }
.no-file { color: var(--crit); }
.biz-dl { display: grid; gap: 10px; }
@media (min-width: 1024px) {
  .biz-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); column-gap: 28px; align-items: start; grid-template-areas: "main side"; }
  .biz-grid .col-main { grid-area: main; }
  .biz-grid .col-side { grid-area: side; }
  .biz-grid .col-main > .section:first-child { margin-top: 18px; }
  .biz-dl { grid-template-columns: 1fr 1fr; }
}

.invite-pick { width: 100%; border: 0; font: inherit; color: inherit; text-align: inherit; cursor: pointer; }
.invite-pick:hover { background: var(--card-2); }
.pace-fill.warn { background: var(--warn); }

.kid-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.kid-actions .btn { min-height: 48px; font-size: 15px; }

/* ---------- what Richard found ---------- */
a.ask-buy { text-decoration: none; }
.found-card .tile { background: var(--lime); color: var(--on-lime); }
.ins-list { display: grid; gap: 12px; }
.ins { padding: 16px; }
.ins-top { display: grid; grid-template-columns: 42px 1fr; gap: 12px; align-items: center; }
.ins-top .meta { display: block; font-size: 12px; color: var(--ink-3); }
.ins h3 { margin: 2px 0 0; font-size: 17px; }
.ins p { margin: 10px 0 12px; color: var(--ink-2); line-height: 1.55; }
.ins-acts { display: flex; gap: 8px; flex-wrap: wrap; }
@media (min-width: 1024px) { .ins-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.panel-link { display: block; text-decoration: none; color: inherit; }
.panel-link:hover { background: var(--card-2); }
.panel-link .link { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; margin-top: 8px; }
.panel-link .link .i { width: 16px; height: 16px; }
.price-row .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.price-row .chip { font-size: 13px; padding: 4px 10px; border-radius: 99px; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); }
.price-row .chip.best { background: var(--lime); color: var(--on-lime); box-shadow: none; }
.title.rq { white-space: normal; overflow: visible; font-weight: 600; line-height: 1.4; }

/* ---------- shopping list ---------- */
.add-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 8px 8px 8px 8px; align-items: center; }
.add-row input { border: 0; background: transparent; font: inherit; font-size: 17px; color: var(--ink); padding: 10px 10px; min-width: 0; }
.add-row input:focus { outline: none; }
.add-row:focus-within { box-shadow: inset 0 0 0 2px var(--lime); }
.add-row .btn { width: 44px; padding: 0; }
.sug { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.sug-t { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.sug .chip { box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.shop-row { grid-template-columns: auto 1fr auto !important; }
.shop-row .check { width: 28px; height: 28px; border-radius: 9px; border: 2px solid var(--ink-3); background: transparent; display: grid; place-items: center; color: var(--on-lime); cursor: pointer; padding: 0; }
.shop-row .check[aria-pressed="true"] { background: var(--lime); border-color: var(--lime); }
.shop-row .check .i { width: 18px; height: 18px; }
.shop-row.done .title { text-decoration: line-through; color: var(--ink-3); }
.shop-row .icon-btn { background: none; border: 0; color: var(--ink-3); padding: 8px; cursor: pointer; }
.shop-row .icon-btn .i { width: 18px; height: 18px; }
.chain-row { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 12px; margin-top: 6px; }
.chain-row.best { background: var(--lime); color: var(--on-lime); }
