:root{
  --bg:#0f1115; --card:#171a21; --muted:#8b93a1; --text:#e8eaed;
  --green:#22c55e; --green-soft:#12291b; --line:#252a34; --danger:#ef4444;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{max-width:100%;overflow-x:hidden}
body{
  margin:0;padding:0;background:var(--bg);color:var(--text);
  font:16px/1.4 -apple-system,BlinkMacSystemFont,"SF Pro Text",Roboto,sans-serif;
  padding-bottom:92px;
}
h1{font-size:30px;margin:14px 16px 12px}
.hidden{display:none !important}
.muted{color:var(--muted);font-size:14px}
.pad{padding:16px}
.spacer{flex:1}
.page{padding:8px 0}

/* header */
.user-bar{display:flex;align-items:center;gap:10px;padding:12px 16px}
.avatar{
  width:40px;height:40px;border-radius:50%;background:var(--card);
  border:1.5px solid var(--green);color:var(--green);
  display:flex;align-items:center;justify-content:center;font-weight:700;
}
.uname{font-weight:600;color:var(--green)}
.chip{
  border:none;background:var(--card);border-radius:12px;padding:8px 10px;
  font-size:13px;color:var(--text);
}
.hdr-ico{
  border:1px solid var(--line);background:var(--card);border-radius:12px;
  width:42px;height:42px;display:flex;align-items:center;justify-content:center;
  color:var(--green);margin-left:8px;
}
.hdr-ico svg{width:24px;height:24px;display:block}
.hdr-ico:active{background:var(--green);color:#04120b}

/* cards */
.card{background:var(--card);border-radius:16px;padding:16px;margin:8px 16px}
.row{display:flex;align-items:center;justify-content:space-between}
.balance{font-size:34px;font-weight:700;margin:6px 0 2px}
.eye{border:none;background:none;opacity:.5;color:var(--text);display:flex}
.eye svg{display:block}
.assets{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.pill{background:#0d0f13;border:1px solid var(--line);border-radius:10px;padding:4px 8px;font-size:12px}

/* actions */
.actions{display:flex;gap:8px;padding:14px 12px 6px;overflow-x:auto;justify-content:space-between}
.grid-actions{
  display:grid;grid-template-columns:repeat(3,1fr);gap:12px;overflow:visible;
}
.grid-actions .action{min-width:0;width:100%}
.grid-actions .action .ico{width:100%;height:60px;border-radius:16px}
.action{
  flex:0 0 auto;border:none;background:none;font-size:11px;color:var(--muted);
  display:flex;flex-direction:column;align-items:center;gap:9px;min-width:60px;
}
.action .ico{
  width:52px;height:52px;border-radius:16px;background:var(--card);
  border:1px solid var(--line);display:flex;align-items:center;justify-content:center;
  color:var(--green);transition:.2s;
}
.action:active .ico{background:var(--green);color:#04120b}
.action .ico svg{width:22px;height:22px;display:block}
.btn-ghost.all-rates{
  display:block;box-sizing:border-box;width:calc(100% - 32px);
  margin:10px 16px 24px;
}

/* banner */
.banner{
  margin:10px 16px;border-radius:16px;padding:20px 16px;position:relative;overflow:hidden;
  background:linear-gradient(90deg,#12291b,#0e3a24);text-align:center;
}
.banner-text{color:#e8f5ec}
.banner-text b{display:block;margin-bottom:6px;font-size:16px}
.banner-sub{color:#a9c6b6;font-size:13px;margin:0 auto 14px;max-width:260px;line-height:1.35}
.banner-art{position:absolute;right:14px;top:14px;font-size:32px;opacity:.9}
.banner-invite{display:block;margin:0 auto;padding:12px 32px;font-size:15px;font-weight:600}
.btn-dark{
  border:none;background:#14171c;color:#fff;border-radius:12px;
  padding:9px 16px;font-size:14px;
}

.section-title{color:var(--muted);font-size:12px;letter-spacing:.6px;margin:16px 16px 6px}

/* rates */
.rates{padding:4px 16px 0}
.rate{display:flex;align-items:center;justify-content:space-between;padding:12px 0;border-bottom:1px solid var(--line)}
.rate:last-child{border-bottom:none}
.rate .sym{display:flex;align-items:center;gap:12px}
.rate .coin{
  width:30px;height:30px;border-radius:50%;display:flex;align-items:center;
  justify-content:center;color:#fff;font-weight:700;font-size:14px;flex:0 0 30px;
}
.rate .nm{color:var(--text);font-weight:600;font-size:14px;line-height:1.2}
.rate .nm small{display:block;color:var(--muted);font-size:11px;font-weight:400}
.rate .val{color:var(--green);font-weight:600;font-size:15px}

/* tabs */
.tabs{display:flex;gap:8px;padding:0 16px 12px;overflow-x:auto}
.tab{
  border:none;background:transparent;color:var(--muted);border-radius:20px;
  padding:8px 14px;font-size:14px;white-space:nowrap;
}
.tab.active{background:var(--green);color:#06210f}

/* history */
.op{display:flex;align-items:center;gap:12px;padding:12px 16px}
.op-ico{
  width:40px;height:40px;border-radius:50%;background:var(--green-soft);
  display:flex;align-items:center;justify-content:center;
}
.op-main{flex:1;min-width:0}
.op-title{font-weight:600}
.op-sub{color:var(--muted);font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.op-amt{font-weight:700;color:var(--green)}
.op-amt.neg{color:var(--danger)}
.op-pending{font-size:11px;color:#b45309}

/* services grid */
.grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:0 16px}
.tile{
  border:none;background:var(--card);border-radius:16px;padding:16px;
  min-height:120px;display:flex;flex-direction:column;justify-content:space-between;
  align-items:flex-start;gap:24px;font-size:15px;color:var(--text);text-align:left;
}
.tile-ico{
  width:44px;height:44px;border-radius:14px;display:flex;align-items:center;
  justify-content:center;color:#fff;
}
.tile-ico svg{width:22px;height:22px;display:block}
.i-green{background:#16a34a}.i-violet{background:#6d5efc}
.i-orange{background:#f2705a}.i-blue{background:#2aa9e0}

/* profile */
.row-card{display:flex;align-items:center;gap:12px}
.badge{background:var(--green-soft);color:var(--green);border-radius:10px;padding:4px 8px;font-size:12px}
.stats{display:flex;gap:10px;margin:0 8px}
.stat{flex:1}
.stat b{font-size:20px;display:block;margin-top:4px}
.ref-title{display:block;margin:6px 0 12px}
.ref-link{
  background:var(--green-soft);border-radius:12px;padding:10px;font-size:13px;
  word-break:break-all;margin-bottom:12px;
}
.btn-green{
  width:100%;border:none;background:var(--green);color:#fff;border-radius:12px;
  padding:14px;font-size:15px;font-weight:600;
}
.btn-ghost{
  width:100%;border:1px solid var(--line);background:transparent;color:var(--muted);
  border-radius:12px;padding:12px;font-size:14px;margin-top:8px;
}
.list-row{
  display:flex;align-items:center;justify-content:space-between;width:calc(100% - 32px);
  border:none;font-size:15px;color:var(--text);text-align:left;
}

/* modal */
.modal{position:fixed;inset:0;background:rgba(0,0,0,.35);display:flex;align-items:flex-end;z-index:50}
.sheet{
  background:var(--card);width:100%;border-radius:20px 20px 0 0;padding:16px;
  max-height:88vh;overflow:auto;
}
.sheet-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.x{border:none;background:none;font-size:18px;color:var(--muted)}
.field{margin:10px 0}
.field label{display:block;font-size:13px;color:var(--muted);margin-bottom:6px}
.field input,.field select{
  width:100%;border:1px solid var(--line);border-radius:12px;padding:12px;
  font-size:16px;background:#0d0f13;color:var(--text);
}
.hint{font-size:12px;color:var(--muted);margin-top:6px}
.quote{background:var(--card);border-radius:12px;padding:12px;margin:10px 0;font-size:14px}

/* order detail card */
.od-head{text-align:center;padding:6px 0 14px}
.od-amount{font-size:28px;font-weight:700;color:var(--green)}
.od-sub{color:var(--muted);font-size:14px;margin-top:2px}
.od-status{
  display:inline-block;margin-top:10px;font-size:12px;padding:4px 12px;
  border-radius:20px;
}
.od-status.s-ok{background:#0f2a17;color:var(--green)}
.od-status.s-wait{background:#3b2f10;color:#f5b942}
.od-status.s-bad{background:#2b1416;color:var(--danger)}
.od-card{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:4px 14px;margin-bottom:12px}
.od-card .kv{border-bottom:1px solid var(--line)}
.od-card .kv:last-child{border-bottom:none}
.kv{display:flex;justify-content:space-between;gap:12px;padding:11px 0;font-size:14px}
.kv span:first-child{color:var(--muted)}
.kv span:last-child{text-align:right;word-break:break-word;max-width:60%}
.od-req{
  background:var(--green-soft);border:1px solid #1c4d2c;border-radius:14px;
  padding:12px 14px;margin-bottom:12px;
}
.od-req-label{color:var(--green);font-size:12px;margin-bottom:6px}
.od-req-value{font-size:13px;word-break:break-all;color:var(--text)}

/* hide horizontal scrollbars on the action/tab rows */
.actions::-webkit-scrollbar,.tabs::-webkit-scrollbar{display:none}
.actions,.tabs{scrollbar-width:none;-ms-overflow-style:none}
.err{color:var(--danger);font-size:14px;margin:8px 0}
.ok{color:var(--green);font-size:14px;margin:8px 0}
.mono{font-family:ui-monospace,Menlo,monospace;word-break:break-all;background:var(--card);padding:10px;border-radius:10px}
.faq-q{font-weight:600;margin-top:12px}
.faq-a{color:var(--muted);font-size:14px;margin-top:4px}

/* bottom nav */
.bottom{
  position:fixed;left:0;right:0;bottom:0;background:#0d0f13;
  border-top:1px solid var(--line);display:flex;align-items:center;
  justify-content:space-around;padding:8px 4px calc(8px + env(safe-area-inset-bottom));
}
.nav{
  border:none;background:none;color:var(--muted);font-size:11px;display:flex;
  flex-direction:column;align-items:center;gap:3px;flex:1;
}
.nav span{opacity:.6;display:flex}
.nav span svg{width:22px;height:22px;display:block}
.nav.active{color:var(--green)}
.nav.active span{opacity:1}
.qr-btn{
  flex:0 0 56px;height:56px;border-radius:50%;border:none;background:var(--green);
  color:#04120b;margin-top:-22px;box-shadow:0 6px 20px rgba(43,255,158,.4);
  display:flex;align-items:center;justify-content:center;
}
.qr-btn svg{width:26px;height:26px;display:block}

/* KYC / anonymous choice screen (п.2) */
.kyc-q{font-size:16px;font-weight:600;margin-bottom:14px;color:var(--text)}
.kyc-opt{display:flex;align-items:flex-start;gap:10px;padding:12px;margin-bottom:8px;
  background:var(--card);border:1px solid var(--line);border-radius:12px;
  font-size:14px;color:var(--text);cursor:pointer}
.kyc-opt input{margin-top:2px;accent-color:var(--green)}
.kyc-note{border:1px solid var(--line);border-left:3px solid var(--green);
  background:var(--green-soft);border-radius:10px;padding:12px;margin:12px 0;
  font-size:13px;color:#a9c6b6;line-height:1.4}

/* Services description cards (п.13) */
.svc-list{display:flex;flex-direction:column;gap:14px;padding:4px 16px 16px}
.svc-card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:16px}
.svc-head{display:flex;align-items:center;gap:12px;margin-bottom:10px}
.svc-ico{width:44px;height:44px;border-radius:14px;display:flex;align-items:center;
  justify-content:center;color:#fff;flex:0 0 44px}
.svc-ico svg{width:22px;height:22px}
.svc-title{font-size:16px;font-weight:600;color:var(--text)}
.svc-desc{font-size:14px;line-height:1.5;color:var(--muted)}
.svc-desc a{color:var(--green);text-decoration:none;font-weight:600}

/* Buy/Sell tabs above the rates list (п.4) */
.rate-tabs{display:flex;gap:8px;padding:0 16px 8px}
.rate-tab{flex:1;border:1px solid var(--line);background:var(--card);color:var(--muted);
  border-radius:10px;padding:9px;font-size:14px;font-weight:600}
.rate-tab.active{background:var(--green);color:#04120b;border-color:var(--green)}
