/* EvenUp on the web: the phone app's look, at phone width on every screen. One column, centered on a desktop. */

@font-face { font-family: "Instrument Sans"; font-weight: 400 600; font-display: swap; src: url(/static/fonts/sans-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+20B9, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Sans"; font-weight: 400 600; font-display: swap; src: url(/static/fonts/sans-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Instrument Serif"; font-display: swap; src: url(/static/fonts/serif-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Serif"; font-display: swap; src: url(/static/fonts/serif-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }

/* The app's theme (mobile/src/lib/theme.tsx), colour for colour. */
:root {
  color-scheme: dark;
  --bg: #070708; --surface: #111114; --surface-2: #1a1a1e; --surface-3: #26262b; --line: #19191c; --line-2: #27272b;
  --text: #f4f4f2; --muted: #a3a3a8; --dim: #6c6c73; --accent: #e3c79b; --accent-text: #1a1408;
  --ink: #f4f4f2; --ink-text: #0a0a0b; --owe: #ff7b72; --owed: #5fd39b;
  --paper: #f3efe6; --paper-ink: #1d1a16; --paper-2: #6f675b; --rule: #c9bfac; --pos-p: #1d7a4c; --neg-p: #b4432e;
  --serif: "Instrument Serif", Georgia, serif; --sans: "Instrument Sans", system-ui, sans-serif; --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --w: 440px; /* the phone */
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { overflow-x: clip; min-height: 100dvh; max-width: var(--w); margin: 0 auto; background: var(--bg); color: var(--text); font: 400 16px/1.45 var(--sans);
  border-inline: 1px solid var(--line); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
@media (max-width: 441px) { body { border-inline: 0; } }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
button:disabled { cursor: default; opacity: .4; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; } /* headings focused for screen readers, not keyboard targets */
::selection { background: rgb(227 199 155 / .3); }

.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.i.sm { width: 14px; height: 14px; }
.i.lg { width: 22px; height: 22px; }

/* ---------- type ---------- */
.serif, h1, h2, .title-xl { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
h1 { font-size: 48px; line-height: 52px; }
h2 { font-size: 30px; line-height: 36px; }
h3 { font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 28px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small-text { font-size: 13px; line-height: 20px; }
.mono { font-family: var(--mono); }
.num { font-family: var(--serif); font-variant-numeric: tabular-nums; }
.pos { color: var(--owed); } .neg { color: var(--owe); }
.error { color: var(--owe); font-size: 14px; }
.error:empty, .note:empty { display: none; }
.note { color: var(--owed); font-size: 14px; }
.eyebrow { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--accent); }
.eyebrow::before { content: ""; width: 16px; height: 1px; background: currentColor; }
.label { font-size: 14px; color: var(--muted); }

/* ---------- page frame ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 22px; letter-spacing: -0.02em; }
.logo-mark { width: 22px; height: 26px; flex: none; background: var(--ink);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 87.5% 92%, 75% 100%, 62.5% 92%, 50% 100%, 37.5% 92%, 25% 100%, 12.5% 92%, 0 100%); border-radius: 3px 3px 0 0; position: relative; }
.logo-mark::before, .logo-mark::after { content: ""; position: absolute; left: 5px; height: 2px; border-radius: 2px; background: var(--ink-text); }
.logo-mark::before { top: 7px; width: 12px; } .logo-mark::after { top: 12px; width: 7px; }
.page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 16px 20px 40px; animation: fade .3s var(--ease) both; }
.page.with-bar { padding-bottom: 140px; }
.head { display: grid; gap: 12px; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.stack-lg { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* ---------- buttons: pills, white for the main action ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface-2); font-weight: 500; font-size: 15px; white-space: nowrap; transition: transform .15s, background .2s, opacity .2s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.ink { background: var(--ink); color: var(--ink-text); border-color: var(--ink); }
.btn.danger { border-color: var(--owe); color: var(--owe); }
.btn.ghost { background: transparent; }
.btn.small { height: 40px; padding: 0 16px; font-size: 14px; }
.btn.tiny { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }
.link-btn { color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); }
.icon-btn.sm { width: 40px; height: 40px; }

/* ---------- fields ---------- */
.field { width: 100%; height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); outline: none; font-size: 16px; transition: border-color .2s; }
.field:focus { border-color: var(--accent); }
.field::placeholder { color: var(--dim); }
select.field { appearance: none; }
.toggle { appearance: none; width: 44px; height: 26px; flex: none; border-radius: 999px; background: var(--surface-3); position: relative; cursor: pointer; transition: background .2s; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text); transition: transform .2s var(--ease); }
.toggle:checked { background: var(--accent); }
.toggle:checked::after { transform: translateX(18px); background: var(--accent-text); }

/* ---------- surfaces ---------- */
.card { border-radius: 20px; border: 1px solid var(--line); background: var(--surface); padding: 20px; }
.card.danger { border-color: var(--owe); }
.kv { display: flex; justify-content: space-between; gap: 12px; }
.kv > span:first-child { color: var(--muted); }
.kv > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list { border-radius: 20px; border: 1px solid var(--line); background: var(--surface); padding: 6px; list-style: none; }
.list > * + * { border-top: 1px solid var(--line); }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2);
  font: 12px var(--mono); color: var(--muted); white-space: nowrap; }
.tag.live { color: var(--owed); border-color: rgb(95 211 155 / .3); background: rgb(95 211 155 / .08); }
.tag.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--surface-3);
  color: var(--text); font-size: 13px; font-weight: 500; }
