:root {
  --bg: #fbf7ee; --card: #ffffff; --ink: #1f231f; --muted: #6b6f66; --line: #e8e2d4;
  --green: #2f6b45; --green-2: #e3efe4; --pink: #e7799b; --nose: #f6c3cf; --cow: #ffffff;
  --gold: #c98a1b; --warn: #b4452f; --warn-bg: #fbe9e4;
  --r: 18px; --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 6px 20px rgb(60 50 20 / .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141713; --card: #1e221d; --ink: #f1eee6; --muted: #a3a79c; --line: #30352e;
    --green: #6fc08b; --green-2: #23352a; --pink: #f08fae; --nose: #e3a4b6; --cow: #f1eee6;
    --gold: #e8b24a; --warn: #f08a72; --warn-bg: #3a221c; --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}
a { color: var(--green); }
h1 { font-size: 1.6rem; margin: .2em 0 .5em; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 0 0 .4em; }
h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1.6em 0 .6em; }
p { margin: .4em 0; }

.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: var(--ink); text-decoration: none; }
.brand img { border-radius: 8px; }
main { max-width: 560px; margin: 0 auto; padding: 16px 16px 72px; }
.loading { color: var(--muted); text-align: center; margin-top: 30vh; }

.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 0 0 12px;
  box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.cards { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.between { justify-content: space-between; }
.gap { gap: 10px; flex-wrap: wrap; }
.label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.huge { font-size: 2.4rem; font-weight: 800; letter-spacing: -.02em; margin: 2px 0 10px; font-variant-numeric: tabular-nums; }
.big { font-size: 1.8rem; font-weight: 800; letter-spacing: -.01em; color: var(--green); }
.small-big { font-size: 1.15rem; color: var(--ink); word-break: break-all; }
.small { font-size: .88rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.bar { height: 10px; background: var(--green-2); border-radius: 99px; overflow: hidden; margin: 8px 0 6px; }
.bar.thick { height: 16px; }
.bar span { display: block; height: 100%; background: var(--green); border-radius: inherit; transition: width .6s ease; min-width: 4px; }
.bar.done span { background: var(--gold); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 14px; padding: 12px 18px;
  background: var(--green); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; min-height: 44px; }
@media (prefers-color-scheme: dark) { .btn { color: #10170f; } }
.btn.big { width: 100%; padding: 15px; font-size: 1.05rem; margin-top: 6px; }
.btn.small { padding: 8px 14px; min-height: 36px; font-size: .9rem; }
.btn.ghost { background: transparent; color: var(--green); border: 1.5px solid var(--line); }
.btn.danger { color: var(--warn); }
.btn:disabled { opacity: .5; }
.file { position: relative; }
.form .btn.ghost { width: 100%; margin-top: 8px; }
button.btn.ghost.danger:not(.form *) { width: 100%; margin: 8px 0 16px; }

.pill { font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--green-2); color: var(--green); text-decoration: none; }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.tag { position: absolute; top: -9px; left: 14px; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  background: var(--pink); color: #fff; padding: 2px 8px; border-radius: 99px; }

.hero { text-align: center; padding: 8vh 8px 0; }
.hero h1 { font-size: 2rem; }
.hero p { color: var(--muted); max-width: 26em; margin: 0 auto 20px; }
.cow { display: block; }
.cow .c { fill: #b9581f; stroke: #2a1c14; stroke-width: 2; stroke-linejoin: round; }
.cow .f { fill: #e0823f; stroke: #2a1c14; stroke-width: 2; stroke-linejoin: round; }
.cow .hn { fill: #f3e6c8; stroke: #2a1c14; stroke-width: 2; stroke-linejoin: round; }
.cow .n2 { fill: #e9c9a4; stroke: #2a1c14; stroke-width: 2; }
.cow .m { fill: none; stroke: #2a1c14; stroke-width: 1.6; stroke-linecap: round; }
.cow .k { fill: #2a1c14; }
.cow-hero { width: 120px; height: 120px; margin: 0 auto 8px; animation: bob 3s ease-in-out infinite; }
.cow-big { width: 84px; height: 84px; margin: 0 auto 8px; }
.cow-mid { width: 64px; height: 64px; margin: 0 auto; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-3deg); } }
@media (prefers-reduced-motion: reduce) { .cow-hero { animation: none; } .bar span { transition: none; } }
.party h1 { color: var(--green); }
.empty { text-align: center; padding: 10vh 16px; }
.empty p { color: var(--muted); }

.freedom.done { text-align: center; }
.focus .debt-line { display: flex; justify-content: space-between; color: inherit; text-decoration: none; margin-top: 6px; font-size: 1.1rem; }
.focus .btn { margin-top: 8px; }
.cheer { text-align: center; color: var(--muted); font-style: italic; margin: 18px 8px; }
.win { background: var(--green-2); border-radius: 12px; padding: 10px 12px; margin-top: 12px; }
.card.warn { background: var(--warn-bg); border-color: transparent; }
.warn-text { color: var(--warn); }

.list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.list li + li { border-top: 1px solid var(--line); }
.list a { padding: 12px 14px; color: inherit; text-decoration: none; }
.list small, .steps small { display: block; color: var(--muted); font-size: .82rem; }
.list .amt { color: var(--green); }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { position: relative; counter-increment: s; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px; }
.steps li:first-child { border-color: var(--pink); border-width: 2px; }
.steps a { padding: 14px 14px 14px 52px; color: inherit; text-decoration: none; }
.steps a::before { content: counter(s); position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%;
  background: var(--green-2); color: var(--green); font-weight: 800; display: grid; place-items: center; font-size: .85rem; }
.steps .right { text-align: right; }

.debt b { font-size: 1.05rem; }
.back { display: inline-block; margin-bottom: 6px; text-decoration: none; font-weight: 600; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.facts div { background: var(--bg); border-radius: 12px; padding: 8px 10px; }
.facts dt { font-size: .75rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.facts dd { margin: 0; font-weight: 700; }
.notes { white-space: pre-wrap; color: var(--muted); }

.form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 12px; }
.form input, .form select, .form textarea, .extra input {
  display: block; width: 100%; margin-top: 4px; font: inherit; font-size: 16px; color: var(--ink); background: var(--card);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; min-height: 46px; }
.form input:focus, .form select:focus, .form textarea:focus, .extra input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-2); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form.inline { display: flex; gap: 8px; }
.form.inline input { margin: 0; }
.extra { display: block; font-weight: 600; font-size: .9rem; margin: 14px 0 4px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg button { text-align: left; font: inherit; color: inherit; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; }
.seg button small { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.seg button.on { border-color: var(--green); background: var(--green-2); }
.seg button.on b { color: var(--green); }

.chart { margin: 12px 0 0; }
.chart svg { width: 100%; height: 120px; display: block; }
.chart .area { fill: var(--green-2); }
.chart .line { fill: none; stroke: var(--green); stroke-width: 2.5; stroke-linejoin: round; }
.chart .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart figcaption { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); margin-top: 4px; }

.soon-list { list-style: none; padding: 0; margin: 6px 0 0; }
.soon-list li { padding: 8px 0; border-top: 1px dashed var(--line); font-size: .92rem; color: var(--muted); }
.soon-list b { display: block; color: var(--ink); }

.fab { position: fixed; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 6; background: var(--pink); color: #fff; font-weight: 800;
  text-decoration: none; padding: 14px 18px; border-radius: 99px; box-shadow: 0 6px 18px rgb(231 121 155 / .45); }
.fab[hidden] { display: none; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(140px + env(safe-area-inset-bottom)); z-index: 9; background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 12px; font-weight: 600; max-width: calc(100vw - 32px); text-align: center; }
.toast[hidden] { display: none; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; display: grid; grid-template-columns: repeat(6, 1fr);
  background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .72rem; font-weight: 700; color: var(--muted); text-decoration: none; padding: 4px; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.on { color: var(--green); }

.huge.neg { color: var(--warn); }
.plus { color: var(--green); }
.amt small { font-weight: 600; color: var(--muted); font-size: .75rem; display: inline; }
.sums { margin: 6px 0 0; }
.sums div { display: flex; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--line); font-size: .95rem; }
.sums dt { color: var(--muted); }
.sums dt a { color: inherit; }
.sums dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.big small { font-size: 1rem; color: var(--muted); font-weight: 600; }
section > .row.between h3 { margin-bottom: .6em; }
.cats { list-style: none; padding: 0; margin: 0 0 12px; }
.cats li { margin-bottom: 6px; }
.cats .bar { height: 8px; margin: 4px 0 0; }
.quick-label { margin-top: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: .88rem; font-weight: 600; padding: 8px 12px; border-radius: 99px; border: 1.5px dashed var(--line); color: var(--green); text-decoration: none; background: var(--card); }
.intro { text-align: center; }
.intro .btn.ghost { width: 100%; margin-top: 8px; }
.nudge { border-color: var(--green); border-width: 2px; }
.nudge b { display: block; color: var(--green); }
.nudge .small { color: var(--muted); }
.top { display: flex; align-items: center; justify-content: space-between; }
.me-link { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--ink); background: var(--card); border: 1px solid var(--line); }
.me-link svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.me-link.on { color: var(--green); border-color: var(--green); }
.btn.wide { width: 100%; margin-top: 8px; }
.cow-sm { width: 40px; height: 40px; flex: none; }
.herd-nudge { display: flex; gap: 12px; align-items: center; border-color: var(--pink); }
.herd-nudge b { color: var(--pink); }
.herd-nudge .small { display: block; }
.compose .chips { margin: 8px 0 12px; }
.chip.on { border-style: solid; border-color: var(--green); background: var(--green-2); }
button.chip { font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; text-align: left; }
.check { display: flex !important; align-items: center; gap: 8px; }
.check input { width: 20px !important; min-height: 0 !important; height: 20px; margin: 0 !important; accent-color: var(--green); }
.preview { font-weight: 800; font-size: 1.1rem; background: var(--bg); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; }
.feed { list-style: none; padding: 0; margin: 16px 0 0; }
.post .who { color: var(--green); }
.win-title { font-size: 1.15rem; margin: 6px 0 2px; }
.hidden-post { opacity: .7; border-style: dashed; }
.cheers { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cheer-btn { display: inline-flex; align-items: center; gap: 4px; font: inherit; font-weight: 700; font-size: .95rem; padding: 6px 12px; min-height: 38px;
  border-radius: 99px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.cheer-btn.on { border-color: var(--pink); background: color-mix(in srgb, var(--pink) 15%, var(--card)); }
.cheer-btn span:empty { display: none; }
.cheer-btn.pop { animation: pop .35s ease; }
@keyframes pop { 50% { transform: scale(1.2); } }
@media (prefers-reduced-motion: reduce) { .cheer-btn.pop { animation: none; } }
.post-tools { display: flex; gap: 14px; justify-content: flex-end; margin-top: 8px; }
.post-tools button { font: inherit; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px 0; text-decoration: underline; }
.tabs a { font-size: .68rem; padding: 4px 0; }
.ideas li { margin-bottom: 10px; }
.idea { display: flex; gap: 12px; align-items: flex-start; margin: 0; }
.idea-icon { font-size: 1.9rem; line-height: 1; width: 44px; height: 44px; display: grid; place-items: center; background: var(--green-2); border-radius: 12px; flex: none; }
.idea-body { min-width: 0; }
.idea-body b { display: block; }
.idea-body small { display: block; color: var(--muted); font-size: .85rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tags span { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--bg); color: var(--muted); }
.tags .tag-fast { background: color-mix(in srgb, var(--gold) 18%, var(--card)); color: var(--gold); }
.tags .tag-mine { background: var(--green-2); color: var(--green); }
.filters { margin-bottom: 12px; }
.idea-hero { font-size: 3rem; line-height: 1; margin-bottom: 4px; }
.howto, .watch { margin: 0; padding-left: 1.3em; }
.howto li, .watch li { margin-bottom: 8px; }
.seg.three { grid-template-columns: repeat(3, 1fr); margin: 8px 0 14px; }
.seg.three button { text-align: center; padding: 10px 6px; font-size: .85rem; }
.earned { align-items: flex-end; }
.earned .right { text-align: right; }
.muted-big { color: var(--muted); font-size: 1.3rem; }
.log-earn { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.log-earn .label { display: block; margin-bottom: 8px; }
.checklist { list-style: none; padding: 0; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.checklist li + li { border-top: 1px solid var(--line); }
.checklist label { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; cursor: pointer; }
.checklist input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--green); flex: none; }
.checklist input:checked + span { text-decoration: line-through; color: var(--muted); }
.list-row { padding: 12px 14px; }
.link-btn { font: inherit; font-size: .85rem; background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 6px 0 6px 10px; }
.build-card { display: flex; gap: 12px; align-items: center; border-color: var(--green); border-width: 2px; }
.build-card b { display: block; color: var(--green); }
.build-card .small { display: block; color: var(--muted); }
.working { opacity: .7; pointer-events: none; }
.working button { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .working button { animation: none; } }
.url { font-weight: 700; word-break: break-all; margin: 2px 0 10px; }
.request.done { opacity: .6; }
.req-msg { white-space: pre-wrap; margin: 6px 0; }
.contact { user-select: all; }
.plan .label { display: block; margin-top: 12px; }
.plan .label:first-child { margin-top: 0; }
.checklist.plain li { padding: 10px 14px; }
.share-msg { white-space: pre-wrap; background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.svc-row, .faq-row { padding: 12px; margin-bottom: 10px; }
.svc-row label, .faq-row label { margin-bottom: 8px; }
.sticky-save { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); background: var(--bg); padding: 10px 0; margin-top: 16px; }
.sticky-save .btn { flex: 1; }
#preview-frame { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.stuck { text-align: center; padding: 10vh 8px 0; }
.stuck p { color: var(--muted); }
.tabs2 { margin: 0 0 14px; }
.tabs2 a { text-align: center; font-weight: 700; padding: 10px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); text-decoration: none; }
.tabs2 a.on { border-color: var(--green); background: var(--green-2); color: var(--green); }
.seg-opt { display: flex !important; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; background: var(--card); cursor: pointer; margin: 0 !important; }
.seg-opt input { width: auto !important; min-height: 0 !important; margin: 0 !important; accent-color: var(--green); }
.seg-opt:has(input:checked) { border-color: var(--green); background: var(--green-2); color: var(--green); }
#iou-form .seg { margin-bottom: 14px; }
.iou-totals .big { font-size: 1.6rem; }
.out-big { color: var(--ink); }
.people { list-style: none; padding: 0; margin: 12px 0 0; }
.people li { padding: 6px 0; border-top: 1px solid var(--line); }
.settled { margin-top: 18px; }
.settled summary { cursor: pointer; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.tabs a.dot { position: relative; }
.tabs a.dot::after { content: ''; position: absolute; top: 3px; left: calc(50% + 6px); width: 10px; height: 10px; border-radius: 50%; background: var(--pink); border: 2px solid var(--card); }
.req-nudge { border-color: var(--pink); }
.req-nudge b { color: var(--pink); }
section > .list:last-child, section > .feed:last-child { margin-bottom: 16px; }
.pill.new-pill { background: var(--pink); color: #fff; }
.push-card { border-color: var(--green); }
.facts dd .sub { display: block; font-weight: 600; color: var(--muted); font-size: .78rem; }
#freq-note:empty { display: none; }
#freq-note { margin: -6px 0 12px; }
.doc { max-width: 640px; }
.doc + * { display: none; }
.list .amt.out { color: var(--ink); }
.two > label { min-width: 0; }
.form input { min-width: 0; }
.form input[type=date] { -webkit-appearance: none; appearance: none; }
