:root {
    color-scheme: light;
    font: 16px/1.5 system-ui, sans-serif;
    color: #25203a;
    background: #f7f5ff;
    --accent: #6d28d9;
    --muted: #5f5674;
    --border: #e7dff6;
}
* { box-sizing: border-box; }
body { margin: 0; }
.shell { width: min(100% - 2rem, 55rem); margin-inline: auto; }
.top { background: #fff; border-bottom: 1px solid var(--border); }
.bar, nav, .inline, .chips { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; }
.bar { min-height: 4rem; justify-content: space-between; align-items: center; padding-block: .55rem; }
nav { align-items: center; }
a { color: var(--accent); }
nav a, .brand { text-decoration: none; font-weight: 650; }
.brand { color: inherit; }
.brand span { display: inline-grid; place-items: center; background: #ede5ff; width: 2rem; height: 2rem; border-radius: .65rem; color: var(--accent); }
nav a { padding: .45rem .7rem; border-radius: .65rem; }
nav a[aria-current] { background: #ede5ff; }
main { padding-block: 2.5rem; }
h1, h2, p { margin: 0 0 .65rem; }
h1 { font-size: clamp(2rem, 6vw, 3.25rem); line-height: 1.1; letter-spacing: -.05em; overflow-wrap: anywhere; }
h2 { font-size: 1.15rem; }
.muted, small { color: var(--muted); }
.card { background: #fff; border: 1px solid var(--border); border-radius: 1.2rem; padding: 1.2rem; margin-block: 1rem; box-shadow: 0 8px 24px #4a24800a; }
.columns { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.stack, label, .balance { display: grid; gap: .45rem; }
label { font-weight: 600; min-width: 0; }
.inline label { flex: 1 1 10rem; }
input, select, button { font: inherit; border-radius: .6rem; padding: .6rem .8rem; min-height: 2.75rem; }
input, select { border: 1px solid #c9bbde; width: 100%; color: inherit; background: #fff; }
button { background: linear-gradient(110deg, #6d28d9, #7544d9); color: #fff; border: 1px solid transparent; cursor: pointer; font-weight: 650; }
button:hover { filter: brightness(.9); }
:focus-visible { outline: 3px solid #8b5cf6; outline-offset: 3px; }
.quiet { color: var(--accent); background: #f1eaff; }
.danger { color: #a22b30; background: #fff0ef; }
.notice { border: 1px solid #e3b3aa; background: #fff0eb; padding: .7rem 1rem; border-radius: .6rem; }
.people { padding: 0; list-style: none; }
.people a { display: flex; justify-content: space-between; gap: 1rem; text-decoration: none; color: inherit; overflow-wrap: anywhere; }
.people a:hover { border-color: var(--accent); }
.balance { background: #f2ebff; }
.balance strong { font-size: clamp(1.8rem, 7vw, 3rem); letter-spacing: -.04em; }
.back { display: inline-block; margin-bottom: .65rem; }
.chips button { background: #f1eaff; color: var(--accent); overflow-wrap: anywhere; }
.chips form { max-width: 100%; }
.entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .5rem 1rem; padding: .7rem 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.entry form { grid-column: 1 / -1; justify-self: end; }
.credit { color: var(--accent); }
.custom-amount { margin-top: 1rem; }
.overview { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.overview .balance { background: #fff; }
.owes { color: #a72843; }
.receives { color: #146747; }
.overview .balance strong { font-size: clamp(1.15rem, 5vw, 2.3rem); overflow-wrap: anywhere; }
details summary { color: #a22b30; cursor: pointer; font-weight: 650; }
details[open] summary { margin-bottom: .65rem; }
.remember { background: #f2ebff; }
.hero {
    color: white;
    padding: clamp(1.3rem, 5vw, 3rem);
    border-radius: 1.4rem;
    background: radial-gradient(ellipse at 100% 130%, #ffffff22 0 36%, transparent 37%),
        radial-gradient(ellipse at 100% 130%, #ffffff18 0 50%, transparent 51%),
        linear-gradient(115deg, #5420b5, #7544d9);
}
.hero p:last-child { margin-bottom: 0; }
.eyebrow { font-weight: 650; color: #f2e8ff; }
.remember p { max-width: 40rem; }
.entry form { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.people a { align-items: center; min-height: 3rem; }
.people a > span { white-space: nowrap; }

@media (max-width: 36rem) {
    main { padding-block: 1.4rem; }
    .bar { gap: .5rem; }
    nav { position: fixed; bottom: 0; inset-inline: 0; z-index: 2; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .2rem; background: #fff; border-top: 1px solid var(--border); padding: .35rem .45rem calc(.35rem + env(safe-area-inset-bottom)); }
    nav a { display: grid; place-items: center; min-height: 2.75rem; padding-inline: .15rem; font-size: .85rem; }
    .signed-in { padding-bottom: calc(5rem + env(safe-area-inset-bottom)); }
    .columns { gap: 0; }
    .card { padding: 1rem; }
    .inline { display: grid; grid-template-columns: minmax(0, 1fr); }
    .chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); }
    .chips button { width: 100%; min-height: 3rem; }
    .chips strong { display: block; }
    .entry form { justify-self: start; }
}
