:root {
  --bg: #f3eee4;
  --paper: #fbf8f1;
  --ink: #1c1a16;
  --mu: #675f53;
  --line: #d8cfbf;
  --acc: #c23d17;
  --ok: #2d7448;
  --tg-head: #f3eee4;
  --tg-bg: #f3eee4;
  --serif: 'Playfair Display', Georgia, serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  font: 400 15.5px/1.5 'Golos Text', system-ui, sans-serif;
  color: var(--ink); background: var(--bg);
  font-variant-numeric: lining-nums tabular-nums;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh; caret-color: var(--acc);
}
body.has-sheet { overflow: hidden; }
::selection { background: var(--ink); color: var(--paper); }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; border-radius: 4px; }
svg { width: 20px; height: 20px; flex: none; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12.5px; }

.app { max-width: 480px; margin: 0 auto; padding-bottom: calc(86px + env(safe-area-inset-bottom)); }

.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: 14px 20px 12px; background: var(--bg); border-bottom: 1px solid var(--ink);
}
.brand { font: 700 22px/1 var(--serif); letter-spacing: -.01em; }
.brand em { font-style: italic; font-weight: 500; }
.top-back { display: none; width: 34px; height: 34px; margin-left: -8px; align-items: center; justify-content: center; }
.is-sub .top-back { display: flex; }
.is-sub .brand { font-size: 18px; }
.top-balance { margin-left: auto; font-weight: 600; font-size: 15px; border-bottom: 1.5px solid var(--acc); padding-bottom: 1px; }

main { padding: 0 20px; }
.screen { display: none; }
.screen.is-active { display: block; animation: enter .5s var(--ease); }
@keyframes enter { from { opacity: 0; } }

.title { font: 700 34px/1.05 var(--serif); letter-spacing: -.02em; margin: 22px 0 10px; text-wrap: balance; }
.lead { color: var(--mu); max-width: 34ch; margin-bottom: 24px; text-wrap: pretty; }
.h { font: 700 21px/1.2 var(--serif); margin: 0 0 12px; }
.sec { margin-top: 36px; }
.note { color: var(--mu); font-size: 14px; margin: -4px 0 12px; text-wrap: pretty; }
.hello { margin: 18px 0 14px; color: var(--mu); font-size: 15px; }
.hello span { color: var(--ink); font-weight: 600; }

/* pass */
.pass {
  display: grid; grid-template-columns: 1fr 96px;
  background: var(--paper); border-radius: 14px;
  box-shadow: 0 1px 0 rgb(60 45 20 / .08), 0 18px 34px -22px rgb(60 45 20 / .45);
  -webkit-mask: radial-gradient(circle 10px at calc(100% - 96px) 0, #0000 97%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle 10px at calc(100% - 96px) 100%, #0000 97%, #000) bottom / 100% 51% no-repeat;
          mask: radial-gradient(circle 10px at calc(100% - 96px) 0, #0000 97%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle 10px at calc(100% - 96px) 100%, #0000 97%, #000) bottom / 100% 51% no-repeat;
  animation: pass .9s var(--ease);
}
@keyframes pass { from { transform: translateY(18px) rotate(-1.5deg); opacity: 0; } }
.pass-main { padding: 18px 18px 18px 20px; border-right: 1.5px dashed var(--line); }
.pass-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--mu); }
.pass h1 { font: 800 32px/1.02 var(--serif); letter-spacing: -.02em; margin: 14px 0 18px; }
.pass-meta { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.pass-meta dt { font-size: 12px; color: var(--mu); }
.pass-meta dd { font-size: 14px; font-weight: 600; white-space: nowrap; }
.pass-stub { display: grid; align-content: center; justify-items: center; gap: 2px; padding: 14px 6px; text-align: center; }
.pass-stub b { font: 800 50px/1 var(--serif); color: var(--acc); }
.pass-stub span { font-size: 12.5px; line-height: 1.25; color: var(--mu); }
.stub-btn { margin-top: 12px; width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; }

.actions { display: grid; gap: 10px; margin-top: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; border-radius: 999px;
  font-weight: 600; font-size: 16px;
  transition: transform .2s var(--ease), background-color .2s, color .2s;
}
.btn:active { transform: scale(.98); }
.btn-main { background: var(--ink); color: var(--paper); }
.btn-main svg { width: 18px; height: 18px; }
.btn-line, .btn-ghost { border: 1.5px solid var(--ink); }
.btn-small { min-height: 40px; padding: 0 16px; font-size: 14.5px; border: 1.5px solid var(--ink); }
.btn-main.btn-small { border: 0; }
.btn-icon { width: 52px; padding: 0; }
.btn:disabled { opacity: .4; cursor: default; }

/* streak */
.streak { margin-top: 30px; padding: 18px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); display: grid; gap: 14px; }
.streak-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.streak h2 { font: 700 19px/1.2 var(--serif); }
.streak-head span { font-size: 13.5px; color: var(--mu); }
.bonus-done { display: none; }
.is-claimed .bonus-wait { display: none; }
.is-claimed .bonus-done { display: block; }
.week { list-style: none; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week li { display: grid; place-items: center; height: 42px; border-radius: 50%; aspect-ratio: 1; margin: 0 auto; font-size: 13px; color: var(--mu); border: 1px solid var(--line); }
.week .d-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.week .d-today { border: 1.5px dashed var(--acc); color: var(--acc); font-weight: 700; }
.is-claimed .week .d-today { background: var(--acc); color: var(--paper); border-style: solid; transition: background-color .4s var(--ease); }
.streak .btn { justify-self: start; }

/* rows */
.rows, .menu, .ops, .top5 { list-style: none; }
.rows { border-top: 1px solid var(--ink); }
.rows li { border-bottom: 1px solid var(--line); }
.row-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 54px; text-align: left; }
.row-btn .k { font-weight: 500; }
.row-btn .v { margin-left: auto; color: var(--mu); }
.row-btn .k + .chev { margin-left: auto; }
.chev { width: 18px; height: 18px; color: var(--mu); }
.countries { font: 500 22px/1.35 var(--serif); text-wrap: pretty; }
.countries sup { font: 600 11px 'Golos Text', sans-serif; color: var(--acc); margin-left: 1px; }

