:root {
  --page: #f4f4f6;
  --surface: #ffffff;
  --sunken: #f4f4f6;
  --ink: #101014;
  --muted: #67676f;
  --faint: #6b6b74;
  --dim: #a4a4ae;
  --hairline: #eaeaef;
  --primary: #6247e0;
  --primary-soft: #f0edfd;
  --on-primary-soft: #6247e0;
  --waiting-soft: #e6eefb;
  --on-waiting-soft: #2c5aa0;
  --money-soft: #fbe9ec;
  --on-money-soft: #b03650;
  --scope-soft: #e6f4f6;
  --on-scope-soft: #24717a;
  --contrast: #101014;
  --on-contrast: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0e0e12;
    --surface: #1a1a21;
    --sunken: #13131a;
    --ink: #f2f2f5;
    --muted: #9c9ca8;
    --faint: #85858f;
    --dim: #5e5e69;
    --hairline: #2a2a33;
    --primary-soft: #262048;
    --on-primary-soft: #b9aaff;
    --waiting-soft: #16233a;
    --on-waiting-soft: #9cc0f5;
    --money-soft: #3a1f27;
    --on-money-soft: #f7a3b0;
    --scope-soft: #102e32;
    --on-scope-soft: #7fd6df;
    --contrast: #f2f2f5;
    --on-contrast: #0e0e12;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Manrope", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
button { font: inherit; }

.page { max-width: 480px; margin: 0 auto; padding: 18px 20px 40px; display: flex; flex-direction: column; gap: 22px; }
.col { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap4 { gap: 4px; } .gap8 { gap: 8px; } .gap10 { gap: 10px; } .gap12 { gap: 12px; } .gap14 { gap: 14px; }
.grow { flex: 1; min-width: 0; }

.eyebrow { font-size: 11px; line-height: 13px; font-weight: 700; letter-spacing: 1.76px; text-transform: uppercase; color: var(--faint); }
.title { font-size: 40px; line-height: 47px; font-weight: 800; letter-spacing: -1.4px; }
.card-title { font-size: 19px; line-height: 22px; font-weight: 700; letter-spacing: -.38px; }
.body { font-size: 16px; line-height: 21px; font-weight: 600; }
.secondary { font-size: 13px; line-height: 17px; color: var(--muted); }
.context { font-size: 14px; line-height: 17px; font-weight: 600; color: var(--muted); }
.amount { font-size: 17px; line-height: 20px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.card { background: var(--surface); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.list { background: var(--surface); border-radius: 20px; padding: 0 18px; }
.list > * + * { border-top: 1px solid var(--hairline); }
.rule { height: 1px; background: var(--hairline); }
.quote { background: var(--sunken); border-radius: 14px; padding: 14px; font-size: 14px; line-height: 19px; }

.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 11px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.chip.neutral { background: var(--hairline); color: var(--muted); }
.chip.waiting { background: var(--waiting-soft); color: var(--on-waiting-soft); }
.chip.money { background: var(--money-soft); color: var(--on-money-soft); }
.chip.scope { background: var(--scope-soft); color: var(--on-scope-soft); }

.segments { display: flex; gap: 4px; }
.segments span { flex: 1; height: 6px; border-radius: 3px; background: var(--hairline); }
.segments span.on { background: var(--primary); }

.btn {
  height: 50px; border: 0; border-radius: 16px; width: 100%;
  background: var(--contrast); color: var(--on-contrast);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: transform 140ms cubic-bezier(.05,.7,.1,1), background-color 140ms;
}
.btn:active { transform: scale(.978); }
.btn:disabled { background: var(--hairline); color: var(--muted); cursor: default; transform: none; }
.btn.quiet { background: var(--surface); color: var(--ink); }
.btn.sunken { background: var(--sunken); color: var(--ink); }
.btn.small { height: 44px; border-radius: 14px; }
.btn:focus-visible, .field:focus-visible, .remove:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.note { display: flex; gap: 12px; align-items: flex-start; padding: 15px 0; }
.num { width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; background: var(--primary-soft); color: var(--on-primary-soft); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.note p { flex: 1; font-size: 15px; line-height: 20px; overflow-wrap: anywhere; }
.remove { border: 0; background: var(--sunken); color: var(--muted); border-radius: 10px; height: 30px; padding: 0 12px; font-size: 11px; font-weight: 700; cursor: pointer; }

.composer { display: flex; flex-direction: column; gap: 10px; padding: 15px 0; }
.field {
  width: 100%; border: 0; resize: vertical; min-height: 72px; padding: 12px 14px; border-radius: 14px;
  background: var(--sunken); color: var(--ink); font: 500 15px/20px "Manrope", system-ui, sans-serif;
}
.field::placeholder { color: var(--dim); }
.field:focus { outline: none; }

.change { display: flex; align-items: center; gap: 10px; }
.change .was { color: var(--faint); text-decoration: line-through; font-size: 14px; font-weight: 600; }
.change .arrow { color: var(--faint); }

.mark { width: 22px; height: 22px; flex-shrink: 0; }
.centered { text-align: center; align-items: center; }

dialog {
  border: 0; border-radius: 24px; padding: 24px; width: min(340px, calc(100vw - 32px));
  background: var(--surface); color: var(--ink);
}
dialog::backdrop { background: rgba(0, 0, 0, .45); }

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

.card.files { flex-direction: row; align-items: center; color: inherit; text-decoration: none; }
.card.files:active { transform: scale(.978); }
.preview { margin: 0; background: var(--surface); border-radius: 20px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.preview img { display: block; width: 100%; height: auto; border-radius: 14px; background: var(--sunken); }
.preview figcaption { padding: 0 6px 4px; overflow-wrap: anywhere; }
.pinwrap { position: relative; border-radius: 14px; overflow: hidden; }
.pinwrap.tappable { cursor: crosshair; }
.pin {
  position: absolute; transform: translate(-50%, -50%); width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(16, 16, 20, .25);
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; pointer-events: none;
}
.pin.pending { background: var(--contrast); color: var(--on-contrast); }
.num.pinned { background: var(--primary); color: #fff; }
.link { color: var(--primary); text-decoration: none; font-weight: 600; }
@media (prefers-color-scheme: dark) { .link { color: var(--on-primary-soft); } }

/* Policy pages: long-form reading. */
.doc { gap: 18px; }
.doc h2 { font-size: 19px; line-height: 24px; font-weight: 700; letter-spacing: -.3px; margin-top: 10px; }
.doc p, .doc li { font-size: 15px; line-height: 22px; color: var(--ink); }
.doc ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.doc a { color: var(--primary); font-weight: 600; text-decoration: none; }
@media (prefers-color-scheme: dark) { .doc a { color: var(--on-primary-soft); } }
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; }

.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.linkbtn { display: flex; align-items: center; justify-content: center; text-decoration: none; }
