:root{
 --bg:#0b0d12;
  --bg2:#0f1219;
  --card: rgba(20,24,34,.82);
  --card-strong: rgba(24,29,40,.92);
  --border: rgba(255,255,255,.08);
  --text:#f5f7ff;
  --muted:#b3bdd6;
  --accent:#ff9f0a;
  --accent2:#ffcc66;
  --accent-blue:#5b8cff;
  --glass: rgba(255,255,255,.05);
  --r:24px;
  --shadow: 0 24px 60px rgba(0,0,0,.45);
  --shadow-soft: 0 10px 30px rgba(0,0,0,.25);
  --ease: cubic-bezier(.22,.61,.36,1);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: "SF Pro Text","SF Pro Display",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Inter,Arial,sans-serif;
  color:var(--text);
  background:var(--bg);
  overflow-x:hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background */
.bg{
  position:fixed; inset:0; z-index:-3;
  background:
    radial-gradient(900px 500px at 20% 0%, rgba(255,159,10,.22), transparent 60%),
    radial-gradient(900px 600px at 80% 15%, rgba(91,140,255,.18), transparent 60%),
    radial-gradient(1200px 800px at 50% 100%, rgba(255,204,102,.12), transparent 60%),
    linear-gradient(180deg, #0b0d12 0%, #0f1219 50%, #0b0d12 100%);
}
.noise{
 position:fixed; inset:0; z-index:-2;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.2'/%3E%3C/svg%3E");
  opacity:.12;
  pointer-events:none;
}

/* Loader */
.appLoader{
  position:fixed; inset:0; z-index:1000;
  display:grid; place-items:center;
  background: radial-gradient(1400px 600px at 50% -20%, rgba(255,159,10,.15), transparent 60%),
              linear-gradient(180deg, #0a0c12 0%, #0f121a 100%);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.appLoader.done{
  opacity:0;
  transform: translateY(-10px) scale(.98);
  pointer-events:none;
}
.loaderCard{
  display:grid;
  gap:18px;
  place-items:center;
  padding:32px 36px;
  border-radius: 28px;
  background: rgba(16,20,30,.8);
  border:1px solid rgba(255,255,255,.08);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.loaderLogo{
  width:56px; height:56px;
  border-radius: 18px;
  display:grid; place-items:center;
  font-weight:900;
  color:#1a1204;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 18px 40px rgba(255,159,10,.25);
}
.loaderOrbit{
  position:relative;
  width:92px; height:92px;
  display:grid; place-items:center;
}
.loaderRing{
  position:absolute; inset:0;
  border-radius:50%;
  border:2px solid rgba(255,255,255,.12);
  border-top-color: rgba(255,159,10,.9);
  animation: spin 1.6s linear infinite;
}
.loaderRing.two{
  inset:12px;
  border-top-color: rgba(91,140,255,.9);
  animation-duration: 2.2s;
}
.loaderRing.three{
  inset:24px;
  border-top-color: rgba(255,204,102,.9);
  animation-duration: 2.8s;
}
.loaderText{
  font-weight:700;
  color:var(--muted);
  letter-spacing:.2px;
}

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

/* Topbar */
.topbar{
  position:sticky; top:0; z-index:20;
  display:flex; justify-content:space-between; align-items:center;
  padding:16px 18px;
  backdrop-filter: blur(18px) saturate(140%);
  background: rgba(10,12,18,.7);
  border-bottom:1px solid rgba(255,255,255,.08);
}
.brand{display:flex; align-items:center; gap:12px}
.logo{
  width:42px; height:42px; border-radius:14px;
  display:grid; place-items:center;
 background:linear-gradient(135deg,var(--accent),var(--accent2));
  color:#1a1204; font-weight:900;
  box-shadow: 0 14px 30px rgba(255,159,10,.25);
}
.title{font-weight:900; letter-spacing:.6px}
.subtitle{font-size:12px; color:var(--muted)}

/* Layout */
.wrap{
 max-width: 920px;
  margin: 24px auto 120px;
  padding: 0 18px 24px;
}
.view{animation: fadeIn .25s var(--ease) both}
@keyframes fadeIn{
  from{opacity:0; transform: translateY(10px)}
  to{opacity:1; transform: translateY(0)}
}

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.hidden{display:none !important}

h1{margin:0 0 10px; font-size:28px}
h2{margin:0 0 8px; font-size:22px}
.muted{color:var(--muted); font-size:14px; line-height:1.4}

.sep{height:1px; background: rgba(255,255,255,.08); margin: 16px 0}
.mt12{margin-top:12px}
.mt16{margin-top:16px}

/* Hero */
.hero{position:relative; overflow:hidden}
.heroGlow{
  position:absolute; inset:-40px;
  background:
    radial-gradient(500px 240px at 30% 25%, rgba(255,159,10,.25), transparent 70%),
    radial-gradient(480px 260px at 70% 60%, rgba(91,140,255,.18), transparent 70%);
  filter: blur(10px);
  z-index:-1;
  animation: floatGlow 6s ease-in-out infinite;
}
@keyframes floatGlow{
  0%,100%{transform: translateY(0)}
  50%{transform: translateY(10px)}
}
.tip{
  display:flex; gap:10px; align-items:flex-start;
  margin-top:14px;
  padding:12px;
  border-radius: 18px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}
.pill{
  font-size:12px;
  padding:6px 10px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  white-space:nowrap;
}

/* Fields */
.field{margin: 12px 0}
label{display:block; font-size:13px; color:var(--muted); margin-bottom:6px}
input, textarea{
  width:100%;
  background: rgba(10,14,22,.72);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 12px 12px;
  color: var(--text);
  outline:none;
  transition: border .2s var(--ease), box-shadow .2s var(--ease);
}
textarea{resize: vertical}
input:focus, textarea:focus{
  border-color: rgba(255,159,10,.7);
  box-shadow: 0 0 0 4px rgba(255,159,10,.14);
}
.hint{margin-top:6px; font-size:12px; color: rgba(179,189,214,.85)}

/* Buttons */
.btn{
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 16px;
  cursor:pointer;
  font-weight:700;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease), filter .2s var(--ease);
  position:relative;
  overflow:hidden;
}
.btn:hover{transform: translateY(-1px); filter: brightness(1.07)}
.btn:active{transform: translateY(0px) scale(.99)}
.btn.primary{
  border:none;
  background: linear-gradient(135deg, rgba(255,159,10,.98), rgba(255,204,102,.96));
  color:#1a1204;
  box-shadow: 0 16px 40px rgba(255,159,10,.25);
}
.btn.ghost{background: transparent}
.btn.small{padding:9px 12px; border-radius: 14px; font-size:13px; font-weight:700}
.btn.full{width:100%}
.btnSub{display:block; font-size:12px; opacity:.8; font-weight:700}

.spark{
  position:absolute;
  inset:0;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,.35) 35%, transparent 50%);
  transform: translateX(-120%);
  animation: shine 2.6s ease-in-out infinite;
  opacity:.6;
}
@keyframes shine{
  0%,55%{transform: translateX(-120%)}
  75%{transform: translateX(120%)}
  100%{transform: translateX(120%)}
}

/* icon btn */
.iconBtn{
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: var(--text);
  width: 42px;
  height: 42px;
  border-radius: 14px;
  cursor:pointer;
  display:grid;
  place-items:center;
  transition:.2s var(--ease);
}
.iconBtn:hover{transform: translateY(-1px); border-color: rgba(255,159,10,.4)}
.ico{font-size:16px}

/* Grid */
.grid2{display:grid; grid-template-columns:1fr; gap:12px; margin-top:12px}
@media (min-width:560px){ .grid2{grid-template-columns:1fr 1fr;} }

.headRow{display:flex; justify-content:space-between; align-items:flex-start; gap:12px}
.copyRow{display:flex; gap:8px; align-items:center}

/* Dashboard */
.dashTop{
  display:grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.dashTop > *{
  min-width: 0;
}

@media (min-width: 900px){
  .dashTop{grid-template-columns: 1.3fr .7fr;}
}
.addrRow{
  display:flex;
  gap:8px;
  align-items:center;
  margin-top:6px;
  flex-wrap:nowrap;
  overflow:hidden;
  max-width:100%;
  width:100%;
}
.addr{
  flex:1 1 auto;
  min-width:0;
  max-width:100%;
  display:block;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.addrRow .iconBtn{
  flex:0 0 auto;
}
.balCard{
  padding:12px;
  border-radius: 18px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}

.balanceLine{
  margin-top:6px;
  min-height:44px;
  display:flex;
  align-items:baseline;
  gap:6px;
  min-width:0;
  flex-wrap:wrap;
}
.balance{
  font-size:34px;
  font-weight:900;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
}
.unit{
  font-size:13px;
  color:var(--muted);
  font-weight:700;
  white-space:nowrap;
}

/* Toast */
.toast{
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: var(--text);
  word-break: break-word;
}

/* Skeleton / shimmer */
.skeleton{
  background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.12), rgba(255,255,255,.05));
  background-size: 200% 100%;
  animation: shimmer 1.25s linear infinite;
  border-radius: 12px;
}
@keyframes shimmer{
  0%{background-position: 200% 0}
  100%{background-position: -200% 0}
}
.skeletonText{height:34px; width: 160px}
.skeletonBox{height:72px; width:100%}

/* QR */
.qrWrap{
  position:relative;
  display:grid;
  place-items:center;
  padding: 18px 10px;
}
.qrGlow{
  position:absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,159,10,.22), transparent 60%),
              radial-gradient(circle at 70% 70%, rgba(91,140,255,.18), transparent 60%);
  filter: blur(22px);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse{
  0%,100%{transform: scale(1); opacity:.7}
  50%{transform: scale(1.05); opacity:1}
}
.qrBox{
  position:relative;
  display:grid;
  place-items:center;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
  transform: translateZ(0);
  animation: float 3.6s ease-in-out infinite;
}
@keyframes float{
  0%,100%{transform: translateY(0)}
  50%{transform: translateY(-6px)}
}

