:root {
  --bg: #F6F1E7;
  --bg-dot: rgba(27, 19, 64, 0.07);
  --card: #FFFFFF;
  --ink: #1B1340;
  --ink-2: #5B5577;
  --ink-3: #8A849E;
  --line: #1B1340;
  --lime: #C8F560;
  --lime-ink: #1B1340;
  --sun: #FFD93D;
  --coral: #FF6B6B;
  --coral-soft: #FFE1DC;
  --mint: #1FA971;
  --mint-soft: #DDF6E8;
  --sky: #4D96FF;
  --sky-soft: #E1EDFF;
  --lilac: #B69CFF;
  --shadow: 4px 4px 0 var(--line);
  --shadow-sm: 2px 2px 0 var(--line);
  --radius: 20px;
  --radius-sm: 14px;
  --border: 2.5px solid var(--line);
  --head: "Bricolage Grotesque", "DM Sans", system-ui, sans-serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #120C2E; --bg-dot: rgba(255, 255, 255, 0.06); --card: #1E1747; --ink: #F6F1E7; --ink-2: #C9C3DE; --ink-3: #928BAE;
    --line: #06031A; --coral-soft: #4A1F2E; --mint-soft: #143A33; --sky-soft: #172B55; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #120C2E; --bg-dot: rgba(255, 255, 255, 0.06); --card: #1E1747; --ink: #F6F1E7; --ink-2: #C9C3DE; --ink-3: #928BAE;
  --line: #06031A; --coral-soft: #4A1F2E; --mint-soft: #143A33; --sky-soft: #172B55; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  background-image: radial-gradient(var(--bg-dot) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--head); margin: 0; letter-spacing: -0.02em; line-height: 1.1; }
.hidden { display: none !important; }
.muted { color: var(--ink-2); }
.tiny { font-size: 12.5px; color: var(--ink-3); }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.money { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.pos { color: var(--mint); }
.neg { color: var(--coral); }

#app { max-width: 560px; margin: 0 auto; padding: 16px 16px 120px; position: relative; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-name { font-family: var(--head); font-weight: 800; font-size: 22px; letter-spacing: -0.03em; }
.brand-name span { background: var(--lime); color: var(--lime-ink); padding: 0 6px; border-radius: 8px; border: 2px solid var(--line); margin-left: 2px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 14px; border: var(--border); background: var(--card); box-shadow: var(--shadow-sm);
  display: grid; place-items: center; cursor: pointer; font-size: 20px; transition: transform .12s, box-shadow .12s;
}
.icon-btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--line); }
.avatar-btn { padding: 0; overflow: hidden; }

