:root{
  --bg:#ffffff;
  --surface:#ffffff;
  --surface-soft:#f6f7f9;
  --surface-soft-2:#f1f3f6;
  --text:#111318;
  --muted:#7a7f89;
  --line:#e7e9ee;
  --accent:#2f5cff;
  --accent-soft:#edf2ff;
  --success:#0c9669;
  --danger:#c2362b;
  --shadow:0 8px 28px rgba(20,26,38,.06);
}

*{box-sizing:border-box}
html,body{
  margin:0;
  padding:0;
  min-height:100%;
  background:var(--bg);
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Roboto,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
body{min-height:100vh}
a{text-decoration:none;color:inherit}
button,input,select{font:inherit}
button{cursor:pointer}
svg{
  width:22px;
  height:22px;
  stroke:currentColor;
  fill:none;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.app-shell{
  width:100%;
  max-width:520px;
  min-height:100vh;
  margin:0 auto;
  background:#fff;
  padding-bottom:96px;
}

.app-header{
  position:sticky;
  top:0;
  z-index:30;
  height:72px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 18px;
  background:rgba(255,255,255,.96);
  backdrop-filter:blur(14px);
  border-bottom:1px solid rgba(231,233,238,.8);
}

.brand{
  font-size:21px;
  font-weight:800;
  letter-spacing:.16em;
}

.profile-pill{
  display:flex;
  align-items:center;
  gap:9px;
  padding:6px 10px 6px 6px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:17px;
}

.profile-pill small{
  display:block;
  margin-bottom:1px;
  color:var(--muted);
  font-size:10px;
  line-height:1.1;
}

.profile-pill strong{
  display:block;
  font-size:13px;
  line-height:1.15;
}

.profile-dot{
  width:34px;
  height:34px;
  border-radius:12px;
  display:grid;
  place-items:center;
  flex:0 0 34px;
  color:#fff;
  background:var(--accent);
  font-size:12px;
  font-weight:800;
}

.page{
  padding:20px 18px 30px;
}

.eyebrow{
  display:block;
  margin-bottom:6px;
  color:var(--muted);
  font-size:12px;
  font-weight:600;
}

.balance-section{
  padding:6px 2px 22px;
}

.balance-section h1{
  margin:0 0 8px;
  font-size:40px;
  line-height:1;
  letter-spacing:-.045em;
}

.balance-section p{
  margin:0;
  color:var(--muted);
  font-size:14px;
}

.card-carousel{
  display:flex;
  gap:12px;
  overflow-x:auto;
  scroll-snap-type:x mandatory;
  scrollbar-width:none;
  margin:0 -18px 24px;
  padding:0 18px 4px;
}

.card-carousel::-webkit-scrollbar,
.recipient-scroll::-webkit-scrollbar{display:none}

.card-carousel.full{margin-top:2px}

.bank-card{
  flex:0 0 88%;
  height:188px;
  position:relative;
  padding:20px;
  border-radius:26px;
  scroll-snap-align:start;
  overflow:hidden;
  box-shadow:var(--shadow);
}

.card-black{
  color:#fff;
  background:linear-gradient(145deg,#111318,#242832);
}

.card-white{
  color:#111318;
  background:linear-gradient(145deg,#ffffff,#f4f6f8);
  border:1px solid var(--line);
}

.card-navy{
  color:#fff;
  background:linear-gradient(145deg,#14264a,#264f8d);
}

.bank-card-top,
.bank-card-bottom{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.bank-card-top strong{
  font-size:16px;
  letter-spacing:.03em;
}

.bank-card-top span{font-weight:700}

.card-chip{
  width:44px;
  height:31px;
  margin-top:34px;
  border-radius:9px;
  background:linear-gradient(135deg,#d8bb76,#f0dda1);
}

.bank-card-bottom{
  position:absolute;
  left:20px;
  right:20px;
  bottom:20px;
}

.bank-card-bottom strong{font-size:16px}

.quick-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-bottom:24px;
}

.quick-actions a{
  min-height:104px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:12px;
  padding:14px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:20px;
}

.qa-icon{
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  flex:0 0 44px;
  color:var(--accent);
  background:var(--accent-soft);
  border-radius:14px;
}

.quick-actions strong{
  display:block;
  font-size:15px;
}

.quick-actions small{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:12px;
  line-height:1.35;
}

.surface{
  margin-bottom:18px;
  padding:18px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:24px;
}

.history-surface{padding-top:16px}

.section-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:12px;
}

.section-title h2,
.surface h2{
  margin:0;
  font-size:19px;
  line-height:1.2;
  letter-spacing:-.02em;
}

.section-title a,
.text-btn{
  flex:0 0 auto;
  padding:0;
  color:var(--accent);
  background:none;
  border:0;
  font-size:13px;
  font-weight:700;
}

.section-note{
  margin:8px 0 0;
  color:var(--muted);
  font-size:13px;
  line-height:1.5;
}

.tx-list{display:grid}

.tx-row{
  display:grid;
  grid-template-columns:44px minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  min-height:70px;
  padding:12px 0;
  border-bottom:1px solid var(--line);
}

.tx-row:last-child{border-bottom:0}

.tx-avatar{
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  border-radius:14px;
  color:#fff;
  background:var(--accent);
  font-weight:800;
}

.tx-avatar.income{
  color:var(--success);
  background:#eaf8f2;
}

.tx-main{min-width:0}

.tx-main strong{
  display:block;
  overflow:hidden;
  color:var(--text);
  font-size:15px;
  white-space:nowrap;
  text-overflow:ellipsis;
}

.tx-main small,
.tx-main em{
  display:block;
  overflow:hidden;
  margin-top:4px;
  color:var(--muted);
  font-size:12px;
  font-style:normal;
  white-space:nowrap;
  text-overflow:ellipsis;
}

.tx-amount{
  font-size:15px;
  font-weight:700;
  white-space:nowrap;
}

.tx-amount.plus{color:var(--success)}

.week-total{
  margin:10px 0 14px;
  font-size:26px;
  font-weight:800;
}

.bars{
  height:92px;
  display:flex;
  align-items:flex-end;
  gap:8px;
}

.bars i{
  display:block;
  flex:1;
  min-height:8px;
  border-radius:8px 8px 3px 3px;
  background:linear-gradient(180deg,#aebfff,var(--accent));
}

.days{
  display:flex;
  justify-content:space-between;
  margin-top:8px;
  color:var(--muted);
  font-size:11px;
}

.page-title{
  display:flex;
  align-items:center;
  gap:12px;
  margin:0 0 20px;
}

.page-title.simple{display:block}

.page-title h1{
  margin:0;
  font-size:29px;
  line-height:1.1;
  letter-spacing:-.035em;
}

.back{
  width:40px;
  height:40px;
  display:grid;
  place-items:center;
  flex:0 0 40px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:13px;
}

.alert,
.success-note{
  margin-bottom:14px;
  padding:13px 14px;
  border-radius:14px;
  font-size:13px;
  line-height:1.4;
}

.alert{
  color:#a7251c;
  background:#fff0ef;
  border:1px solid #ffd9d5;
}

.success-note{
  color:#087a54;
  background:#eaf8f2;
  border:1px solid #d0eee2;
}

.recipient-scroll{
  display:flex;
  gap:10px;
  overflow-x:auto;
  padding:2px 0 12px;
  scrollbar-width:none;
}

.recipient-chip{
  flex:0 0 104px;
  padding:12px 8px;
  text-align:center;
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
}

.recipient-chip.active{
  border-color:var(--accent);
  box-shadow:inset 0 0 0 1px var(--accent);
}

.recipient-avatar{
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  margin:0 auto 8px;
  color:#fff;
  border-radius:14px;
  font-size:12px;
  font-weight:800;
}

.recipient-chip strong{
  display:block;
  overflow:hidden;
  font-size:12px;
  white-space:nowrap;
  text-overflow:ellipsis;
}

.recipient-chip small{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:10px;
}

.selected-recipient{
  margin:4px 0 14px;
  padding:13px 14px;
  color:var(--muted);
  background:var(--surface-soft);
  border-radius:15px;
  font-size:13px;
  line-height:1.45;
}

.selected-recipient.filled{color:var(--text)}

.field-label{
  display:block;
  margin-top:15px;
  color:var(--muted);
  font-size:12px;
  font-weight:600;
}

.field{
  display:block;
  width:100%;
  height:48px;
  margin-top:7px;
  padding:0 14px;
  color:var(--text);
  background:#fff;
  border:1px solid var(--line);
  border-radius:14px;
  outline:none;
}

.field:focus{
  border-color:#9cb0ff;
  box-shadow:0 0 0 3px rgba(47,92,255,.08);
}

.amount-field{
  display:flex;
  align-items:center;
  margin:13px 0;
  padding:0 15px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
}

.amount-field input{
  width:100%;
  height:64px;
  color:var(--text);
  background:transparent;
  border:0;
  outline:none;
  font-size:34px;
  font-weight:800;
}

.amount-field span{
  font-size:22px;
  font-weight:700;
}

.amount-chips{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:7px;
}

.amount-chips button{
  height:38px;
  color:var(--text);
  background:var(--surface-soft);
  border:1px solid var(--line);
  border-radius:12px;
}

.card-options{
  display:grid;
  gap:8px;
  margin:12px 0 18px;
}

.card-options input{display:none}

.card-option{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:13px 14px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
}

.card-options input:checked + .card-option{
  border-color:var(--accent);
  box-shadow:inset 0 0 0 1px var(--accent);
}

.card-option span strong,
.card-option span small{display:block}

.card-option span small{
  margin-top:3px;
  color:var(--muted);
  font-size:11px;
}

.primary,
.secondary{
  min-height:50px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border-radius:15px;
  font-weight:700;
}

.primary{
  width:100%;
  color:#fff;
  background:var(--accent);
  border:1px solid var(--accent);
}

.secondary{
  color:var(--text);
  background:#fff;
  border:1px solid var(--line);
}

.details>div{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  padding:13px 0;
  border-bottom:1px solid var(--line);
}

.details>div:last-child{border-bottom:0}

.details span{
  color:var(--muted);
  font-size:13px;
}

.details strong{
  max-width:60%;
  text-align:right;
  font-size:13px;
  line-height:1.4;
  word-break:break-word;
}

.center-page{
  padding-top:120px;
  text-align:center;
}

.center-page p{color:var(--muted)}

.loader{
  width:70px;
  height:70px;
  margin:0 auto 18px;
  border:5px solid var(--line);
  border-top-color:var(--accent);
  border-radius:50%;
  animation:spin .8s linear infinite;
}

@keyframes spin{to{transform:rotate(360deg)}}

.success-block{
  padding:26px 0 18px;
  text-align:center;
}

.success-mark{
  width:74px;
  height:74px;
  display:grid;
  place-items:center;
  margin:0 auto 16px;
  color:#fff;
  background:var(--accent);
  border-radius:21px;
}

.success-mark svg{width:32px;height:32px}

.success-block h1{
  margin:5px 0;
  font-size:29px;
}

.success-amount{
  margin-top:14px;
  font-size:40px;
  font-weight:800;
}

.dual{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-bottom:10px;
}

.profile-head{
  padding:24px 0 22px;
  text-align:center;
}

.big-avatar{
  width:72px;
  height:72px;
  display:grid;
  place-items:center;
  margin:0 auto 14px;
  color:#fff;
  background:var(--accent);
  border-radius:21px;
  font-weight:800;
}

.profile-head h1{
  margin:0 0 6px;
  font-size:27px;
}

.profile-head p{
  margin:0;
  color:var(--muted);
}

.menu a{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 0;
  border-bottom:1px solid var(--line);
}

.menu a:last-child{border-bottom:0}

.menu svg{color:var(--accent)}

.menu strong,
.menu small{display:block}

.menu small{
  margin-top:3px;
  color:var(--muted);
  font-size:12px;
}

.week-fields{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:10px;
}

.week-fields label{
  color:var(--muted);
  font-size:12px;
}

.admin-tools{
  display:grid;
  gap:8px;
}

.danger{color:var(--danger)}

.empty{
  padding:24px 8px;
  color:var(--muted);
  text-align:center;
}

.bottom-nav{
  position:fixed;
  left:50%;
  bottom:0;
  z-index:100;
  width:min(520px,100%);
  height:76px;
  transform:translateX(-50%);
  display:grid;
  grid-template-columns:repeat(5,1fr);
  padding:8px 10px max(8px,env(safe-area-inset-bottom));
  background:rgba(255,255,255,.97);
  border-top:1px solid var(--line);
  backdrop-filter:blur(16px);
}

.bottom-nav a{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  color:#91959e;
  font-size:10px;
}

.bottom-nav a.active{
  color:var(--accent);
  font-weight:700;
}

.bottom-nav svg{
  width:20px;
  height:20px;
}

@media(max-width:390px){
  .app-header{padding:13px 14px}
  .page{padding-left:14px;padding-right:14px}
  .card-carousel{
    margin-left:-14px;
    margin-right:-14px;
    padding-left:14px;
  }
  .bank-card{flex-basis:90%}
  .balance-section h1{font-size:36px}
  .amount-chips{grid-template-columns:repeat(2,1fr)}
}

@media print{
  .app-header,.bottom-nav,.back,.dual,.admin-tools{display:none!important}
  .app-shell{padding-bottom:0}
  .page{padding:0}
}