/* plans */
.plans { display: grid; border-top: 1px solid var(--ink); }
.plan {
  display: grid; grid-template-columns: 26px 1fr auto; column-gap: 12px; align-items: baseline;
  padding: 18px 0; border-bottom: 1px solid var(--line); text-align: left;
}
.plan::before {
  content: ''; grid-row: 1 / 3; align-self: center; width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--ink); transition: box-shadow .25s var(--ease), background-color .25s;
}
.plan.is-on::before { background: var(--acc); border-color: var(--acc); box-shadow: inset 0 0 0 4px var(--paper); }
.plan-d { font-size: 18px; font-weight: 600; }
.plan-p { font: 700 26px/1 var(--serif); }
.plan.is-on .plan-p { color: var(--acc); }
.plan-n { grid-column: 2 / -1; color: var(--mu); font-size: 14px; }
.plans + .h, .pays + .link-row { margin-top: 30px; }

.pays { display: flex; flex-wrap: wrap; gap: 8px; }
.pay {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 15px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper); font-weight: 500; font-size: 15px;
  transition: background-color .2s, color .2s;
}
.pay svg { width: 18px; height: 18px; }
.pay.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.link-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px;
  border-bottom: 1px solid var(--line); font-weight: 500; text-align: left;
}
.link-row > svg:first-child { color: var(--acc); }
.link-row .chev { margin-left: auto; }
.pays + .link-row { border-top: 1px solid var(--ink); }