/* ---------- cards & buttons ---------- */
.card { background: var(--card); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card.flat { box-shadow: none; }
.card + .card { margin-top: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: var(--border); border-radius: 16px;
  padding: 13px 18px; font-weight: 800; font-size: 16px; cursor: pointer; background: var(--card); color: var(--ink);
  box-shadow: var(--shadow-sm); transition: transform .12s ease, box-shadow .12s ease, background .2s; text-decoration: none;
  -webkit-tap-highlight-color: transparent; user-select: none; min-height: 50px;
}
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--line); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--lime); color: var(--lime-ink); }
.btn.ink { background: var(--ink); color: var(--bg); }
.btn.coral { background: var(--coral); color: #fff; }
.btn.sky { background: var(--sky); color: #fff; }
.btn.sun { background: var(--sun); color: #1B1340; }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; text-decoration: underline; text-underline-offset: 3px; min-height: 40px; padding: 8px 10px; }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 12px; font-size: 14px; border-radius: 12px; min-height: 38px; }
.btn.lg { padding: 16px 22px; font-size: 18px; min-height: 58px; }

/* ---------- inputs ---------- */
.field { display: block; }
.field > span { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; border: var(--border); border-radius: var(--radius-sm); background: var(--card); padding: 13px 14px;
  font-size: 16px; outline: none; transition: box-shadow .15s; min-height: 50px;
}
.input:focus { box-shadow: 0 0 0 4px var(--lime); }
.input.big { font-size: 22px; font-weight: 700; }
.amount-wrap { position: relative; }
.amount-wrap .cur { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-family: var(--head); font-size: 34px; font-weight: 800; color: var(--ink-3); }
.amount-input { font-family: var(--head); font-size: 44px; font-weight: 800; padding-left: 52px; height: 84px; letter-spacing: -0.02em; }
.code-boxes { display: flex; gap: 8px; justify-content: center; }
.code-boxes input { width: 46px; height: 58px; text-align: center; font-size: 26px; font-weight: 800; font-family: var(--head); padding: 0; }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--line); border-radius: 999px; padding: 6px 12px 6px 6px;
  background: var(--card); cursor: pointer; font-weight: 700; font-size: 14px; transition: transform .15s cubic-bezier(.3,1.6,.5,1), background .15s;
  user-select: none; -webkit-tap-highlight-color: transparent; min-height: 40px;
}
.chip.plain { padding: 6px 14px; }
.chip.on { background: var(--lime); color: var(--lime-ink); transform: scale(1.04); }
.chip.on .face { box-shadow: 0 0 0 2px var(--line); }
.chip:active { transform: scale(.94); }
.chip .count { background: var(--ink); color: var(--bg); border-radius: 999px; padding: 0 7px; font-size: 12px; margin-left: 2px; }
.face {
  width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 17px; flex: none;
  border: 2px solid var(--line); line-height: 1;
}
.face.lg { width: 48px; height: 48px; font-size: 26px; }
.face.xl { width: 72px; height: 72px; font-size: 40px; }
.faces { display: flex; }
.faces .face { margin-left: -8px; }
.faces .face:first-child { margin-left: 0; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 800; padding: 3px 8px; border-radius: 999px; border: 2px solid var(--line); text-transform: uppercase; letter-spacing: .04em; }
.badge.lime { background: var(--lime); color: var(--lime-ink); }
.badge.sun { background: var(--sun); color: #1B1340; }
.badge.coral { background: var(--coral); color: #fff; }
.badge.sky { background: var(--sky); color: #fff; }

/* ---------- segmented / tabs ---------- */
.seg { display: flex; background: var(--card); border: var(--border); border-radius: 16px; padding: 4px; gap: 4px; box-shadow: var(--shadow-sm); }
.seg button { flex: 1; border: none; background: transparent; border-radius: 11px; padding: 10px 6px; font-weight: 800; cursor: pointer; font-size: 14.5px; color: var(--ink-2); transition: background .2s, color .2s; }
.seg button.on { background: var(--ink); color: var(--bg); }

/* ---------- hero / login ---------- */
.hero { text-align: center; padding: 10px 0 6px; }
.hero h1 { font-size: clamp(38px, 11vw, 58px); font-weight: 800; letter-spacing: -0.045em; margin: 14px 0 10px; }
.hero h1 .hl { background: var(--lime); color: var(--lime-ink); padding: 0 8px; border-radius: 12px; border: var(--border); display: inline-block; transform: rotate(-2deg); }
.hero p { font-size: 17.5px; color: var(--ink-2); max-width: 420px; margin: 0 auto; }
.perks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0; }
.perk { background: var(--card); border: var(--border); border-radius: 16px; padding: 12px 8px; text-align: center; font-size: 13px; font-weight: 700; box-shadow: var(--shadow-sm); }
.perk b { display: block; font-size: 24px; margin-bottom: 4px; }
.vs-strip { font-size: 13.5px; color: var(--ink-2); text-align: center; margin-top: 14px; }

/* ---------- Steven ---------- */
.steven { display: inline-block; width: 96px; height: 96px; }
.steven svg { width: 100%; height: 100%; overflow: visible; }
.steven.sm { width: 44px; height: 44px; }
.steven.md { width: 64px; height: 64px; }
.steven.xl { width: 150px; height: 150px; }
.steven .bob { animation: bob 2.6s ease-in-out infinite; transform-origin: 50% 90%; }
.steven .eye { animation: blink 4.2s infinite; transform-origin: center; transform-box: fill-box; }
.steven.spin .coin { animation: flip 1.1s cubic-bezier(.5,0,.5,1) infinite; transform-origin: 50% 50%; transform-box: fill-box; }
.steven.wiggle .bob { animation: wiggle .6s ease-in-out 2; }
@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-6px) } }
@keyframes blink { 0%,92%,100% { transform: scaleY(1) } 95% { transform: scaleY(.1) } }
@keyframes flip { 0% { transform: scaleX(1) } 50% { transform: scaleX(.08) } 100% { transform: scaleX(1) } }
@keyframes wiggle { 0%,100% { transform: rotate(0) } 25% { transform: rotate(-10deg) } 75% { transform: rotate(10deg) } }

