/* Jubilee. One typeface, a near-white or near-black ground, and color only for
   giving, debt, and broken rules. */
:root {
  --bg: #F4F4F1; --card: #FFFFFF; --ink: #111113; --ink2: #5E5E66; --line: #E7E7E2;
  --track: #EAEAE5; --soft: #EDEDE8; --give-t: #8A5F00; --give-f: #D9A21B;
  --debt-t: #0B5CB8; --debt-f: #2F80ED; --warn-t: #B93A0B; --warn-f: #F2702A;
  --warn-bg: #FDEEE6; --btn: #111113; --btn-t: #FFFFFF;
  --shadow: 0 1px 2px rgba(17,17,19,.04), 0 10px 30px rgba(17,17,19,.06);
  --bar: rgba(255,255,255,.9);
}
html.dark {
  --bg: #0B0B0D; --card: #17171A; --ink: #F4F4F6; --ink2: #A0A0AB; --line: #2A2A30;
  --track: #2A2A30; --soft: #202025; --give-t: #E9B949; --give-f: #E9B949;
  --debt-t: #6CB6FF; --debt-f: #6CB6FF; --warn-t: #FF9B73; --warn-f: #FF9B73;
  --warn-bg: #2A1A14; --btn: #F4F4F6; --btn-t: #0B0B0D; --shadow: none;
  --bar: rgba(23,23,26,.92);
}
* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: light; }
html.dark { color-scheme: dark; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.page { max-width: 480px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 24px) 20px 120px; display: flex; flex-direction: column; gap: 16px; }
.page.narrow { padding-bottom: 40px; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.eyebrow { font-size: 13px; font-weight: 500; color: var(--ink2); }
.eyebrow strong { color: var(--ink); font-weight: 700; }
h1 { margin: 2px 0 0; font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.card { background: var(--card); border-radius: 24px; box-shadow: var(--shadow); padding: 18px; }
.card.list { padding: 4px 18px; }
.muted { color: var(--ink2); }
.small { font-size: 13px; line-height: 1.4; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer;
}
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.split > div { display: flex; flex-direction: column; gap: 5px; }
.split > div:first-child { padding-right: 16px; border-right: 1px solid var(--line); }
.split > div:last-child { padding-left: 16px; }
.label { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.label.give { color: var(--give-t); } .label.debt { color: var(--debt-t); }
.dot { width: 8px; height: 8px; border-radius: 4px; display: inline-block; }
.dot.give { background: var(--give-f); } .dot.debt { background: var(--debt-f); }
.figure { font-size: 32px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.hero { display: flex; flex-direction: column; gap: 2px; padding: 4px 4px 0; }
.hero .amount { font-size: 56px; font-weight: 700; letter-spacing: -0.05em; line-height: 1; }
.hero .amount.over { color: var(--warn-t); }
.env { display: flex; flex-direction: column; gap: 7px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.env:last-child { border-bottom: 0; }
.env .row { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; font-weight: 600; }
.env .row .empty { color: var(--warn-t); }
.bar { height: 4px; border-radius: 2px; background: var(--track); overflow: hidden; }
.bar > span { display: block; height: 4px; border-radius: 2px; background: var(--ink); }
.bar.empty > span { background: var(--warn-f); width: 100%; }
.tabs {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 16px);
  width: min(440px, calc(100% - 40px)); height: 64px; padding: 6px; border-radius: 32px;
  background: var(--bar); border: 1px solid var(--line); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px;
}
.tabs a, .tabs span {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: 26px; text-decoration: none; font-size: 11px; font-weight: 500; color: var(--ink2);
}
.tabs a.on { background: var(--soft); color: var(--ink); font-weight: 600; }
.tabs span { opacity: .45; }
form.stack { display: flex; flex-direction: column; gap: 14px; }
form.stack label { font-size: 13px; font-weight: 600; color: var(--ink2); display: block; margin-bottom: 6px; }
form.stack input[type=text], form.stack input[type=email], form.stack input[type=password] {
  width: 100%; height: 52px; border-radius: 16px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); font: inherit; font-size: 17px; padding: 0 16px;
}
.btn {
  height: 54px; border: 0; border-radius: 18px; background: var(--btn); color: var(--btn-t);
  font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; width: 100%;
  display: flex; align-items: center; justify-content: center; text-decoration: none;
}
.btn.quiet { background: transparent; color: var(--ink); font-weight: 500; height: 48px; }
.error, .errorlist { color: var(--warn-t); font-size: 14px; list-style: none; padding: 0; margin: 6px 0 0; }
.qr { background: #FFFFFF; border-radius: 16px; padding: 12px; width: 220px; margin: 0 auto; }
.qr svg { display: block; width: 100%; height: auto; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-family: ui-monospace, Menlo, monospace; font-size: 16px; }
.codes div { background: var(--soft); border-radius: 12px; padding: 12px; text-align: center; }
code.secret { word-break: break-all; font-size: 14px; }

/* Lists, forms, and summaries */
.section-label { display: flex; justify-content: space-between; padding: 0 6px; font-size: 12px; font-weight: 600; color: var(--ink2); letter-spacing: .04em; text-transform: uppercase; margin-bottom: -6px; }
.rows a.row, .rows .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 58px; padding: 8px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.rows > :last-child { border-bottom: 0; }
.row .title { font-size: 15px; font-weight: 600; }
.row .sub { font-size: 12px; color: var(--ink2); margin-top: 2px; }
.row .amt { font-size: 15px; font-weight: 600; white-space: nowrap; }
.round-btn { width: 44px; height: 44px; border-radius: 22px; background: var(--btn); color: var(--btn-t); display: flex; align-items: center; justify-content: center; text-decoration: none; flex: none; }
.field { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 56px; border-bottom: 1px solid var(--line); }
.field:last-child { border-bottom: 0; }
.field > label, .field > .name { font-size: 15px; color: var(--ink2); flex: none; }
.field input[type=text], .field input[type=number], .field input[type=date], .field select {
  border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 15px; font-weight: 600;
  text-align: right; height: 44px; padding: 0; min-width: 0; flex: 1 1 auto; max-width: 62%;
}
.field select { text-align-last: right; }
.field input:focus, .field select:focus, .money-input:focus { outline: 2px solid var(--debt-f); outline-offset: 2px; border-radius: 8px; }
.field input[type=checkbox] { width: 24px; height: 24px; accent-color: var(--debt-f); flex: none; }
.field.bad > label { color: var(--warn-t); }
.interval { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex: 1 1 auto; }
.interval input[type=number] { max-width: 64px; flex: none; border: 1px solid var(--line); border-radius: 12px; text-align: center; }
.interval select { max-width: 120px; flex: none; }
.help { font-size: 13px; line-height: 1.4; color: var(--ink2); margin: 0; padding: 0 0 14px; }
.money-input { width: 104px; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; text-align: right; padding: 0 12px; }
.money-input.bad { border-color: var(--warn-f); }
.summary { display: flex; flex-direction: column; }
.summary .line { display: flex; justify-content: space-between; align-items: center; min-height: 44px; font-size: 15px; border-bottom: 1px solid var(--line); }
.summary .line:last-child { border-bottom: 0; font-weight: 700; min-height: 52px; }
.summary .line span:first-child { color: var(--ink2); }
.summary .line:last-child span:first-child { color: var(--ink); }
.over { color: var(--warn-t); }
.month-nav { display: flex; gap: 8px; }
.btn.warn { background: transparent; color: var(--warn-t); font-weight: 500; height: 48px; }
.btn.outline { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.notice { background: var(--warn-bg); color: var(--warn-t); border-radius: 16px; padding: 12px 16px; font-size: 14px; }

.eyebrow.brand { display: flex; align-items: center; gap: 6px; }
.eyebrow.brand .mark { color: var(--ink); flex: none; }