.avatar.big { width: 72px; height: 72px; font-size: 26px; }
.round-ic { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--accent); }
.sq-ic { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--surface-2); color: var(--accent); }
.empty { display: grid; justify-items: center; gap: 8px; padding: 32px 24px; border-radius: 20px; border: 1px dashed var(--line-2); text-align: center; }
.empty p { color: var(--muted); font-size: 14px; }
.empty .sq-ic { width: 48px; height: 48px; border-radius: 16px; margin-bottom: 8px; }
.sec-title { display: flex; align-items: baseline; gap: 10px; }
.sec-title .count { font: 13px var(--mono); color: var(--muted); }
.sec-title .count:empty { display: none; }

/* list rows: groups and tabs on Home, menu rows on Profile */
.item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 14px; border-radius: 16px; text-align: left; transition: background .2s; }
.item:hover { background: var(--surface-2); }
.item.closed { opacity: .6; }
.item .grow { min-width: 0; }
.item .name { font-family: var(--serif); font-size: 20px; line-height: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .sub { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.item .sub > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .stand { display: grid; justify-items: end; gap: 2px; text-align: right; }
.item .stand small { font-size: 12px; color: var(--muted); }
.item .stand b { font-family: var(--serif); font-weight: 400; font-size: 20px; }
.item .stand b.settled { font-size: 16px; color: var(--muted); }
.menu-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px; border-radius: 16px; text-align: left; }
.menu-row:hover { background: var(--surface-2); }
.menu-row b { display: block; font-weight: 500; }
.menu-row span span { display: block; font-size: 13px; color: var(--muted); }
.menu-row > .i:last-child { color: var(--dim); }

/* ---------- bottom bar with the floating + ---------- */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, var(--w)); z-index: 20;
  display: grid; grid-template-columns: 1fr 96px 1fr; height: calc(72px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: #0d0d0f; border-top: 1px solid var(--line); }
.tabbar a { display: grid; justify-items: center; align-content: center; gap: 4px; font-size: 13px; color: var(--muted); }
.tabbar a[aria-current] { color: var(--accent); }
.tabbar a .i { width: 22px; height: 22px; }
.plus-ring { position: absolute; left: 50%; top: -39px; transform: translateX(-50%); width: 74px; height: 74px; border-radius: 50%; background: #0d0d0f; display: grid; place-items: center; }
.plus { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-text);
  background: linear-gradient(180deg, #ffffff, #e4e1d8); box-shadow: 0 0 0 1px rgb(227 199 155 / .55), 0 8px 28px rgb(227 199 155 / .25); transition: transform .2s var(--ease); }
.plus:active { transform: scale(.92); }
.plus .i { width: 26px; height: 26px; stroke-width: 1.8; }

/* ---------- sheets: slide up from the bottom, phone width ---------- */
dialog.sheet { margin: auto auto 0; width: min(100%, var(--w)); max-width: var(--w); max-height: 90dvh; border: 1px solid var(--line-2); border-bottom: 0;
  border-radius: 28px 28px 0 0; background: var(--surface); color: var(--text); padding: 0 0 env(safe-area-inset-bottom); overflow: hidden; }
dialog.sheet[open] { display: flex; flex-direction: column; animation: sheet-up .35s var(--ease); }
dialog.sheet::backdrop { background: rgb(0 0 0 / .65); animation: fade-in .2s; }
dialog.sheet.full { margin: 0 auto; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; border-inline: 1px solid var(--line); }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
.grip { width: 40px; height: 4px; margin: 10px auto 0; border-radius: 999px; background: var(--surface-3); flex: none; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 20px; flex: none; }
.sheet-head h2 { flex: 1; font-size: 28px; line-height: 32px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body { display: grid; gap: 16px; align-content: start; padding: 12px 20px 20px; overflow-y: auto; }
.sheet-foot { display: flex; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); flex: none; }
.sheet-foot > * { flex: 1; }
.sheet-form { display: contents; }
.sheet.full .sheet-head { padding: calc(16px + env(safe-area-inset-top)) 20px 4px; }
dialog.confirm { margin: auto; width: min(calc(100% - 48px), 400px); border-radius: 24px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); padding: 24px; }
dialog.confirm[open] { animation: pop .26s var(--ease); }
dialog.confirm::backdrop { background: rgb(0 0 0 / .65); }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(8px); } }
.choice { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); text-align: left; }
.choice b, .choice > .grow { font-weight: 500; }
.choice .grow span { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.menu { display: grid; gap: 10px; }

.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); width: min(calc(100% - 32px), calc(var(--w) - 32px)); z-index: 30;
  display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 18px; background: var(--ink); color: var(--ink-text); font-weight: 500; animation: fade .25s var(--ease); }
