@font-face{font-family:Inter Tight;src:url('./assets/inter-tight.woff2') format('truetype');font-weight:500;font-display:swap}*{box-sizing:border-box}html{background:#f7f7f7;color:#080808;font-family:'Inter Tight',Arial,sans-serif;font-weight:500}body{margin:0}button,input{font:inherit}button{cursor:pointer;border:0;color:inherit;-webkit-tap-highlight-color:transparent}button:active{filter:brightness(.95);transform:scale(.97)}button:focus-visible,input:focus-visible{outline:2px solid #0180b7;outline-offset:3px}#app{position:relative;max-width:480px;margin:auto;min-height:100svh;padding:71px 14px 90px;background:#fff}#app.home{background:linear-gradient(#4fc6e6 0,#f7f7f7 278px,#f7f7f7 100%)}.space{height:38px;background:#fff;border-radius:100px;padding:2px 14px 2px 2px;display:flex;align-items:center;gap:8px}.space .avatar{width:33px;height:34px;background:#0180b7;font-size:16px}.space img{margin-left:1px}.avatar{width:40px;height:40px;flex-shrink:0;border-radius:100%;background:#eb74ac;color:#fff;display:grid;place-items:center;font-size:18px;font-weight:400}.summary{margin-top:80px;text-align:center}.badge{display:inline-block;padding:4px 12px;border-radius:100px;background:#fff;color:#888;font-size:14px;line-height:18px}.money{white-space:nowrap;font-size:42px;line-height:48px;letter-spacing:-1.68px;font-variant-numeric:tabular-nums}.money small{font-size:24px;letter-spacing:-.96px;color:#888}.summary .money{margin-top:14px}.list-section{margin-top:80px}.list-header{height:23px;display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.muted{color:#888}.icon{display:grid;place-items:center;width:40px;height:40px;border-radius:100%;background:#f7f7f7;flex-shrink:0}.search-toggle{background:transparent;width:32px;height:32px;margin-right:-6px}.cards{display:flex;flex-direction:column;gap:8px}.row{position:relative;border-radius:24px;overflow:hidden;height:68px;flex-shrink:0;transition:height .55s cubic-bezier(.22,1,.36,1),margin .55s}.card{display:flex;align-items:center;gap:8px;position:relative;width:100%;height:68px;border-radius:24px;background:white;padding:14px;text-align:left;touch-action:pan-y;transition:transform .4s cubic-bezier(.22,1,.36,1);z-index:1}.card .name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:16px}.card .money,.history .money{font-size:18px;line-height:26px;letter-spacing:0}.card .money small,.history .money small{font-size:12px;letter-spacing:0}.delete-reveal{position:absolute;inset:0;background:#e74455;color:white;display:flex;align-items:center;justify-content:flex-end;padding-right:18px;gap:8px}.fab{position:fixed;bottom:max(69px,env(safe-area-inset-bottom));right:max(calc((100vw - 480px)/2 + 36px),36px);width:70px;height:70px;border-radius:100%;background:#0180b7;box-shadow:0 0 40px -4px #eb74accc;display:grid;place-items:center;z-index:2}.empty{border-radius:24px;background:#fff;min-height:438px;text-align:center;padding:80px 10px}.empty img{width:80px;height:80px}.empty h2{font-size:24px;font-weight:500;margin:24px 0 12px}.empty p{color:#888;margin:0}.topbar{display:flex;align-items:center;justify-content:space-between;min-height:40px;gap:8px}.topbar h1{font-size:20px;font-weight:500;margin:0;overflow-wrap:anywhere;text-align:center}.topbar .spacer{width:40px}.detail-summary{margin-top:50px;text-align:center}.detail-summary .money{margin-top:14px}.detail-summary .badge{padding:0}.actions{display:flex;gap:14px;margin-top:40px}.primary,.secondary{border-radius:100px;min-height:52px;padding:14px 24px;background:#0180b7;color:#fff;font-size:16px}.secondary{background:#f7f7f7;color:#0180b7}.actions .primary{flex:1}.history{margin-top:60px}.history h2{font-size:16px;font-weight:500;margin:0 0 8px}.event{background:#f7f7f7;border-radius:24px;padding:14px;display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:8px;gap:8px}.event p{margin:0 0 8px;font-size:14px;color:#888}.event time{font-size:14px;color:#888;white-space:nowrap}.entry{margin-top:50px}.field-label{display:block;font-size:14px;color:#888;margin-bottom:8px}input.name-input{border:0;border-radius:18px;background:#f7f7f7;padding:14px 20px;height:56px;width:100%}.amount-block{text-align:center;margin-top:40px}.amount-label{font-size:14px;color:#888}.amount-input{display:flex;align-items:baseline;justify-content:center;margin-top:14px;color:#888;gap:4px}.amount-input span{font-size:24px}.amount-input input{font-size:64px;letter-spacing:-2.56px;line-height:70px;color:#888;background:transparent;border:0;max-width:95%;width:160px;text-align:center;min-width:0}.quick{display:flex;flex-wrap:wrap;justify-content:center;gap:14px;margin:40px auto 0;max-width:340px}.quick button{background:#f7f7f7;padding:14px;border-radius:100px;min-height:48px;font-size:14px}.quick button.chosen{background:#e1f4fa;color:#0180b7}.submit-page{width:100%;margin-top: max(80px,calc(100svh - 655px))}.searchbar{display:flex;gap:14px;align-items:center;margin-bottom:14px}.searchbar input{flex:1;min-width:0;border:2px solid #0180b7;background:#fff;border-radius:100px;padding:14px;font-size:14px}dialog{border:0;padding:24px 10px;position:fixed;top:auto;bottom:4px;width:calc(100% - 8px);max-width:472px;max-height:calc(100dvh - 16px);margin:0 auto;border-radius:44px;background:#fff;overflow:auto;color:#080808}dialog::backdrop{background:#0000003d;backdrop-filter:blur(7px)}dialog[open]{animation:sheet-in .45s cubic-bezier(.22,1,.36,1)}@keyframes sheet-in{from{transform:translateY(100%);opacity:.4}to{transform:translateY(0);opacity:1}}dialog .topbar{height:48px}dialog h2{font-size:18px;font-weight:500;margin:0}dialog .close{width:48px;height:48px}dialog .amount-block{margin-top:40px}dialog .primary.full{width:100%;margin-top:40px;min-height:56px}dialog.confirmation{padding-top:40px;padding-bottom:24px;text-align:center;background:linear-gradient(#4fc6e6,#f7f7f7 33%,#f7f7f7)}dialog.confirmation h2{font-size:20px;line-height:26px}dialog.confirmation .coin{display:block;width:130px;height:130px;margin:40px auto 24px}dialog.confirmation p{color:#888;font-size:18px;margin:0 0 14px}dialog.confirmation p strong{color:#080808;font-weight:500}dialog.confirmation .primary{margin-top:40px;width:100%}.space-list{display:grid;gap:14px;margin-top:40px}.space-option{border-radius:100px;padding:10px 14px;background:#f7f7f7;display:flex;align-items:center;gap:8px;text-align:left}.space-option .select-space{flex:1;text-align:left;background:transparent;display:flex;align-items:center;gap:8px}.space-option .avatar{background:#0180b7;width:33px;height:34px}.error{color:#b31635;font-size:14px;text-align:center;min-height:20px}.toast-visible{position:fixed;z-index:10;left:50%;bottom:20px;transform:translateX(-50%);width:max-content;max-width:94vw;border-radius:20px;background:#080808;color:white;padding:12px 18px;box-shadow:0 6px 30px #0002}.toast-visible button{margin-left:18px;color:#65d6f1;background:none}.settled .card{pointer-events:none}.settled .name,.settled .money{opacity:0;transition:opacity .25s}.settled .avatar{background:#8dc85a;transition:background .3s,transform .7s cubic-bezier(.22,1,.36,1);transform:translateX(calc(var(--card-width) - 68px))}.settled-label{position:absolute;left:20px;opacity:0;color:#308542}.settled .settled-label{opacity:1;transition:opacity .6s .25s}.row.collapsing{height:0;margin-top:-8px}.confetti-canvas{position:fixed;inset:0;pointer-events:none;z-index:30;width:100%;height:100%}.utility{display:flex;justify-content:center;gap:12px;margin-top:32px}.utility button{background:transparent;color:#888;font-size:12px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}@media(min-width:600px){#app{min-height:100svh;box-shadow:0 0 60px #00000008}.fab{right:calc((100vw - 480px)/2 + 36px)}}@media(max-width:350px){.card{padding:12px;gap:6px}.card .name{font-size:14px}.card .money{font-size:16px}.quick{gap:8px}.money{font-size:36px}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.001ms!important;transition-duration:.001ms!important;scroll-behavior:auto!important}}

.money{height:48px}.card .money,.history .money{height:26px}.delete-reveal{inset:2px;border-radius:22px}#app.home>footer.utility{display:none}

/* Search expands from its original icon while the list flows below it. */
.search-heading{position:relative;height:23px;margin-bottom:8px;transition:height .55s cubic-bezier(.22,1,.36,1),margin-bottom .55s cubic-bezier(.22,1,.36,1)}
.debt-count{display:block;line-height:23px;transition:opacity .2s,transform .45s cubic-bezier(.22,1,.36,1)}
.search-shell{position:absolute;right:-6px;top:-5px;width:32px;height:32px;border:2px solid transparent;border-radius:100px;background:transparent;transition:width .55s cubic-bezier(.22,1,.36,1),height .55s cubic-bezier(.22,1,.36,1),right .55s cubic-bezier(.22,1,.36,1),top .55s cubic-bezier(.22,1,.36,1),background-color .3s,border-color .3s;overflow:hidden}
.search-glyph{position:absolute;left:4px;top:50%;transform:translateY(-50%);display:grid;place-items:center;width:20px;height:20px;pointer-events:none;transition:left .55s cubic-bezier(.22,1,.36,1),opacity .3s}
.search-shell input{display:block;width:100%;height:100%;min-width:0;margin:0;padding:0 14px 0 42px;border:0;border-radius:100px;background:transparent;opacity:0;font-size:14px;color:#080808;transition:opacity .2s .12s;appearance:none;-webkit-appearance:none}
.search-shell input:focus,.search-shell input:focus-visible{outline:none;box-shadow:none}
.search-shell input::placeholder{color:#888;opacity:1}.search-shell input::-webkit-search-cancel-button{display:none}
.search-trigger{position:absolute;inset:0;width:100%;height:100%;background:transparent;border-radius:100%}
.search-close{position:absolute;left:0;top:0;width:48px;height:48px;background:white;opacity:0;transform:scale(.7);pointer-events:none;transition:opacity .25s,transform .55s cubic-bezier(.22,1,.36,1)}
.search-open{height:50px;margin-bottom:14px}.search-open .debt-count{opacity:0;transform:translateX(-12px)}.search-open .search-shell{right:0;top:0;width:calc(100% - 62px);height:50px;border-color:#0180b7;background:white}.search-open .search-glyph{left:14px;opacity:.5}.search-open input{opacity:1}.search-open .search-close{opacity:1;transform:scale(1);pointer-events:auto}.search-open .search-trigger{pointer-events:none}
.amount-input{position:relative;width:100%;max-width:100%;gap:4px;padding:0 8px;overflow:visible}
.amount-input input{flex:0 0 auto;width:auto;max-width:none;padding:0;margin:0;min-width:0;outline:none;box-shadow:none;text-align:left;color:#080808;line-height:70px;letter-spacing:-.04em;font-variant-numeric:tabular-nums}
.amount-input input:focus-visible{outline:none}.amount-input input::placeholder{color:#888;opacity:1}.amount-currency{flex:0 0 auto;color:#888;line-height:1}.amount-measure{position:absolute!important;visibility:hidden;pointer-events:none;white-space:pre;font-size:64px;font-family:inherit;font-weight:500;letter-spacing:-.04em;line-height:70px;font-variant-numeric:tabular-nums}
dialog.confirmation{overflow:hidden;isolation:isolate}.confirmation .confetti-canvas{position:absolute;inset:0;width:100%;height:100%;z-index:0;pointer-events:none;border-radius:inherit}.confirmation>:not(.confetti-canvas){position:relative;z-index:1}

.search-open .search-shell{right:7px;width:calc(100% - 69px)}
/* Gesture surfaces never reveal their backing layer on a simple tap. */
.card:active{transform:translate3d(var(--swipe-x,0px),0,0);filter:brightness(.99)}
.delete-reveal{inset:0;border-radius:24px;background:#ff383c;padding:14px 20px;gap:8px;visibility:hidden;transition:background-color .2s}
.swipe-visible .delete-reveal{visibility:visible}.swipe-armed .delete-reveal{background:#df2125}.delete-icon{width:20px;height:20px;display:grid;place-items:center}.deleting .card{pointer-events:none}
.card{will-change:transform;transition:transform .38s cubic-bezier(.22,1,.36,1)}
.fab{touch-action:none;user-select:none;-webkit-user-select:none}.fab:active{transform:none}.fab-left{right:auto!important;left:max(calc((100vw - 480px)/2 + 36px),36px)}.fab.dragging{transition:none;cursor:grabbing;box-shadow:0 4px 36px -4px #eb74accc}
.balance-row{display:flex;align-items:center;justify-content:center;gap:14px;margin-top:14px;min-width:0}.balance-row .money{margin:0}.balance-edit{background:#f7f7f7}.balance-error:empty{display:none}.balance-error{margin:8px 0 0}.balance-save{padding:8px 14px;min-height:40px;height:40px;flex-shrink:0}.balance-row .inline-amount{margin:0;flex:0 1 auto;width:auto;min-width:0;max-width:calc(100% - 78px);padding:0;min-height:48px;border-bottom:2px solid #0180b7}.inline-amount input{line-height:48px}
input.name-input{border:2px solid transparent;outline:none;box-shadow:none;padding:12px 18px;transition:border-color .2s,background .2s}input.name-input:focus,input.name-input:focus-visible{border-color:#0180b7;outline:none;box-shadow:none;background:#fff}
dialog,dialog:focus,dialog:focus-visible{border:0;outline:none;box-shadow:none}dialog .close:focus,dialog .close:focus-visible{outline:none;border:0;box-shadow:none;background:#ececec}dialog .close{border:0;box-shadow:none}dialog .close:active{transform:none}
body.sheet-open{position:fixed;overflow:hidden;width:100%;overscroll-behavior:none}html:has(body.sheet-open){overflow:hidden;overscroll-behavior:none}dialog{overscroll-behavior:contain;touch-action:pan-y}dialog.closing::backdrop{background:transparent;backdrop-filter:blur(0);transition:background .28s,backdrop-filter .28s}
dialog.spaces-sheet{padding:24px 14px 14px;display:none;height:auto}dialog.spaces-sheet[open]{display:flex;flex-direction:column;gap:40px;overflow:hidden}dialog.spaces-sheet .topbar{width:100%;flex-shrink:0}dialog.spaces-sheet .space-list{margin:0;gap:14px;max-height:calc(100dvh - 220px);overflow-y:auto;overscroll-behavior:contain;width:100%}dialog.spaces-sheet .space-option{height:56px;padding:2px 14px;flex-shrink:0}dialog.spaces-sheet .primary.full{width:100%;min-height:52px;height:52px;margin:0;flex-shrink:0}dialog.spaces-sheet .error:empty{display:none}dialog.spaces-sheet:has(.space-list) .primary{margin-top:-26px}
@media(prefers-reduced-motion:reduce){.card,.row,.search-heading,.search-shell{transition:none!important}}
.spaces-sheet .primary.full{display:flex;align-items:center;justify-content:center;gap:8px;font-size:18px}.space-add-icon{display:grid;place-items:center;width:24px;height:24px}

/* Use the visible device viewport; browser chrome is outside this canvas. */
#app{--page-top:max(24px,env(safe-area-inset-top));--page-bottom:max(24px,env(safe-area-inset-bottom));min-height:100dvh;padding:var(--page-top) 14px var(--page-bottom);display:flex;flex-direction:column}
#app.home{background:linear-gradient(#4fc6e6 0,#f7f7f7 clamp(210px,33dvh,278px),#f7f7f7 100%)}
#app>.space{align-self:flex-start;flex-shrink:0;position:sticky;top:var(--page-top);z-index:3}
#app>.topbar{position:sticky;top:0;z-index:3;background:#fff;flex-shrink:0;padding:0 0 8px;min-height:48px}
.summary{margin-top:clamp(32px,8dvh,80px);flex-shrink:0}
.list-section{margin-top:clamp(32px,8dvh,80px);flex:1;display:flex;flex-direction:column;min-height:0;padding-bottom:114px}
.cards:has(.empty){flex:1}.empty{min-height:0;flex:1;padding:clamp(32px,7dvh,80px) 10px}
.detail-summary{margin-top:clamp(24px,6dvh,50px)}
.actions{margin-top:clamp(24px,5dvh,40px)}
.history{margin-top:clamp(32px,7dvh,60px)}
.entry{margin-top:clamp(24px,6dvh,50px);flex:1;display:flex;flex-direction:column}
.entry .amount-block{margin-top:clamp(24px,5dvh,40px)}
.entry .quick{margin-top:clamp(24px,5dvh,40px)}
.entry .submit-page{margin-top:auto;flex-shrink:0}
.entry .error{margin:14px 0;flex-shrink:0}
.fab,.fab.dragging{bottom:max(24px,env(safe-area-inset-bottom));box-shadow:0 0 40px -4px rgba(3,163,245,.4)}
@media(max-height:650px){.entry .amount-input input{line-height:60px}.entry .quick{gap:8px}.entry .quick button{padding:10px 14px;min-height:40px}}
@media(max-height:650px){.entry{margin-top:24px}.entry .amount-block,.entry .quick{margin-top:24px}.entry .quick{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;gap:8px}.entry .quick button{font-size:13px;padding:10px 4px;white-space:nowrap}}
.list-section:has(.empty){padding-bottom:0}
@media(max-height:700px){.empty{padding:24px 10px}.empty img{width:56px;height:56px}.empty h2{font-size:20px;margin:12px 0 8px}}

/* Give the editable amount a stable width; measuring must never shrink its parent. */
.balance-row .inline-amount{flex:1 1 0;width:0;max-width:none;justify-content:center}
.balance-row:has(.inline-amount){width:100%}.inline-amount input{height:48px;overflow:visible;caret-color:#0180b7}
.person-name{background:transparent;padding:0;font:inherit;overflow-wrap:anywhere}.person-name:active{transform:none}
.topbar h1{min-width:0;flex:1}.person-name-input{display:block;width:100%;min-width:0;font:inherit;text-align:center;border:0;border-bottom:2px solid #0180b7;border-radius:0;background:transparent;padding:4px 0;color:#080808;outline:none;box-shadow:none}.person-name-input:focus-visible{outline:none}
.fab,.fab.dragging{bottom:max(14px,env(safe-area-inset-bottom));right:max(calc((100vw - 480px)/2 + 14px),14px)}
.fab-left{left:max(calc((100vw - 480px)/2 + 14px),14px)}

.balance-row .inline-amount{border:0}.space-name-sheet{padding:24px 14px 14px}.space-name-sheet .topbar{height:48px}.space-name-sheet .error:empty{display:none}.space-name-sheet .primary.full{margin-top:40px;height:52px;min-height:52px;font-size:18px}.space-name-sheet .spacer{width:40px}.spaces-sheet .space-option{padding:8px 14px 8px 8px}.space-option .select-space{min-width:0;overflow-wrap:anywhere;padding:0}.space-option .space-delete{margin-left:4px}.space-delete-copy{margin:40px 0 0;color:#888;text-align:center}

/* Optional context uses the exact card and detail typography from Figma. */
.card{gap:24px;height:100%}.card-person{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.card-copy{display:flex;flex-direction:column;justify-content:center;gap:2px;flex:1;min-width:0;text-align:left}.card-copy .name{display:block;flex:none;line-height:22.4px;max-width:100%}.card-note{display:block;max-width:100%;font-size:12px;line-height:18px;color:#888;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.card>.money{flex-shrink:0;line-height:25.2px;height:25.2px}.row.has-note{height:70.4px}.row.has-note .card{align-items:flex-start}.row.has-note.collapsing{height:0}.settled .card-copy{opacity:0;transition:opacity .25s}
.note-field{margin-top:40px;flex-shrink:0}.entry .field-label{line-height:19.6px}.note-field input::placeholder{color:#888;opacity:1}
.debt-context{display:block;width:100%;margin:14px 0 0;padding:14px;border:0;border-radius:24px;background:#f7f7f7;color:#080808;font-family:inherit;font-size:12px;font-weight:500;line-height:18px;text-align:left;white-space:pre-wrap;overflow-wrap:anywhere;box-shadow:none}.debt-context:active{transform:none;filter:none}.context-empty{color:#888}.detail-summary .actions{margin-top:24px}.note-editor{resize:none;overflow:hidden;outline:none;box-shadow:none;appearance:none;-webkit-appearance:none;caret-color:#080808}.note-editor:focus,.note-editor:focus-visible{border:0;outline:none;box-shadow:none}.person-name-input,.person-name-input:focus,.person-name-input:focus-visible{border:0;padding:0;outline:none;box-shadow:none;caret-color:#080808;line-height:inherit}
@media(max-height:650px){.note-field{margin-top:24px}.entry .quick{margin-top:20px}.entry .amount-block{margin-top:20px}.entry .error{margin:10px 0}}

/* Note actions and editor — updated Figma frames. */
.debt-context{font-size:14px;line-height:19.6px}.detail-summary .actions{margin-top:40px}.add-note{display:block;margin:14px auto 0;padding:0;background:transparent;color:#0180b7;font-size:14px;line-height:19.6px;min-height:20px}
dialog.note-sheet{padding:24px 10px;border-radius:44px}.note-sheet form{display:flex;flex-direction:column;gap:40px}.note-sheet .topbar{flex-shrink:0}.note-sheet textarea{display:block;width:100%;height:150px;min-height:150px;resize:vertical;border:2px solid transparent;border-radius:18px;background:#f7f7f7;padding:12px 18px;font:inherit;font-size:16px;line-height:22.4px;color:#080808;outline:none;box-shadow:none}.note-sheet textarea::placeholder{color:#888;opacity:1}.note-sheet textarea:focus{border-color:#0180b7;outline:none;box-shadow:none}.note-sheet .error:empty{display:none}.note-sheet .error{margin:0}.note-sheet .primary.full{margin:0;height:56px;min-height:56px;font-size:18px;line-height:25.2px}.note-sheet .spacer{width:40px;flex-shrink:0}

.note-editor{font-size:14px;line-height:19.6px}

/* Keep touch scrolling without desktop scrollbar chrome. */
html,body,*{scrollbar-width:none}*::-webkit-scrollbar{display:none;width:0;height:0}

/* Compact mobile screens: preserve room for names alongside balances. */
@media(max-width:350px){
#app{padding-left:12px;padding-right:12px;font-size:14px}
.topbar h1,.person-name,.person-name-input{font-size:18px}
.space{font-size:14px;gap:6px}.space .avatar{font-size:14px;width:29px;height:30px}
.money{font-size:clamp(28px,10vw,36px);line-height:1.2;letter-spacing:-1.2px}.money small{font-size:18px;letter-spacing:-.6px}
.card{gap:10px;padding:12px}.card-person{gap:6px}.card .avatar{width:32px;height:32px;font-size:16px}.card .name{font-size:14px;line-height:19.6px}.card-note{font-size:11px;line-height:16px}.card .money{font-size:14px;line-height:20px;letter-spacing:-.3px}.card .money small{font-size:10px;letter-spacing:0}.card>.money{height:20px;line-height:20px}.row,.row.has-note{height:64px}
.primary,.secondary{font-size:14px;padding:12px 16px;min-height:46px}.actions{gap:10px}.balance-row{gap:8px}.balance-edit{width:34px;height:34px}.debt-context,.note-editor{font-size:13px;line-height:18.2px;padding:12px}.event{padding:12px}.event time,.event p{font-size:12px}.history .money{font-size:16px}.empty{padding:48px 8px;min-height:320px}.empty h2{font-size:22px}.empty p{font-size:14px}.fab{width:58px;height:58px}.fab img{width:40px;height:40px}
}
