:root {
  color-scheme: light dark;
  --bg: #fbfaf6;
  --ink: #172e2b;
  --muted: #50645c;
  --primary: #204e45;
  --on: #fff;
  --line: #ced7ce;
  --soft: #eaf0e8;
  --accent: #e3efaf;
  --warn: #9d312d;
  font:
    16px/1.45 -apple-system,
    BlinkMacSystemFont,
    "Roboto",
    sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121d1a;
    --ink: #e7f1e8;
    --muted: #b4c6bc;
    --primary: #aad9be;
    --on: #16382b;
    --line: #43574c;
    --soft: #213329;
    --warn: #ffb4a9;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
}
.shell {
  height: 100vh;
  height: 100dvh;
  max-width: 530px;
  margin: auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
header,
footer,
main {
  padding-inline: 20px;
}
header {
  padding-top: max(12px, env(safe-area-inset-top));
  padding-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
h1 {
  font-size: clamp(18px, 5vw, 24px);
  letter-spacing: -0.7px;
  margin: 0;
}
#who {
  margin-left: auto;
  font-size: 13px;
  font-weight: 650;
  max-width: 24%;
  overflow-wrap: anywhere;
}
.logo {
  background: #1b443d;
  color: var(--accent);
  border-radius: 11px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 27px;
  line-height: 1;
}
main {
  overflow: auto;
  flex: 1;
  padding-block: 10px 24px;
}
footer {
  padding-top: 8px;
  padding-bottom: max(4px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
[hidden] {
  display: none !important;
}
h2 {
  font-size: 23px;
  line-height: 1.16;
  letter-spacing: -0.6px;
  margin: 22px 0 12px;
}
h3 {
  font-size: 18px;
  margin: 20px 0 8px;
}
p {
  margin: 8px 0 14px;
}
.hint,
small {
  color: var(--muted);
}
button,
a,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  touch-action: manipulation;
  color: var(--ink);
  background: none;
  border: 0;
  min-height: 44px;
  font-weight: 630;
}
button:disabled {
  opacity: 0.55;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.primary,
.secondary {
  padding: 10px 15px;
  border-radius: 13px;
  min-height: 48px;
}
.primary {
  background: var(--primary);
  color: var(--on);
}
.secondary {
  border: 1px solid var(--line);
}
a {
  color: var(--primary);
  text-underline-offset: 3px;
}
#add,
.wide {
  width: 100%;
}
nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
}
nav button {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
  padding: 3px;
}
nav i {
  display: block;
  width: 44px;
  margin: auto;
  border-radius: 12px;
  font-style: normal;
  font-size: 19px;
  line-height: 24px;
}
nav [aria-current="page"] {
  color: var(--ink);
}
nav [aria-current="page"] i {
  background: var(--accent);
  color: #244330;
}
.month,
.between,
.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.month strong::first-letter {
  text-transform: uppercase;
}
.month button {
  font-size: 24px;
  width: 44px;
}
.card {
  background: #1b443d;
  color: #f8fbf2;
  padding: 19px;
  border-radius: 20px;
  margin: 5px 0 12px;
}
.card small,
.card button {
  color: #e3efaf;
}
.card strong {
  display: block;
  font-size: clamp(34px, 10vw, 50px);
  line-height: 1.14;
  letter-spacing: -1.6px;
  margin: 4px 0 10px;
}
.card .between {
  font-size: 13px;
}
.card button {
  text-decoration: underline;
  padding: 4px;
}
.card progress {
  width: 100%;
  height: 7px;
  display: block;
  margin: 4px 0 7px;
  border: 0;
  appearance: none;
  background: #547168;
  border-radius: 9px;
}
.card progress::-webkit-progress-bar {
  background: #547168;
  border-radius: 9px;
}
.card progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 9px;
}
.card progress::-moz-progress-bar {
  background: var(--accent);
}
.totals,
.seg {
  display: flex;
  background: var(--soft);
  padding: 12px 14px;
  border-radius: 14px;
  gap: 10px;
}
.totals > div,
.seg button {
  flex: 1;
}
.totals strong,
.totals small {
  display: block;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.row > span:first-child {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--soft);
  display: grid;
  place-items: center;
  flex: none;
}
.row > span:nth-child(2) {
  min-width: 0;
  overflow-wrap: anywhere;
}
.row small {
  display: block;
  font-weight: 400;
}
.row b {
  margin-left: auto;
  white-space: nowrap;
}
.seg {
  padding: 4px;
}
.seg button {
  font-size: 14px;
  border-radius: 10px;
}
.seg [aria-pressed="true"] {
  background: var(--primary);
  color: var(--on);
}
.start {
  padding-top: clamp(15px, 7vh, 65px);
}
.start h2 {
  font-size: 34px;
}
.start .primary,
.start .secondary {
  margin-top: 8px;
}
.intro {
  background: var(--soft);
  border-radius: 16px;
  padding: 14px 16px;
  margin: 22px 0 14px;
}
.intro b {
  font-size: 25px;
}
.actions {
  margin-top: 16px;
}
.actions > * {
  flex: 1;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 20px;
  width: min(94vw, 470px);
  max-height: 88dvh;
  background: var(--bg);
  color: var(--ink);
  padding: 18px 20px;
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: #10241db3;
}
dialog h2 {
  margin-top: 4px;
}
label {
  display: block;
  margin-top: 11px;
  font-size: 14px;
  font-weight: 650;
}
input,
select {
  display: block;
  width: 100%;
  margin-top: 4px;
  background: var(--bg);
  color: var(--ink);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 16px;
  min-height: 44px;
}
#error {
  color: var(--warn);
  margin: 5px 0;
}
#status:not(:empty) {
  position: fixed;
  z-index: 3;
  left: 50%;
  transform: translateX(-50%);
  bottom: 135px;
  width: max-content;
  max-width: 89vw;
  padding: 9px 14px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
}
.details p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
.details b {
  overflow-wrap: anywhere;
}
.link {
  word-break: break-all;
}
.amount {
  font-variant-numeric: tabular-nums;
}
.stack > * {
  display: block;
  margin-block: 12px;
}
.empty {
  color: var(--muted);
  padding: 12px 0;
}