.toast span { flex: 1; }
.toast button { font-weight: 600; text-decoration: underline; }

/* ---------- paper: the bill and the new-tab slip ---------- */
/* The torn edge is cut into the paper itself with a mask (no strip glued on, so no seam line at any zoom). */
.paper { --tooth: 10px; color: var(--paper-ink); background: linear-gradient(#f6f2ea, var(--paper) 30%, #ece6da); border-radius: 4px 4px 0 0;
  padding: 24px 22px 22px; font-family: var(--mono); position: relative;
  mask: linear-gradient(#000 0 0) top / 100% calc(100% - var(--tooth) / 2 + 1px) no-repeat,
    conic-gradient(from -45deg at bottom, #000 90deg, #0000 0) bottom / var(--tooth) calc(var(--tooth) / 2) repeat-x; }
.paper .rcpt-h { text-align: center; font-size: 11px; letter-spacing: 2px; color: var(--paper-2); padding-bottom: 16px; border-bottom: 1px dashed var(--rule); }
.paper hr { border: 0; border-top: 1px dashed var(--rule); margin: 14px 0; }
.paper .l { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 4px 0; }
.paper .l span:first-child { color: var(--paper-2); }
.paper .l.t { font-weight: 600; font-size: 14px; }
.barcode { height: 34px; margin: 16px 0 8px; background: repeating-linear-gradient(90deg, var(--paper-ink) 0 2px, transparent 2px 4px, var(--paper-ink) 4px 5px, transparent 5px 8px, var(--paper-ink) 8px 11px, transparent 11px 13px); opacity: .85; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- small pieces ---------- */
.w5 { font-weight: 500; }
#upi-prompt .grow > * { display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label > span, .chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 4px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 14px; color: var(--muted); transition: border-color .2s, color .2s; }
.chips label > span .avatar { width: 30px; height: 30px; font-size: 11px; }
.chips input:checked + span { border-color: var(--accent); color: var(--text); }
.chips input:focus-visible + span { outline: 2px solid var(--accent); }

/* landing, signed out */
.hero { display: grid; gap: 16px; padding-top: 8px; }
.hero h1 { font-size: clamp(40px, 13vw, 52px); line-height: 1.04; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.hero-cta .btn { flex: 1 1 130px; }
.steps { list-style: none; display: grid; gap: 10px; margin-top: 12px; }
.steps li { display: grid; grid-template-columns: 36px 1fr; column-gap: 8px; padding: 16px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); }
.steps li .mono { grid-row: span 2; color: var(--accent); font-size: 13px; padding-top: 3px; }
.steps li b { font-family: var(--serif); font-weight: 400; font-size: 20px; }
.steps li span:last-child { color: var(--muted); font-size: 14px; }

/* new tab */
.hp { position: absolute; left: -9999px; }
.opts { display: grid; padding: 4px 20px; }
.opt { display: flex; align-items: center; gap: 14px; padding: 16px 0; cursor: pointer; }
.opt + .opt, .opt-body + .opt { border-top: 1px solid var(--line); }
.opt .grow span { display: block; font-size: 13px; color: var(--muted); }
.opt-body { display: grid; gap: 10px; padding: 0 0 16px; animation: fade .3s var(--ease); }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper output { min-width: 28px; text-align: center; font-size: 24px; }
.done-ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; color: var(--owed); background: rgb(95 211 155 / .12); border: 1px solid rgb(95 211 155 / .3); }
.linkbox { padding: 16px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--surface); font-size: 14px; word-break: break-all; }
.two > * { flex: 1; }
.slip { position: relative; padding-bottom: 12px; }
.seats { display: flex; flex-wrap: wrap; gap: 6px; }
.seat { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1.5px dashed var(--rule); font-size: 10px; color: var(--paper-2); animation: pop .25s var(--ease) both; }
.seat.you { border: 0; background: var(--paper-ink); color: var(--paper); font-weight: 600; }
.seat.more { border-style: solid; width: auto; padding: 0 8px; border-radius: 999px; }
.stamp { position: absolute; right: 18px; top: 150px; padding: 4px 12px; border: 2px solid var(--neg-p); border-radius: 6px; color: var(--neg-p);
  font: 22px var(--mono); letter-spacing: 4px; transform: rotate(-14deg); opacity: 0; pointer-events: none; }
.slip.opened .stamp { animation: stamp .45s var(--ease) both; }
@keyframes stamp { from { opacity: 0; transform: rotate(-14deg) scale(1.8); } to { opacity: 1; transform: rotate(-14deg) scale(1); } }

/* profile */
.who { display: grid; justify-items: center; gap: 10px; padding: 28px 20px; text-align: center; }
.big-ic { width: 56px; height: 56px; }
.perks { list-style: none; display: grid; gap: 14px; padding-top: 20px; border-top: 1px solid var(--line); }
.perks li { display: flex; gap: 12px; }
.perks li > .i { color: var(--accent); margin-top: 4px; }
.perks li span span { display: block; font-size: 13px; color: var(--muted); }

/* friends + activity */
.person { display: flex; align-items: center; gap: 12px; padding: 12px; }
.person .grow > * { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person strong { font-weight: 500; }
.person .grow span { font-size: 13px; color: var(--muted); }
.person .acts { display: flex; gap: 6px; }
.pad { padding: 12px; }
.day { font-size: 13px; color: var(--muted); padding: 20px 4px 8px; }
.day:first-child { padding-top: 0; }
.feed-row { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.feed-ic { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--surface-2); color: var(--accent); }
.feed-row .grow > * { display: block; }
.feed-row .line { font-size: 15px; }
.feed-row .line b { font-weight: 500; }
.feed-row .where { font-size: 13px; color: var(--muted); }
.feed-row > .i:last-child { color: var(--dim); }
.tabbar .plus { color: var(--ink-text); }

/* rows to pick from: who you are in a tab, people for a group */
.pick { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; padding: 12px; text-align: left; border-radius: 14px; }
.pick:hover { background: var(--surface-2); }
.pick.current { background: rgb(227 199 155 / .08); }
.pick .grow > span { display: block; font-size: 13px; color: var(--muted); }
.pick > .i:last-child { color: var(--dim); }
.pick.current > .i:last-child { color: var(--accent); }
.pick .avatar .i { width: 16px; height: 16px; }
.chip { color: var(--text); padding-right: 4px; }
.chip .icon-btn { width: 30px; height: 30px; border: 0; background: transparent; }
.pad { padding: 12px; }
