:root {
  /* Exact values from the brand sheet: Porcelain, Midnight Ink, Mineral Sea, Sea Glass, Soft Coral. */
  --bg: #f6f5f0; --card: #ffffff; --position-bg: #daeae6; --text: #152521; --muted: #6f756f; --line: #e7e4df;
  --accent: #15695b; --accent-text: #ffffff; --pos: #15695b; --pos-tint: #daeae6; --neg: #c6695a; --neg-tint: #f5e7e4;
  --radius: 18px; --radius-sm: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151514; --card: #1f1f1d; --position-bg: #1c2821; --text: #f1efeb; --muted: #a29d96; --line: #33322f;
          --accent: #6cc59a; --accent-text: #0e1a14; --pos: #6cc59a; --pos-tint: #203027; --neg: #ef8a7c; --neg-tint: #2e1f1c; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
       font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
main { max-width: 560px; margin: 0 auto; padding: 20px 16px 110px; }

/* ---------- brand ---------- */
.brand-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
a.brand-header { text-decoration: none; color: inherit; }
.brand-mark { flex-shrink: 0; }
.brand-header h1 { font-size: 22px; margin: 0; font-weight: 800; letter-spacing: -0.01em; }
.brand-header .sub { font-size: 14px; color: var(--muted); margin-top: 1px; }
.brand-header .spacer { flex: 1; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
            border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--text); flex-shrink: 0; }

/* ---------- marketing landing page ---------- */
body.landing main { max-width: none; padding: 0; }

.hero-cta { display: inline-block; background: var(--accent); color: var(--accent-text); font-weight: 700;
            font-size: 16px; padding: 14px 28px; border: 0; border-radius: 999px; text-decoration: none;
            box-shadow: 0 8px 20px rgb(21 105 91 / 0.28); cursor: pointer; }
.hero-cta:active { opacity: 0.88; }
.hero-cta[disabled] { opacity: .55; cursor: default; box-shadow: none; }

.landing-topbar { display: flex; align-items: center; justify-content: space-between;
                  max-width: 1080px; margin: 0 auto; padding: 20px 24px; }
.landing-brand { display: flex; align-items: center; gap: 10px; text-decoration: none;
                 color: var(--text); font-weight: 800; font-size: 17px; }
.landing-nav { display: flex; gap: 20px; }
.landing-nav a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; }
.landing-nav a:hover { color: var(--text); }

.landing-hero { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: center;
                max-width: 1080px; margin: 0 auto; padding: 48px 24px 72px; }
@media (min-width: 880px) { .landing-hero { grid-template-columns: 1.1fr 0.9fr; padding-top: 72px; } }