/* History */
.histList{display:flex; flex-direction:column; gap:10px; margin-top: 14px}
.histItem{
  border-radius: 18px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  padding: 12px;
  display:flex;
  justify-content:space-between;
  gap:10px;
}
.hL{min-width: 0}
.hT{font-weight:800; font-size:14px}
.hS{font-size:12px; color:var(--muted); margin-top:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width: 310px}
.hR{display:flex; flex-direction:column; align-items:flex-end}
.hAmt{font-weight:800}
.hTime{font-size:12px; color:var(--muted); margin-top:4px}

/* Settings blocks */
.settingBlock{
  border-radius: 18px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  padding: 12px;
  margin-top: 12px;
}
.settingTitle{font-weight:800; margin-bottom:6px}

/* Modal */
.modal{
  position:fixed; inset:0;
  background: rgba(0,0,0,.6);
  display:grid; place-items:center;
  padding: 20px;
  z-index: 50;
}
.modalCard{
  width:min(860px, 100%);
  background: rgba(18,22,32,.96);
  border:1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.modalHead{display:flex; justify-content:space-between; align-items:center}
.modalTitle{font-weight:800}

/* Bottom nav */
.bottomNav{
  position:fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  width: min(720px, calc(100% - 20px));
  padding: 10px;
  border-radius: 22px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(12,16,24,.7);
  backdrop-filter: blur(18px);
  display:grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  z-index: 20;
  box-shadow: var(--shadow-soft);
}
.navBtn{
  border:1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 18px;
  padding: 10px 6px;
  cursor:pointer;
  transition:.2s var(--ease);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
}
.navBtn:hover{background: rgba(255,255,255,.06); color: var(--text)}
.navBtn.active{
  background: rgba(255,159,10,.18);
  border-color: rgba(255,159,10,.25);
  color: var(--text);
}
.navIco{font-size:16px}
.navTxt{font-size:11px; font-weight:700}

@media (min-width: 1024px){
  .wrap{margin-top: 32px}
  .card{padding: 24px}
  .bottomNav{bottom: 22px}
}

@media (max-width: 480px){
  .topbar{padding:14px}
  .logo{width:38px;height:38px}
  .wrap{padding: 0 14px 20px}
  h1{font-size:24px}
  .balance{font-size:30px}
  .bottomNav{width: calc(100% - 16px)}
}

@media (prefers-reduced-motion: reduce){
  *{animation:none !important; transition:none !important}
}

/* ============================= */
/* 🔧 iOS ADDRESS & SCROLL FIX   */
/* ============================= */

/* Забороняємо горизонтальний scroll фізично */
html, body {
  overflow-x: hidden !important;
}

/* Адресний рядок — жорсткий */
.addrRow {
  flex-wrap: nowrap !important;
  align-items: center;
  overflow: hidden;
  max-width: 100%;
}

/* Адреса — без overflow:auto */
.addr {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden !important;
  white-space: nowrap;
  text-overflow: ellipsis;
  display: block;
}

.addrRow .iconBtn {
  flex: 0 0 auto;
}

/* iOS: прибираємо фантомний scroll */
.addr::-webkit-scrollbar {
  display: none;
}