.paybar {
  position: sticky; bottom: calc(70px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px; margin: 28px -20px 0; padding: 14px 20px;
  background: var(--bg); border-top: 1px solid var(--ink);
}
.paybar > div { flex: 1; color: var(--mu); font-size: 13.5px; }
.paybar b { display: block; color: var(--ink); font: 700 26px/1.1 var(--serif); }

/* connect */
.devs { display: flex; gap: 0; border: 1px solid var(--ink); border-radius: 999px; padding: 3px; }
.dev {
  flex: 1; display: grid; justify-items: center; gap: 2px; padding: 9px 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 500; transition: background-color .25s var(--ease), color .25s;
}
.dev svg { width: 20px; height: 20px; }
.dev.is-on { background: var(--ink); color: var(--paper); }
.steps { list-style: none; counter-reset: s; margin-top: 26px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; column-gap: 8px; padding: 16px 0; border-top: 1px solid var(--line); }
.steps li::before { content: counter(s); grid-row: 1 / 4; font: 800 36px/1 var(--serif); color: var(--acc); }
.steps b { font-size: 17px; font-weight: 600; }
.steps span { color: var(--mu); font-size: 14.5px; }
.steps .btn { justify-self: start; margin-top: 10px; }
.steps + .link-row { border-top: 1px solid var(--ink); }

/* friends */
.ref { display: grid; gap: 12px; padding: 18px; border-radius: 14px; background: var(--paper); box-shadow: 0 16px 30px -24px rgb(60 45 20 / .5); }
.ref .mono { color: var(--mu); }
.ref-btns { display: flex; gap: 8px; }
.ref-btns .btn-main { flex: 1; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 26px 0; border-top: 1px solid var(--ink); }
.stats div { padding-top: 10px; }
.stats dt { font-size: 13px; color: var(--mu); }
.stats dd { font: 800 32px/1.1 var(--serif); }
.payout { display: grid; gap: 12px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.payout .note { margin: 0; }
.payout-top { display: flex; justify-content: space-between; }
.payout-top b { color: var(--acc); }
.bar { height: 4px; background: var(--line); }
.bar i { display: block; height: 100%; background: var(--acc); }
.payout .btn { justify-self: start; }
.friends-h, .payout + .h { margin-top: 34px; }
.top5 { counter-reset: t; border-top: 1px solid var(--ink); }
.top5 li { counter-increment: t; display: flex; align-items: baseline; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.top5 li::before { content: counter(t); width: 18px; font: 700 18px var(--serif); color: var(--acc); }
.top5 b { margin-left: auto; font-weight: 600; }
.top5 + .note { margin-top: 12px; }

/* profile */
.me { display: flex; align-items: center; gap: 14px; margin: 22px 0 20px; }
.me > div:last-child { display: grid; }
.me b { font: 700 24px/1.1 var(--serif); }
.me .mono { color: var(--mu); }
.ava { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--acc); color: var(--paper); font: 700 24px var(--serif); }
.wallet { display: grid; grid-template-columns: 1fr auto; align-items: end; padding: 16px 0 18px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); margin-bottom: 18px; }
.wallet span { color: var(--mu); font-size: 14px; }
.wallet b { grid-column: 1; font: 800 38px/1.05 var(--serif); }
.wallet .btn { grid-column: 2; grid-row: 1 / 3; background: var(--acc); }
.menu { margin-bottom: 22px; }
.menu button { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 54px; border-bottom: 1px solid var(--line); text-align: left; font-weight: 500; }
.menu .chev { margin-left: auto; }

.amounts { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--ink); border-radius: 12px; overflow: hidden; }
.amt { padding: 14px 0; font-weight: 600; border-right: 1px solid var(--line); transition: background-color .2s, color .2s; }
.amt:last-child { border: 0; }
.amt.is-on { background: var(--ink); color: var(--paper); }
.field { display: grid; gap: 6px; margin: 16px 0 26px; font-size: 13.5px; color: var(--mu); }
.field input { min-height: 50px; padding: 0 2px; border: 0; border-bottom: 1.5px solid var(--ink); background: transparent; color: var(--ink); font-size: 17px; outline: 0; }
.field input:focus { border-color: var(--acc); }
.field input::placeholder { color: #6e675b; }

.ops { border-top: 1px solid var(--ink); }
.ops li { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.ops li > div { flex: 1; display: grid; }
.ops span { color: var(--mu); font-size: 13.5px; }
.ops em { font-style: normal; font-weight: 600; }
.ops .plus { color: var(--ok); }
.ops .minus { color: var(--ink); }
.ops .empty b { color: var(--mu); }
.ops + .link-row { margin-top: 10px; }

.tabs {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 6;
  width: 100%; max-width: 480px; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--ink);
}
.tab { position: relative; display: grid; justify-items: center; gap: 2px; padding: 6px 0; font-size: 11px; font-weight: 500; color: var(--mu); }
.tab svg { width: 22px; height: 22px; }
.tab.is-on { color: var(--ink); font-weight: 700; }
.tab.is-on::after { content: ''; position: absolute; top: -7px; width: 26px; height: 3px; background: var(--acc); }

.sheet { position: fixed; inset: 0; z-index: 10; pointer-events: none; visibility: hidden; transition: visibility 0s .45s; }
.sheet-bg { position: absolute; inset: 0; background: rgb(28 26 22 / .4); opacity: 0; transition: opacity .3s; }
.sheet-body {
  position: absolute; left: 50%; bottom: 0; width: 100%; max-width: 480px;
  transform: translate(-50%, 100%); transition: transform .45s var(--ease);
  padding: 26px 20px calc(20px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0;
  background: var(--paper); display: grid; gap: 12px; text-align: center;
}
.sheet-body h2 { font: 700 24px var(--serif); }
.sheet-body .note { margin: 0; }
.sheet-body .field { text-align: left; margin: 0 0 6px; }
.sheet.is-open { pointer-events: auto; visibility: visible; transition: none; }
.sheet.is-open .sheet-bg { opacity: 1; }
.sheet.is-open .sheet-body { transform: translate(-50%, 0); }
.qr { justify-self: center; width: 220px; height: 220px; padding: 12px; background: #fff; border: 1px solid var(--line); }

.toast {
  position: fixed; left: 50%; top: 14px; z-index: 20; max-width: calc(100% - 40px);
  transform: translate(-50%, -150%); transition: transform .4s var(--ease);
  padding: 11px 18px; border-radius: 999px; background: var(--ink); color: var(--paper);
  font-weight: 500; font-size: 14px; box-shadow: 0 10px 24px -8px rgb(28 26 22 / .45);
}
.toast.is-on { transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.pass-row .num { white-space: nowrap; }
.pass-row span:first-child { max-width: 20ch; }
.streak-head { flex-direction: column; gap: 2px; }