.bubble {
  position: relative; background: var(--card); border: var(--border); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow-sm);
  font-weight: 600; animation: pop .45s cubic-bezier(.3,1.6,.5,1) both;
}
.bubble.lime { background: var(--lime); color: var(--lime-ink); }
.bubble.sun { background: var(--sun); color: #1B1340; }
.say { display: flex; gap: 10px; align-items: flex-end; margin: 10px 0; }
.say .steven { flex: none; }
.say.me { justify-content: flex-end; }
.say.me .bubble { background: var(--ink); color: var(--bg); }

/* ---------- home ---------- */
.hello { font-family: var(--head); font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin: 4px 0 14px; }
.total-card { background: #1B1340; color: #F6F1E7; border: var(--border); border-radius: 24px; padding: 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.total-card .label { font-weight: 700; opacity: .8; font-size: 14px; }
.total-card .big { font-family: var(--head); font-size: 46px; font-weight: 800; letter-spacing: -0.03em; margin: 2px 0 4px; }
.total-card .big.pos { color: var(--lime); }
.total-card .big.neg { color: #FF9C9C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .total-card { background: #2A1F66; } }
:root[data-theme="dark"] .total-card { background: #2A1F66; }
.total-card .deco { position: absolute; right: -18px; bottom: -18px; opacity: .95; }
.group-card { display: flex; align-items: center; gap: 14px; cursor: pointer; transition: transform .15s; text-decoration: none; animation: rise .5s cubic-bezier(.2,.9,.3,1.2) both; }
.group-card:hover { transform: translate(-1px, -1px); }
.group-card:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--line); }
.group-emoji { width: 58px; height: 58px; border-radius: 16px; border: var(--border); display: grid; place-items: center; font-size: 30px; flex: none; }
.group-card h3 { font-size: 19px; }
.bal-pill { font-weight: 800; font-size: 14px; text-align: right; white-space: nowrap; }
.bal-pill small { display: block; font-weight: 600; font-size: 11.5px; color: var(--ink-3); }
.section-title { display: flex; justify-content: space-between; align-items: center; margin: 26px 0 12px; }
.section-title h2 { font-size: 21px; }
.empty { text-align: center; padding: 26px 16px; }
.empty h3 { font-size: 22px; margin: 10px 0 6px; }

/* ---------- toolbelt promo ---------- */
.tb-card {
  background: linear-gradient(135deg, #2A1F66 0%, #1B1340 60%); color: #F6F1E7; border: var(--border); border-radius: 22px; padding: 18px;
  box-shadow: var(--shadow); position: relative; overflow: hidden; margin-top: 22px;
}
.tb-card h3 { font-size: 20px; margin-bottom: 6px; color: #fff; padding-right: 34px; }
.tb-card p { margin: 0 0 12px; color: #D9D3F0; font-size: 14.5px; }
.tb-card .btn { background: var(--lime); color: #1B1340; }
.tb-card .spark { position: absolute; right: 14px; top: 12px; font-size: 26px; animation: twinkle 2.4s ease-in-out infinite; }
.tb-footer { text-align: center; font-size: 13px; color: var(--ink-3); margin-top: 26px; }
.tb-footer a { font-weight: 800; color: var(--ink); text-decoration: none; border-bottom: 2px solid var(--lime); }
@keyframes twinkle { 0%,100% { transform: scale(1) rotate(0); opacity: 1 } 50% { transform: scale(1.25) rotate(20deg); opacity: .7 } }

/* ---------- group ---------- */
.group-head { text-align: left; }
.group-head .title-row { display: flex; align-items: center; gap: 12px; }
.group-head h1 { font-size: 28px; }
.mybal { margin: 16px 0 4px; }
.mybal .big { font-family: var(--head); font-size: 40px; font-weight: 800; letter-spacing: -0.03em; }
.action-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; margin-top: 14px; }
.action-row .btn { flex-direction: column; gap: 2px; padding: 12px 8px; font-size: 14px; line-height: 1.15; text-align: center; }
.action-row .btn .ico { font-size: 24px; }
.tabs-wrap { margin: 20px 0 14px; position: sticky; top: 8px; z-index: 5; }

.feed-day { font-weight: 800; font-size: 13px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin: 18px 4px 8px; }
.exp { display: flex; gap: 12px; align-items: flex-start; padding: 14px; cursor: pointer; animation: rise .45s cubic-bezier(.2,.9,.3,1.2) both; }
.exp + .exp { margin-top: 10px; }
.cat-ico { width: 46px; height: 46px; border-radius: 14px; border: 2px solid var(--line); display: grid; place-items: center; font-size: 23px; flex: none; background: var(--sun); }
.exp h4 { font-size: 16.5px; font-family: var(--body); font-weight: 800; letter-spacing: 0; }
.exp .sub { font-size: 13px; color: var(--ink-2); }
.exp .amt { text-align: right; font-weight: 800; white-space: nowrap; }
.exp .amt small { display: block; font-size: 12px; font-weight: 700; }
.quip { font-size: 13.5px; margin-top: 7px; padding: 7px 10px; border-radius: 12px; background: var(--bg); border: 2px dashed var(--ink-3); font-weight: 600; }
.quip.roast { border-color: var(--coral); }
.quip.praise { border-color: var(--mint); }
.log-line { font-size: 13px; color: var(--ink-3); text-align: center; margin: 10px 0; }
.settle-line { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }

.xfer { display: flex; align-items: center; gap: 10px; padding: 14px; animation: rise .45s cubic-bezier(.2,.9,.3,1.2) both; }
.xfer + .xfer { margin-top: 10px; }
.xfer .arrow { font-weight: 800; color: var(--ink-3); }
.xfer .amt { font-family: var(--head); font-weight: 800; font-size: 20px; }
.switch { position: relative; width: 52px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--bg); border: 2px solid var(--line); border-radius: 999px; transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: var(--ink); border-radius: 50%; transition: .25s cubic-bezier(.3,1.6,.5,1); }
.switch input:checked + span { background: var(--lime); }
.switch input:checked + span::after { transform: translateX(22px); }
.net-bars .nb { display: grid; grid-template-columns: 110px 1fr 90px; align-items: center; gap: 8px; margin: 8px 0; font-size: 14px; font-weight: 700; }
.nb .track { height: 14px; position: relative; }
.nb .track::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: var(--ink-3); }
.nb .fill { position: absolute; top: 0; height: 14px; border: 2px solid var(--line); border-radius: 6px; transition: width .9s cubic-bezier(.2,.9,.3,1); }
.nb .fill.pos { left: 50%; background: var(--mint); }
.nb .fill.neg { right: 50%; background: var(--coral); }
.stamp {
  display: inline-block; font-family: var(--head); font-weight: 800; font-size: 34px; color: var(--mint); border: 4px solid var(--mint); border-radius: 12px;
  padding: 4px 16px; transform: rotate(-8deg); animation: stamp .6s cubic-bezier(.3,1.8,.5,1) both; letter-spacing: .04em; background: var(--mint-soft);
}
@keyframes stamp { 0% { transform: rotate(-8deg) scale(3); opacity: 0 } 60% { opacity: 1 } 100% { transform: rotate(-8deg) scale(1) } }

.person { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 2px dashed var(--bg-dot); }
.person:last-child { border-bottom: none; }
.person-tap { width: 100%; background: none; border: none; border-bottom: 2px dashed var(--bg-dot); text-align: left; font: inherit; color: inherit; cursor: pointer; border-radius: 12px; transition: background .15s; }
.person-tap:last-child { border-bottom: none; }
.person-tap:hover, .person-tap:focus-visible { background: var(--sky-soft); outline: none; }
.person-go { font-weight: 800; color: var(--ink-2); white-space: nowrap; }

/* ---------- sheets ---------- */
.scrim { position: fixed; inset: 0; background: rgba(12, 8, 32, .55); z-index: 40; animation: fade .2s both; backdrop-filter: blur(2px); }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 560px; max-height: 94vh; overflow-y: auto;
  background: var(--bg); border: var(--border); border-bottom: none; border-radius: 26px 26px 0 0; z-index: 41; padding: 10px 18px 28px;
  animation: slideup .38s cubic-bezier(.2,.9,.3,1.05) both; overscroll-behavior: contain;
}
.sheet.closing { animation: slidedown .25s ease-in both; }
.sheet .grab { width: 48px; height: 5px; border-radius: 3px; background: var(--ink-3); margin: 4px auto 12px; opacity: .6; }
.sheet h2 { font-size: 24px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
@keyframes slideup { from { transform: translate(-50%, 100%) } to { transform: translate(-50%, 0) } }
@keyframes slidedown { to { transform: translate(-50%, 100%) } }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0 } 100% { transform: scale(1); opacity: 1 } }
@keyframes toastIn { 0% { transform: translateX(-50%) scale(.6); opacity: 0 } 100% { transform: translateX(-50%) scale(1); opacity: 1 } }
.toast { animation-name: toastIn !important; }
@keyframes rise { from { transform: translateY(14px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ---------- wait overlay (Toolbelt facts) ---------- */
.wait { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(12, 8, 32, .78); animation: fade .25s both; backdrop-filter: blur(4px); }
.wait-card { width: 100%; max-width: 440px; background: var(--card); border: var(--border); border-radius: 26px; box-shadow: 6px 6px 0 var(--line); padding: 22px; text-align: center; animation: pop .4s cubic-bezier(.3,1.6,.5,1) both; }
.wait-title { font-family: var(--head); font-weight: 800; font-size: 22px; margin: 8px 0 4px; }
.wait-step { font-size: 14.5px; color: var(--ink-2); min-height: 22px; transition: opacity .3s; }
.progress { height: 14px; border: 2px solid var(--line); border-radius: 999px; background: var(--bg); overflow: hidden; margin: 14px 0 16px; }
.progress > div { height: 100%; background: repeating-linear-gradient(-45deg, var(--lime) 0 12px, #B4E24A 12px 24px); width: 0; transition: width .5s ease; animation: stripes 1s linear infinite; background-size: 34px 34px; }
@keyframes stripes { to { background-position: 34px 0 } }
.fact { text-align: left; background: #1B1340; color: #F6F1E7; border-radius: 18px; padding: 14px 16px; border: 2px solid var(--line); position: relative; min-height: 132px; }
.fact .k { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--lime); }
.fact h4 { font-family: var(--head); font-size: 18px; margin: 4px 0 4px; color: #fff; }
.fact p { margin: 0 0 10px; font-size: 14px; color: #D9D3F0; }
.fact a { color: #1B1340; background: var(--lime); padding: 6px 12px; border-radius: 10px; font-weight: 800; font-size: 13.5px; text-decoration: none; display: inline-block; border: 2px solid #06031A; }
.fact.swap { animation: factswap .5s both; }
@keyframes factswap { 0% { opacity: 0; transform: translateY(10px) rotate(-1deg) } 100% { opacity: 1; transform: none } }
.fact-dots { display: flex; gap: 5px; justify-content: center; margin-top: 10px; }
.fact-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); opacity: .4; transition: .3s; }
.fact-dots i.on { opacity: 1; background: var(--ink); width: 18px; border-radius: 4px; }

.archived-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding: 12px 14px; border-radius: 16px; background: var(--sky-soft); border: 2px dashed var(--line); }
.archived-bar > .grow { flex: 1 1 100%; }
.demo-bar { background: var(--sky-soft); border-style: dashed; margin-bottom: 14px; }
.danger-zone { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-top: 6px; border-radius: 14px; border: 2px dashed var(--coral); background: var(--coral-soft); }
.seg.readonly button { cursor: default; opacity: .55; }
.seg.readonly button.on { opacity: 1; }
.archived-list { margin-top: 14px; }
.archived-list > summary { cursor: pointer; font-weight: 800; color: var(--ink-2); padding: 8px 2px; list-style: none; }
.archived-list > summary::-webkit-details-marker { display: none; }
.archived-list > summary::after { content: " ▾"; }
.group-card.is-archived { opacity: .72; filter: saturate(.6); }
.alert-card { background: var(--coral-soft); margin-bottom: 12px; animation: rise .4s both; }
.alert-card .k { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 2px; }

/* ---------- wait overlay: success + acknowledge ---------- */
.progress.done > div { animation: none; background: var(--lime); }
.done-burst { position: relative; width: 150px; height: 150px; margin: 0 auto; animation: burstIn .6s cubic-bezier(.3,1.7,.5,1) both; }
.done-burst .steven.celebrate .bob { animation: hop .9s cubic-bezier(.3,1.6,.5,1) 2, bob 2.6s ease-in-out 1.8s infinite; }
.done-burst .rays { position: absolute; inset: -34px; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(200,245,96,.55) 0 10deg, transparent 10deg 30deg); animation: raySpin 9s linear infinite, rayIn .6s ease-out both; z-index: 0; -webkit-mask: radial-gradient(circle, #000 35%, transparent 70%); mask: radial-gradient(circle, #000 35%, transparent 70%); }
.done-burst .steven { position: relative; z-index: 1; }
.done-burst .check { position: absolute; right: -6px; bottom: 4px; width: 50px; height: 50px; z-index: 2; background: #1FA971; border-radius: 50%; border: 3px solid var(--line); box-shadow: 3px 3px 0 var(--line); animation: pop .45s .25s cubic-bezier(.3,1.8,.5,1) both; }
.done-burst .check svg { width: 100%; height: 100%; }
.done-burst .check circle { fill: none; stroke: none; }
.done-burst .check path { fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .45s .55s ease-out forwards; }
.wait-title.pop-in { animation: pop .45s cubic-bezier(.3,1.7,.5,1) both; }
.ack-btn { margin-top: 16px; animation: rise .4s .5s both, glow 1.8s 1s ease-in-out infinite; }
.wait-card.leaving { animation: cardOut .38s cubic-bezier(.5,-0.3,.7,1) forwards; }
.wait.leaving { animation: fadeOut .38s ease forwards; }
@keyframes burstIn { 0% { transform: scale(.3) rotate(-20deg); opacity: 0 } 100% { transform: none; opacity: 1 } }
@keyframes hop { 0%,100% { transform: translateY(0) } 40% { transform: translateY(-22px) rotate(-6deg) } 70% { transform: translateY(2px) scale(1.05, .95) } }
@keyframes raySpin { to { transform: rotate(360deg) } }
@keyframes rayIn { from { opacity: 0; transform: scale(.4) } }
@keyframes draw { to { stroke-dashoffset: 0 } }
@keyframes glow { 0%,100% { box-shadow: 4px 4px 0 var(--line), 0 0 0 0 rgba(200,245,96,.7) } 50% { box-shadow: 4px 4px 0 var(--line), 0 0 0 10px rgba(200,245,96,0) } }
@keyframes cardOut { 0% { transform: none } 30% { transform: scale(1.04) } 100% { transform: scale(.7) translateY(30px); opacity: 0 } }
@keyframes fadeOut { to { opacity: 0 } }

/* ---------- receipt scan ---------- */
.scan-stage { position: relative; border: var(--border); border-radius: 18px; overflow: hidden; background: #000; max-height: 280px; margin-bottom: 14px; }
.scan-stage img { width: 100%; display: block; opacity: .9; object-fit: cover; max-height: 280px; }
.scan-stage .laser { position: absolute; left: 0; right: 0; height: 4px; background: var(--lime); box-shadow: 0 0 18px 6px rgba(200, 245, 96, .7); animation: laser 1.8s ease-in-out infinite; }
.scan-stage .glow { position: absolute; inset: 0; background: linear-gradient(transparent, rgba(200,245,96,.18), transparent); background-size: 100% 60px; animation: sweep 1.8s ease-in-out infinite; }
@keyframes laser { 0%,100% { top: 4% } 50% { top: 92% } }
@keyframes sweep { 0%,100% { background-position: 0 0 } 50% { background-position: 0 100% } }
.drop {
  border: 3px dashed var(--line); border-radius: 22px; padding: 26px 16px; text-align: center; cursor: pointer; background: var(--card);
  transition: transform .15s, background .2s; display: block;
}
.drop:hover { transform: rotate(-.5deg) scale(1.01); background: var(--mint-soft); }
.drop .big-ico { font-size: 54px; display: block; margin-bottom: 4px; animation: bob 2.4s ease-in-out infinite; }
.item-row { display: grid; grid-template-columns: 1fr 96px 34px; gap: 8px; align-items: center; margin: 8px 0; }
.item-row .input { padding: 10px 12px; min-height: 44px; font-size: 15px; }
.item-row .unsure { box-shadow: 0 0 0 3px var(--sun); }
.x-btn { width: 34px; height: 34px; border-radius: 10px; border: 2px solid var(--line); background: var(--card); cursor: pointer; font-weight: 800; }
.recon { padding: 12px 14px; border-radius: 16px; border: var(--border); font-weight: 700; display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.recon.ok { background: var(--mint-soft); }
.recon.bad { background: var(--coral-soft); }
.claim-item { padding: 12px 14px; }
.claim-item + .claim-item { margin-top: 10px; }
.claim-item .top { display: flex; justify-content: space-between; gap: 8px; font-weight: 800; margin-bottom: 8px; }
.claim-item.unclaimed { border-style: dashed; }
.claim-item.mine { background: var(--mint-soft); }
.stepper { display: inline-flex; align-items: center; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; }
.stepper button { width: 30px; height: 30px; border: none; background: var(--card); cursor: pointer; font-weight: 800; }
.stepper span { min-width: 26px; text-align: center; font-weight: 800; }
.split-preview .line { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 2px dashed var(--bg-dot); }
.split-preview .line:last-child { border-bottom: none; }

/* ---------- toast / verdict ---------- */
.verdict { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 70; width: calc(100% - 32px); max-width: 520px; animation: verdictIn .55s cubic-bezier(.3,1.5,.5,1) both; }
.verdict.out { animation: verdictOut .35s ease-in both; }
.verdict .card { display: flex; gap: 12px; align-items: center; padding: 14px; }
.verdict .tag { font-family: var(--head); font-weight: 800; font-size: 17px; }
@keyframes verdictIn { from { transform: translate(-50%, 140%) rotate(4deg) } to { transform: translate(-50%, 0) rotate(0) } }
@keyframes verdictOut { to { transform: translate(-50%, 160%); opacity: 0 } }
.toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 80; background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 14px; font-weight: 700; border: 2px solid var(--line); box-shadow: var(--shadow-sm); animation: pop .35s cubic-bezier(.3,1.6,.5,1) both; max-width: calc(100% - 32px); }
.toast.err { background: var(--coral); color: #fff; }

.fab { position: fixed; right: max(16px, calc(50% - 264px)); bottom: 22px; z-index: 20; width: 64px; height: 64px; border-radius: 22px; font-size: 30px; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; }

.pay-opt { display: flex; align-items: center; gap: 12px; padding: 14px; text-decoration: none; cursor: pointer; }
.pay-opt + .pay-opt { margin-top: 10px; }
.pay-logo { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 900; color: #fff; border: 2px solid var(--line); font-size: 18px; flex: none; }

.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.emoji-grid button { font-size: 22px; height: 44px; border-radius: 12px; border: 2px solid transparent; background: var(--card); cursor: pointer; }
.emoji-grid button.on { border-color: var(--line); background: var(--lime); }
.color-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-row button { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; }
.color-row button.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); }

.tell { position: relative; }
.tell .input { padding-right: 44px; }
.tell .spark { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); }
details.more summary { cursor: pointer; font-weight: 800; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
.skeleton { background: linear-gradient(90deg, var(--card), var(--bg), var(--card)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 16px; border: 2px solid var(--line); height: 72px; margin-top: 10px; }
@keyframes shimmer { to { background-position: -200% 0 } }

/* ---------- tip jar ---------- */
.tip-card { display: flex; flex-direction: column; gap: 10px; }
.tip-card .btn { align-self: flex-start; }
.tip-jar-ico { font-size: 30px; }
.tip-opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px; cursor: pointer; font: inherit; color: inherit; transition: transform .12s, box-shadow .12s; }
.tip-opt + .tip-opt { margin-top: 10px; }
.tip-opt:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--line); }
.tip-emoji { font-size: 28px; flex: none; }
.tip-emoji.big { font-size: 44px; }
.tip-amt { font-family: var(--head); font-weight: 800; font-size: 20px; }
.tip-kicker { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.tip-crazy { background: var(--coral-soft); }
.tip-crazy p, .tip-legend p { margin: 10px 0 12px; font-size: 14.5px; }
.tip-crazy.spin-in { animation: tipSpin .45s cubic-bezier(.3,1.6,.5,1) both; }
.tip-dice { width: 38px; height: 38px; font-size: 18px; }
.tip-legend { background: linear-gradient(135deg, #1B1340, #3A2A7A 55%, #1B1340); color: #FFF6D6; border-color: #06031A; position: relative; overflow: hidden; }
.tip-legend::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,217,61,.35) 45%, transparent 60%); background-size: 250% 100%; animation: legendShine 3.2s ease-in-out infinite; pointer-events: none; }
.tip-legend .tip-kicker, .tip-legend .tip-amt { color: var(--sun); }
.tip-legend h3 { color: #fff; }
.tip-legend-btn { background: var(--sun); color: #1B1340; position: relative; z-index: 1; }
@keyframes tipSpin { 0% { transform: rotateX(90deg) scale(.9); opacity: 0 } 100% { transform: none; opacity: 1 } }
@keyframes legendShine { 0% { background-position: 150% 0 } 100% { background-position: -100% 0 } }

@media (max-width: 380px) {
  .perks { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .perk { font-size: 12px; }
  .net-bars .nb { grid-template-columns: 84px 1fr 76px; }
  .action-row .btn { font-size: 13px; }
}
/* ---------- direct tips, tip nudge, payment-handle reminder ---------- */
.direct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.direct-grid .pay-opt + .pay-opt { margin-top: 0; }
.direct-grid .pay-opt { padding: 10px; gap: 10px; min-width: 0; }
.direct-grid .pay-logo { width: 36px; height: 36px; font-size: 16px; border-radius: 10px; }
.direct-grid .tiny { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 380px) { .direct-grid { grid-template-columns: 1fr; } }
.tip-nudge { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 75; width: calc(100% - 32px); max-width: 520px; animation: nudgeIn .5s cubic-bezier(.3,1.5,.5,1) both; }
.tip-nudge .card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: var(--card); }
.tip-nudge.out { animation: nudgeOut .3s ease-in both; }
@keyframes nudgeIn { from { transform: translate(-50%, -140%) rotate(-2deg); } to { transform: translate(-50%, 0); } }
@keyframes nudgeOut { to { transform: translate(-50%, -160%); opacity: 0; } }
.avatar-btn { position: relative; overflow: visible; }
.pay-dot { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--coral); color: #fff; font-size: 13px; font-weight: 900; line-height: 16px; text-align: center; border: 2px solid var(--line); animation: pop .4s .3s both; }
.pay-missing { background: var(--coral-soft); border: 2px dashed var(--coral); border-radius: 14px; padding: 10px 12px; font-size: 14px; font-weight: 700; }

/* ---------- easter eggs ---------- */
.steven.egg-spin svg { animation: eggSpin 1.1s cubic-bezier(.3,1.4,.5,1) both; }
@keyframes eggSpin { 0% { transform: rotateY(0) } 70% { transform: rotateY(1080deg) scale(1.15) } 100% { transform: rotateY(1080deg) scale(1) } }

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