.landing-h1 { font-size: 56px; line-height: 1.03; letter-spacing: -0.02em; font-weight: 800; margin: 10px 0 18px; }
@media (max-width: 480px) { .landing-h1 { font-size: 38px; } }
.landing-lede { font-size: 17px; line-height: 1.55; color: var(--muted); max-width: 440px; margin: 0 0 28px; }
.landing-ctas { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.landing-cta-note { font-size: 13px; color: var(--muted); margin: 0; }

.landing-hero-demo { background: var(--card); border: 1px solid var(--line); border-radius: 24px;
                      padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.landing-hero-demo .position-card { margin-bottom: 0; }

.landing-section { padding: 56px 24px; max-width: 1080px; margin: 0 auto; }
.landing-h2 { font-size: 28px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 32px; text-align: center; }

.landing-steps { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .landing-steps { grid-template-columns: repeat(3, 1fr); } }
.landing-step-num { display: block; font-size: 13px; font-weight: 800; color: var(--accent); letter-spacing: .08em; margin-bottom: 10px; }
.landing-step h3 { font-size: 17px; font-weight: 800; margin: 0 0 6px; }
.landing-step p { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.5; }

.landing-features { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .landing-features { grid-template-columns: repeat(2, 1fr); } }
.landing-feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.landing-feature .avatar { margin-bottom: 14px; }
.landing-feature h3 { font-size: 16px; font-weight: 800; margin: 0 0 6px; }
.landing-feature p { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.5; }

.landing-footer { border-top: 1px solid var(--line); padding: 36px 24px 48px; margin-top: 24px;
                   text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.landing-footer .landing-brand { font-size: 15px; }
.landing-footer nav { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.landing-footer nav a { color: var(--muted); font-size: 13px; text-decoration: none; }
.landing-footer nav a:hover { color: var(--accent); }
.landing-copyright { font-size: 12px; }

@media (prefers-reduced-motion: no-preference) {
  .landing-hero-copy, .landing-hero-demo { animation: landing-rise .6s ease both; }
  .landing-hero-demo { animation-delay: .08s; }
}
@keyframes landing-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

h1 { font-size: 26px; margin: 8px 0 4px; letter-spacing: -0.01em; font-weight: 800; }
h2 { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; color: var(--text); margin: 24px 0 10px; }
.muted { color: var(--muted); }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }

/* ---------- position card ---------- */
.position-card { background: var(--position-bg); border-radius: var(--radius); padding: 20px; margin-bottom: 8px; }
.position-card .headline { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; margin: 6px 0 4px; letter-spacing: -0.01em; }
.position-card .detail { color: var(--muted); font-size: 15px; }
.position-bar { height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--text) 12%, transparent); margin: 16px 0 10px; overflow: hidden; }
.position-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.position-split { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; }
.position-split .owe-you { color: var(--accent); }

/* ---------- cards / rows ---------- */
.stack { display: flex; flex-direction: column; gap: 8px; }
.item-card { background: var(--card); border-radius: var(--radius-sm); padding: 14px; display: flex; align-items: center; gap: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
          font-weight: 800; font-size: 16px; flex-shrink: 0; background: var(--pos-tint); color: var(--pos); }
.avatar.neg { background: var(--neg-tint); color: var(--neg); }
.avatar.icon { background: var(--position-bg); color: var(--accent); font-size: 18px; }
.item-main { flex: 1; min-width: 0; }
.item-title { font-weight: 700; }
.item-sub { font-size: 13px; color: var(--muted); margin-top: 1px; }
.item-sub.pos { color: var(--pos); font-weight: 600; }
.item-sub.neg { color: var(--neg); font-weight: 600; }
.item-amount { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.item-amount.pos { color: var(--pos); } .item-amount.neg { color: var(--neg); }
.item-amount .fx { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.chev { color: var(--muted); opacity: .6; flex-shrink: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 16px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--pos); } .neg { color: var(--neg); }
.total { font-size: 36px; font-weight: 800; font-variant-numeric: tabular-nums; }

form { display: grid; gap: 10px; }
label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
input, select { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line);
                border-radius: 10px; padding: 10px 12px; width: 100%; }
input.big { font-size: 28px; font-weight: 800; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: flex; align-items: center; gap: 6px; color: var(--text); background: var(--card);
                border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }
.checks input { width: auto; }
.split-rows { display: flex; flex-direction: column; gap: 6px; }
.split-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.split-row .split-input { width: 90px; text-align: right; }
.split-hint { font-size: 13px; margin: 4px 0 0; }
button { font: inherit; font-weight: 700; border: 0; border-radius: 14px; padding: 13px 16px; cursor: pointer;
         background: var(--accent); color: var(--accent-text); }
button.secondary { background: var(--card); color: var(--text); border: 1.5px solid var(--text); padding: 11.5px 12px; }
button:disabled { opacity: .5; cursor: default; }
.error { color: var(--neg); }
a { color: var(--accent); }
.card.pad { padding: 16px; }
.footer { margin-top: 32px; }

/* ---------- sticky action bar (group view) ---------- */
.action-bar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 10px;
              padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 88%, transparent);
              backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.action-bar button { flex: 1; margin: 0; }
